- Notifications
You must be signed in to change notification settings - Fork3
python program of the geomagnetic field without fortran complier
License
zzyztyy/pyGeoMagnetic
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a Python program about geomagnetic field based on IGRF (International Geomagnetic Reference Field) and Apex model. It can transform coordinate between GeoGraphical and GeoMagnetic.
The source code Apex model come from Fortran file. In this package, we reform them by using Python. Although Python can translate Fortran bypyf
module, it needs Fortran compiler. This package can runwithout Fortran compiler.
Download latest released version and unzip it. Then Install (requires NumPy and pyIGRF before installation):
python setup.py install
Here is an example:
importpyGeoMagApexaspgma# GeoGraphic to GeoMagneticmlat,mlon=pgma.gd2qd(lat=39.3,lon=116.1)# GeoMagnetic to GeoGraphicglat,glon=pgma.qd2gd(mlat=23.1,mlon=-171.1)# altitude and date can be set, default as 0km and 2005mlat,mlon=pgma.gd2qd(lat=20.2,lon=103.1,alt=100,date=2006.)
This package is refer toMagnetic-Apex and Quasi-Dipole coordinate. This paper give some Fortran file about two models called Apex model and modified Apex model which includes too many functions and complex math and physics. So in this package, we change the structure but keep the mathematic method but only for Apex model.Modified Apex model is too difficult but fast. We will do it next setp(Maybe).
About
python program of the geomagnetic field without fortran complier