PyGeoMagnetic
python program of the geomagnetic field without fortran complier
Install / Use
/learn @zzyztyy/PyGeoMagneticREADME
pyGeoMagnetic
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 by pyf module, it needs Fortran compiler. This package can run without Fortran compiler.
How to use it?
Download latest released version and unzip it. Then Install (requires NumPy and pyIGRF before installation):
python setup.py install
Here is an example:
import pyGeoMagApex as pgma
# GeoGraphic to GeoMagnetic
mlat, mlon = pgma.gd2qd(lat=39.3, lon=116.1)
# GeoMagnetic to GeoGraphic
glat, glon = pgma.qd2gd(mlat=23.1, mlon=-171.1)
# altitude and date can be set, default as 0km and 2005
mlat, mlon = pgma.gd2qd(lat=20.2, lon=103.1, alt=100, date=2006.)
Apex Model and Modified Apex Model
This package is refer to Magnetic-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).
Related Skills
node-connect
338.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
83.4kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
83.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
338.0kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
