GithubHelp home page GithubHelp logo

westphae / geomag Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 3.0 5.12 MB

Golang implementation of the NOAA World Magnetic Model

License: MIT License

Go 100.00%
go golang golang-library golang-package golang-application magnetic-fields magnetic-field magnetic-north world-magnetic-model noaa

geomag's People

Contributors

westphae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

geomag's Issues

Test File

So sorry to open an issue for this, but you don't have discussions enabled. Could you please let me know where you found your WMM2020_TEST_VALUES.txt data? I am writing my own version of this, and can only find the WMM2020testvalues.pdf file that came with the Legacy C app.

how to get a version to show on pkg.go.dev

Hi, pkg.go.dev maintainer here. This is a response to your anonymous feedback from February 8. Apologies for the delay.

We get all our module information from the proxy (proxy.golang.org). So whenever you or anyone else go gets a version of your module through the proxy (which is the default setting for go get), then we'll soon see it and process it.

So if you just run go get github.com/westphae/[email protected], it should show up on pkg.go.dev shortly.

We're working on a better system, where you can click a button on the site to fetch a new version.

race condition issue

func GetGEOID(lat, lng float64) (float64, error) {
	//in order to use package, has to move
	loc := egm96.NewLocationGeodetic(lat, math.Mod(lng+360, 360), 0)
	h, err := loc.HeightAboveMSL()
	if err != nil {
		return 0, err
	}
	geoid := -h
	return geoid, nil
}

func MSLAltToW84Alt(lat, lng, msl_height float64) (float64, error) {
	geoid, err := GetGEOID(lat, lng)
	if err != nil {
		return 0, err
	}
	return msl_height + geoid, nil
}

==================

WARNING: DATA RACE
Write at 0x00c039950ba0 by goroutine 73:
github.com/westphae/geomag/pkg/egm96.loadEGM96Grid()
C:/Users/chand/go/pkg/mod/github.com/westphae/[email protected]/pkg/egm96/egm96.go:264 +0x818
github.com/westphae/geomag/pkg/egm96.Location.HeightAboveMSL()
C:/Users/chand/go/pkg/mod/github.com/westphae/[email protected]/pkg/egm96/egm96.go:132 +0x68
bitbucket.org/anra-contract-support/wc-adsb-pingstation/common/utils.GetGEOID()
C:/Users/chand/Desktop/wc-adsb-pingstation/common/utils/altitude.go:28 +0x65
bitbucket.org/anra-contract-support/wc-adsb-pingstation/common/utils.MSLAltToW84Alt()
C:/Users/chand/Desktop/wc-adsb-pingstation/common/utils/altitude.go:10 +0x154
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb/model.Traffic.ParseToAircraftState()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/model/traffic.go:98 +0x13b
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneTraffic()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:79 +0xef
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneUDPMessage.func1()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:69 +0x124

Previous read at 0x00c039950ba0 by goroutine 273:
github.com/westphae/geomag/pkg/egm96.Location.HeightAboveMSL()
C:/Users/chand/go/pkg/mod/github.com/westphae/[email protected]/pkg/egm96/egm96.go:154 +0x4cf
bitbucket.org/anra-contract-support/wc-adsb-pingstation/common/utils.GetGEOID()
C:/Users/chand/Desktop/wc-adsb-pingstation/common/utils/altitude.go:28 +0x65
bitbucket.org/anra-contract-support/wc-adsb-pingstation/common/utils.MSLAltToW84Alt()
C:/Users/chand/Desktop/wc-adsb-pingstation/common/utils/altitude.go:10 +0x154
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb/model.Traffic.ParseToAircraftState()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/model/traffic.go:98 +0x13b
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneTraffic()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:79 +0xef
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneUDPMessage.func1()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:69 +0x124

Goroutine 73 (running) created at:
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneUDPMessage()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:69 +0x208
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessMessageChannel.func1()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:56 +0x118

Goroutine 273 (running) created at:
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneUDPMessage()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:69 +0x208
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessMessageChannel.func1()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:56 +0x118

==================

Error model should be an asset

Currently the error model is hard-coded in the wmm package. It depends on the cof file, so really should be an asset.

How can i install it?

Hello, i am begginer in Go and someone can tell me how i install this repo? please

geometric altitude to wgs84 altitude

Hi, I am very new to gis, but if I have lat, long, and a geometric altitude (above mean sea level), can I use this package to convert the geometric altitude to the wgs84 altitude or egm96 altitude?

lat, lng := 39.865315, -121.32870643118366
loc := egm96.NewLocationGeodetic(lat, lng, 0)
h, err := loc.HeightAboveMSL()
if err != nil {
log.Panicln("err", err)
}

however, I got:

2023/02/22 09:53:41 err requested longitude -121.33 lies outside of EGM96 longitude range  0.0 to 360.0
panic: err requested longitude -121.33 lies outside of EGM96 longitude range  0.0 to 360.0

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.