Skip to content

Commit

Permalink
feat: add GNSS as a domain
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonjord committed Jan 15, 2025
1 parent 23b15ce commit 6cd449c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
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
}
5 changes: 5 additions & 0 deletions cmd/tilde-config/main.go
Original file line number Diff line number Diff line change
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

0 comments on commit 6cd449c

Please sign in to comment.