miniwinwm / WMM_Tiny

A tiny implementation of the World Magnetic Model to calculate magnetic variation. This project is actively maintained.
MIT License
24 stars 7 forks source link

Recommendations for how to modify to be a function of altitude? #3

Closed patrickwalton closed 2 years ago

patrickwalton commented 2 years ago

I'd like to use WMM for a satellite application running on Arduino ecosystem, but this library and WMM_Tinier aren't functions of altitude. Any recommendations for how to modify this library to be a function of altitude?

If I understand right, you used the wmm_cof_converter program to compress the coefficients file? Does the compression need to be changed to get attitude?

miniwinwm commented 2 years ago

Use the full WMM source code from NOAA, not this library. It's here...

https://www.ngdc.noaa.gov/geomag/WMM/soft.shtml

patrickwalton commented 2 years ago

The full WMM source code is overkill in this case. I found another library that uses almost the same E0000 function as you while including altitude, but as part of a much larger collection.

Also, your approach is quite different from the NOAA full source code, which doesn't contain the E0000 function at all, for example. Can you shed some light on how you built your library?

Since NOAA links to your repo for embedded C99 applications, I think it would be good to enable altitude returns (it's like 5 lines of code and a few more arguments). Can I make a pull request for this? I already have it implemented.

miniwinwm commented 2 years ago

I developed this library for use on resource constrained devices in marine applications where altitude is of no interest. I'm not adding altitude back in having worked to remove it, so I won't be accepting a pull request that does that.

My code is based on NOAA's legacy C implementation from here...

https://www.ngdc.noaa.gov/geomag/WMM/thirdpartycontributions.shtml