Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gnss domain to tilde config #2262

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions cmd/tilde-config/gnss.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package main

import (
"fmt"
"math"

"github.com/GeoNet/delta/meta"
)

func (t *Tilde) Gnss(set *meta.Set) error {
var stns []Station

// all marks are GNSS stations
for _, m := range set.Marks() {
stns = append(stns, Station{
Code: m.Code,
Description: m.Name,
Start: toTimePtr(m.Start),
End: toTimePtr(m.End),
Latitude: toFloat(fmt.Sprintf("%0.4f", m.Latitude)),
Longitude: toFloat(fmt.Sprintf("%0.4f", m.Longitude)),
Elevation: toFloat(fmt.Sprintf("%0.0f", math.Round(m.Elevation))),
})
}

// update domains
t.Domains = append(t.Domains, Domain{
Name: "gnss",
Description: "Global Navigation Satellite System Sensors",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @wilsonjord ! After a discussion with @elidana and @rumachan I still would like to propose changes to the domain description and go with "Global Navigation Satellite System Stations". Sorry for the slow review!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"station" is the only terminology that is not used in tilde domain descriptions (see https://tilde.geonet.org.nz/v4/dataSummary/) and in the domain model it refers to the generalised "location" where time series data are available (can be from multiple sensors for some domains). So maybe let's just stick to Global Navigation Satellite System as a compromise?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elidana @aleks-spes could I get a final confirmation on the last question from @elidana ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i personally vote for Global Navigation Satellite System as a compromise

Stations: stns,
})

return nil
}
7 changes: 6 additions & 1 deletion cmd/tilde-config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func main() {
flag.StringVar(&settings.geomag, "geomag", "GM", "geomagnetic network code")
flag.StringVar(&settings.scandoas, "scandoas", "EN", "scandoas network code")
flag.StringVar(&settings.extra, "extra", "GM=SM_SMHS_50", "attach extra stations and locations to a network, e.g. GM=SM_SMHS_50")
flag.StringVar(&settings.output, "output", "", "output dart configuration file")
flag.StringVar(&settings.output, "output", "", "output tilde configuration file")

flag.Parse()

Expand Down Expand Up @@ -100,6 +100,11 @@ func main() {
log.Fatalf("unable to build scandoas configuration: %v", err)
}

// update gnss gomain
if err := tilde.Gnss(set); err != nil {
log.Fatalf("unable to build gnss configuration: %v", err)
}

switch {
case settings.output != "":
// output file has been given
Expand Down
Loading