Overview
ChaosMagPy is a simple Python package for evaluating the CHAOS geomagnetic
field model and other models of Earth's magnetic field. The latest CHAOS model
is available at http://www.spacecenter.dk/files/magnetic-models/CHAOS-7/. To
quickly get started, download the complete working example including the latest
model under the "Forward code" section.
Documentation
The documentation of the current release is available on Read the Docs
(https://chaosmagpy.readthedocs.io/en/)
|pypi| |docs| |doi| |license|
.. |pypi| image:: https://badge.fury.io/py/chaosmagpy.svg
:target: https://badge.fury.io/py/chaosmagpy/
.. |docs| image:: https://readthedocs.org/projects/chaosmagpy/badge/
:target: https://chaosmagpy.readthedocs.io/en/
:alt: Documentation Status
.. |license| image:: https://img.shields.io/badge/License-MIT-blue.svg
:target: license.html
.. |doi| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3352398.svg
:target: https://doi.org/10.5281/zenodo.3352398
Citation
To reference ChaosMagPy in publications, please cite the package itself
https://doi.org/10.5281/zenodo.3352398
and, for CHAOS-7, the relevant journal publication:
Finlay, C.C., Kloss, C., Olsen, N., Hammer, M. Toeffner-Clausen, L.,
Grayver, A and Kuvshinov, A. (2020), The CHAOS-7 geomagnetic field model and
observed changes in the South Atlantic Anomaly, Earth Planets and Space 72,
doi:10.1186/s40623-020-01252-9
or, for the earlier CHAOS models, some of the following:
Finlay, C.C., Olsen, N., Kotsiaros, S., Gillet, N. and Toeffner-Clausen, L. (2016),
Recent geomagnetic secular variation from Swarm and ground observatories
as estimated in the CHAOS-6 geomagnetic field model Earth Planets Space,
Vol 68, 112. doi: 10.1186/s40623-016-0486-1
Olsen, N., Luehr, H., Finlay, C.C., Sabaka, T. J., Michaelis, I., Rauberg, J. and Toeffner-Clausen, L. (2014),
The CHAOS-4 geomagnetic field model, Geophys. J. Int., Vol 197, 815-827,
doi: 10.1093/gji/ggu033.
Olsen, N., Luehr, H., Sabaka, T.J., Mandea, M. ,Rother, M., Toeffner-Clausen, L. and Choi, S. (2006),
CHAOS — a model of Earth's magnetic field derived from CHAMP, Ørsted, and SAC-C magnetic satellite data,
Geophys. J. Int., vol. 166 67-75
Installation
ChaosMagPy relies on the following (some are optional):
- python>=3.6
- numpy<=1.26 (loading MAT-files fails in v2.0, waiting for fix in hdf5storage)
- scipy
- pandas
- cython
- h5py
- hdf5storage>0.1.17
- pyshp>=2.3.1
- matplotlib>=3.6 (optional, used for plotting)
- lxml (optional, used for downloading latest RC-index file)
Specific installation steps using the conda/pip package managers are as follows:
-
Install packages with conda:
conda install python "numpy<2" scipy pandas cython pyshp h5py matplotlib lxml
-
Install remaining packages with pip:
pip install hdf5storage
-
Finally install ChaosMagPy either with pip from PyPI:
pip install chaosmagpy
Or, if you have downloaded the distribution archives from the Python Package
Index (PyPI) at https://pypi.org/project/chaosmagpy/#files, install
ChaosMagPy using the built distribution:
pip install chaosmagpy-x.x-py3-none-any.whl
replacing x.x
with the relevant version, or using the source
distribution:
pip install chaosmagpy-x.x.tar.gz