timduly4 / pyglow

Upper atmosphere climatological models in Python
MIT License
102 stars 56 forks source link

Any plans to implement IGRF-13? #135

Open wtbsvs opened 3 years ago

wtbsvs commented 3 years ago

IGRF-13 has been available for some time now. Any plans to integrate it into pyglow? https://www.ngdc.noaa.gov/IAGA/vmod/igrf.html Thanks.

bharding512 commented 3 years ago

This (along with MSIS 2.0) would be highly desirable. PRs are welcome.

I noticed that the IGRF website is linking to a Python implementation, PyIGRF. Perhaps pyglow could simply use this instead of rolling its own?

wtbsvs commented 3 years ago

I was debating that.
I already have stuff using the PyGlow API to IGRF. Switching to another API would take some time and effort.

bharding512 commented 3 years ago

Same here. My proposal is that pyglow could implement the new IGRF by using PyIGRF under the hood.

On the other hand, it may not be too hard to simply update the coefficients. I haven't looked into this.

wtbsvs commented 3 years ago

pyIGRF just has basic support - return a value for any given location and time. However, there is a table in the pyIGRF package rows of harmonics, columns of years. Looks a bit different from the previous published tables on the site. I tried finding the appropriate table in pyglow but it looks like those may be locked up in a .so file (igrf11py.{}.so igrf12py.{}.so) perhaps compiled with cython? What would be involved in updating the table?

bharding512 commented 3 years ago

pyglow implements IGRF by wrapping the Fortran functions. It seems like pyIGRF is a pure Python implementation which (assuming it's been validated) is simpler and easier maintained. If pyIGRF implements past versions of IGRF as well, I'd be in favor of scrapping the pyglow implementation entirely and simply calling pyIGRF