https://github.com/zzyztyy/pyigrf
https://github.com/zzyztyy/pyigrf
igrf python3
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zzyztyy/pyigrf
- Owner: zzyztyy
- License: mit
- Created: 2018-10-07T07:55:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-11T23:56:45.000Z (about 1 year ago)
- Last Synced: 2025-09-21T13:38:22.316Z (9 months ago)
- Topics: igrf, python3
- Language: Python
- Size: 93.8 KB
- Stars: 32
- Watchers: 3
- Forks: 15
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyIGRF
## What is pyIGRF?
This is a package of IGRF-14 (International Geomagnetic Reference Field) about python version.
We can calculate magnetic field intensity and transform coordinate between GeoGraphical and GeoMagnetic.
It don't need any Fortran compiler or NumPy package.
## How to Install?
Download this package and run install.
>```python setup.py install```
## How to Use it?
First import this package.
> ```import pyIGRF```
You can calculate magnetic field intensity.
>```pyIGRF.igrf_value(lat, lon, alt, date)```
or calculate the annual variation of magnetic filed intensity.
>```pyIGRF.igrf_variation(lat, lon, alt, date)```
the response is 7 float number about magnetic filed which is:
- D: declination (+ve east)
- I: inclination (+ve down)
- H: horizontal intensity
- X: north component
- Y: east component
- Z: vertical component (+ve down)
- F: total intensity
*unit: degree or nT*
If you want to use IGRF-14 more flexibly, you can use module *calculate*.
There is two function which is closer to Fortran. You can change it for different coordination.
>```from pyIGRF import calculate```
Another module *load_coeffs* can be used to get *g[m][n]* or *h[m][n]* same as that in formula.
>```from pyIGRF.load_coeffs import get_coeffs```
## Model Introduction and igrf13-coeffs File Download
https://www.ngdc.noaa.gov/IAGA/vmod/igrf.html