Skip to main content

Evaluate the CHAOS geomagnetic field model.

Project description

Overview

ChaosMagPy is a simple Python package for evaluating the CHAOS-7 geomagnetic field model. To quickly get started, download a 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.

doi Documentation Status license

References

To reference ChaosMagPy in publications, please cite the package itself

https://doi.org/10.5281/zenodo.3352398

and all three 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

License

MIT License

Copyright (c) 2019 Clemens Kloss

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Installation

ChaosMagPy relies on the following:

  • python>=3.6

  • numpy

  • scipy

  • pandas

  • cython

  • h5py

  • cartopy>=0.17

  • matplotlib>=3

  • cdflib

  • hdf5storage

Specific installation steps using the conda/pip package managers are as follows:

  1. Install packages with conda:

    >>> conda install python numpy scipy pandas cython cartopy matplotlib h5py
    
  2. Install packages with pip:

    >>> pip install cdflib hdf5storage
    
  3. Finally install ChaosMagPy either with pip from PyPI:

    >>> pip install chaosmagpy
    

    or, if you have downloaded the package files to the current working directory, with:

    >>> pip install chaosmagpy-x.x-py3-none-any.whl
    

    or, alternatively

    >>> pip install chaosmagpy-x.x.tar.gz
    

    replacing x.x with the correct version.

Changelog

Version 0.2

Date: October 3, 2019
Release: v0.2

Features

  • Updated RC-index file to recent version (August 2019)

  • Added option nmin to synth_values.

  • Vectorized mjd2000, mjd_to_dyear and dyear_to_mjd.

  • New function local_time for a simple computation of the local time.

  • New function zenith_angle for computing the solar zenith angle.

  • New function gg_to_geo and geo_to_gg for transforming geodetic and geocentric coordinates.

  • Added keyword start_date to rotate_gauss_fft

  • Improved performance of synth_coeffs_sm and synth_coeffs_gsm.

  • Automatically import model_utils.synth_values.

Deprecations

  • Rewrote load_matfile: now traverses matfile and outputs dictionary.

  • Removed breaks_euler and coeffs_euler from CHAOS class attributes. Euler angles are now handled as Base class instance.

Bugfixes

  • Fixed collocation matrix for unordered collocation sites. Endpoint now correctly taken into account.

Version 0.1

Date: May 10, 2019
Release: v0.1

Features

  • New CHAOS class method synth_euler_angles to compute euler angles for the satellites from the CHAOS model (used to rotate vectors from magnetometer frame to the satellite frame).

  • Added CHAOS class methods synth_values_tdep, synth_values_static, synth_values_gsm and synth_values_sm for field value computation.

  • RC index file now stored in HDF5 format.

  • Filepaths and other parameters are now handled by basicConfig.

  • Added extrapolation keyword to CHAOS class method synth_coeffs, linear by default.

  • mjd2000 now also accepts datetime class instances.

  • load_RC_datfile downloads latest RC-index file from the website if no file is given.

Bugfixes

  • Resolved issue in model_utils.degree_correlation.

  • Changed the date conversion to include hours and seconds not just the day when plotting the timeseries.

Version 0.1a3

Date: February 19, 2019
Release: v0.1a3

Features

  • New CHAOS class method save_matfile to output MATLAB compatible files of the CHAOS model (using the hdf5storage package).

  • Added epoch keyword to basevector input arguments of GSM, SM and MAG coordinate systems.

Bugfixes

  • Fixed problem of the setup configuration for pip which caused importing the package to fail although installation was indicated as successful.

Version 0.1a2

Date: January 26, 2019
Release: v0.1a2

Features

  • mjd_to_dyear and dyear_to_mjd convert time with microseconds precision to prevent round-off errors in seconds.

  • Time conversion now uses built-in calendar module to identify leap year.

Bugfixes

  • Fixed wrong package requirement that caused the installation of ChaosMagPy v0.1a1 to fail with pip. If installation of v0.1a1 is needed, use pip install --no-deps chaosmagpy==0.1a1 to ignore faulty requirements.

Version 0.1a1

Date: January 5, 2019
Release: v0.1a1

Features

  • Package now supports Matplotlib v3 and Cartopy v0.17.

  • Loading shc-file now converts decimal year to mjd2000 taking leap years into account by default.

  • Moved mjd2000 from coordinate_utils to data_utils.

  • Added function to compute degree correlation.

  • Added functions to compute and plot the power spectrum.

  • Added flexibility to the function synth_values: now supports NumPy broadcasting rules.

  • Fixed CHAOS class method synth_coeffs_sm default source parameter: now defaults to 'external'.

Deprecations

  • Optional argument source when saving shc-file has been renamed to model.

  • plot_external_map has been renamed to plot_maps_external

  • synth_sm_field has been renamed to synth_coeffs_sm

  • synth_gsm_field has been renamed to synth_coeffs_gsm

  • plot_static_map has been renamed to plot_maps_static

  • synth_static_field has been renamed to synth_coeffs_static

  • plot_tdep_maps has been renamed to plot_maps_tdep

  • synth_tdep_field has been renamed to synth_coeffs_tdep

Version 0.1a0

Date: October 13, 2018
Release: v0.1a0

Initial release to the users for testing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chaosmagpy-0.2.tar.gz (2.3 MB view hashes)

Uploaded Source

Built Distribution

chaosmagpy-0.2-py3-none-any.whl (2.3 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page