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",
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