pyglow icon indicating copy to clipboard operation
pyglow copied to clipboard

Any plans to implement IGRF-13?

Open wtbsvs opened this issue 4 years ago • 5 comments

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.

wtbsvs avatar Feb 10 '21 17:02 wtbsvs

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?

bharding512 avatar Feb 10 '21 17:02 bharding512

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

wtbsvs avatar Feb 11 '21 16:02 wtbsvs

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.

bharding512 avatar Feb 11 '21 16:02 bharding512

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?

wtbsvs avatar Feb 11 '21 20:02 wtbsvs

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

bharding512 avatar Feb 13 '21 17:02 bharding512