Skip to main content

Python Library performing Geomagnetic Field inversions for (paleo)magnetic data

Project description

DOI PyPI

pymaginverse

Library for the numerical inversion of geomagnetic field data. This library is brough to you by Frenk Out, Maximilian Schanner, Liz van Grinsven, Monika Korte, and Lennart de Groot. This code is based on Fortran code used for the following two papers:

Library

The library consists of two main modules:

  • pymaginverse/data_prep.py: contains methods for correctly preparing data for the FieldInversion-class. This method stores all required parameters per station into one class, which can then be imported directly into FieldInversion. The class takes a csv-file of declination, inclination, intensity, x, y, z, and/or h-component magnetic data + accompanying data errors.
  • pymaginverse/field_inversion.py: contains the FieldInversion-class that performs the actual inversion of geomagnetic field data. It requires, besides the time vector over which the inversion will take place, an instance of InputData as minimum input.

Installation

option a: pip

The easiest way to get a working environment set up is using the conda dependency manager, e.g. from here. Replacing with a name of your choice, you can create a conda environment with all dependencies provided using:

conda create --name <env-name> "python==3.11"

Then, activate your environment

conda activate <env-name>

Subsequently, either enter the root directory of the repository (which you should have downloaded with either git clone or the download button above), to install the package:

pip install . -U

or pip install directly from the pypi repository:

pip install pymaginverse

Option b: poetry

In order to get the inversion code running with poetry, you need to have poetry properly installed. See the website of poetry, or run:

curl -sSL https://install.python-poetry.org | python3 -

The easiest way to get a working environment set up is using the conda dependency manager, e.g. from here. Replacing with a name of your choice, you can create a conda environment with all dependencies provided using:

conda create --name <env-name> "python==3.11"

Then, activate your environment

conda activate <env-name>

Enter the root directory of the repository (which you should have downloaded with either git clone or the download button above), to install the package.

poetry install

Uninstallation

Uninstallation is possible by typing in the terminal (possibly in the specific virtual environment):

pip uninstall pymaginverse

Tutorial

We have provided four tutorials to make the library easier to use and understand. You can find the jupyter notebooks containing the tutorials in the doc-folder. The tutorials are:

  1. Tutorial 1: loading data and running a model. In this Tutorial we show how to load data into the InputData-class, and teach you the basics of the FieldInversion-class (including several damping types).
  2. Tutorial 2: plotting results. We show some basic plotting tools allowing a better understanding of the created geomagnetic model. Examples consist of residual plots, gauss coefficients, powerspectra, and global magnetic field maps.
  3. Tutorial 3: sweeping through models. We show how to loop through models with different damping parameters to find a optimal model with the help of the elbow-plot and powerspectra.
  4. Tutorial 4: loading geomagia dataset. We show how to load a geomagia dataset with our InputData-class.

All files required for the tutorials are also found in the doc-folder.

Testing

All tests for this library can be found in the test-folder. To run the tests you need to have pytest installed. After installation of pytest, you can test the code by typing pytest.

Accompanying Article

The Article describing this library can be found here:

Acknowledgements

This Python code is based on a version of Fortran codes that have been spread within the geomagnetic community by personal communication and in its original version were mainly written by David Gubbins, Kathryn Whaler, Jeremy Bloxham, and Andrew Jackson. The authors want to express their gratitude to Sanja Panovska for the fruitful discussions on the algorithm and its spatial and temporal damping options.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pymaginverse-1.2.0-cp312-cp312-win_amd64.whl (96.9 kB view details)

Uploaded CPython 3.12Windows x86-64

pymaginverse-1.2.0-cp312-cp312-manylinux_2_39_x86_64.whl (493.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

pymaginverse-1.2.0-cp312-cp312-macosx_14_0_arm64.whl (175.2 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

pymaginverse-1.2.0-cp312-cp312-macosx_13_0_x86_64.whl (175.4 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

pymaginverse-1.2.0-cp311-cp311-win_amd64.whl (96.2 kB view details)

Uploaded CPython 3.11Windows x86-64

pymaginverse-1.2.0-cp311-cp311-manylinux_2_39_x86_64.whl (504.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

pymaginverse-1.2.0-cp311-cp311-macosx_14_0_arm64.whl (172.4 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

pymaginverse-1.2.0-cp311-cp311-macosx_13_0_x86_64.whl (172.6 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

pymaginverse-1.2.0-cp310-cp310-win_amd64.whl (96.2 kB view details)

Uploaded CPython 3.10Windows x86-64

pymaginverse-1.2.0-cp310-cp310-manylinux_2_39_x86_64.whl (466.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

pymaginverse-1.2.0-cp310-cp310-macosx_14_0_arm64.whl (172.5 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

pymaginverse-1.2.0-cp310-cp310-macosx_13_0_x86_64.whl (102.4 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

pymaginverse-1.2.0-cp39-cp39-win_amd64.whl (96.7 kB view details)

Uploaded CPython 3.9Windows x86-64

pymaginverse-1.2.0-cp39-cp39-manylinux_2_39_x86_64.whl (469.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.39+ x86-64

pymaginverse-1.2.0-cp39-cp39-macosx_14_0_arm64.whl (173.8 kB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

pymaginverse-1.2.0-cp39-cp39-macosx_13_0_x86_64.whl (103.0 kB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

File details

Details for the file pymaginverse-1.2.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b485fa6c92f0faeda33ffd9b453df2ddd689798f1800325392e19ed0a5198e62
MD5 20bea99168f08968b2ac8d606e097751
BLAKE2b-256 03a1b1f86b8073eed5eada73489e93541a87046c928ddce584c7082e52c93ac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp312-cp312-win_amd64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 098f50cd606420c611aced36c8cf9bb7592ff5e371bce66be7ebe037b33c6d44
MD5 bfd06701f47dc847a63d0be963982026
BLAKE2b-256 5fd7b36349a2207b98f099427f853df93c5a09d8e24cd1ad134c50108e38b0b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp312-cp312-manylinux_2_39_x86_64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6b663f03a6bdff196af4901334a358d47ac87be6d0332d823668380acee4b11a
MD5 25f057e37971ab64a23f4070c781dfcd
BLAKE2b-256 c554d3e10b65e7b944befd62e7b663f47794558d620ac4ed4b386f86ff90b9c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 dbd48b5e830936601407dfc3dc6e135c69fbb7ead14795f110c216b7260fe54a
MD5 600c8f9b7acd3f312e77ff44a9bb7e72
BLAKE2b-256 9becc9e94466b81910d49f149e3809f06a704b85c0f5702b0fd769d54064a192

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp312-cp312-macosx_13_0_x86_64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 15f597bfff52af129b086fa533efd298c33a4010858f12f30039584c61aed929
MD5 97cf2ec2916f5d95e6a209194d6f605b
BLAKE2b-256 d6e18c43c14a0f0f2a4a862515da9dcd0e6747d8532c98c9cd2e136d7ed72d18

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp311-cp311-win_amd64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 11819f7029c6963a88a4cf41c6d24332a1a1cb0f4df03415ba9fff0e81f768ac
MD5 ea805651e72e2e8f92e1f5cecb7dd2fc
BLAKE2b-256 0e6a037f756441e8fd0366e0ace586cc5757f9483bb5989ac72760d09e85264b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp311-cp311-manylinux_2_39_x86_64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 01282c43f04f66a89ee690a46f02be09f67c82ee71b87c8a383dc8f5ea68fe8e
MD5 1c61a05c937ff03b53de0c789ae747bc
BLAKE2b-256 56fd37d523cc5cf8061e205f1177b988ea0e4098d813f51821dd43f5c0829450

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 35d34190fa7e4644121dfa0739f76cb30adf026e18102e694670b10b81136243
MD5 e4452230236869a0812a500f41223f11
BLAKE2b-256 381e23612153bf9509849af6d63a5bf04a7dc6b81a7b80c835472c1117a8d1bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp311-cp311-macosx_13_0_x86_64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8122fcbae09f6ad1b12c78a401bed53d54b96a84c938ee4d0fedc1dec8cff34a
MD5 a21e7a6291bb2e189edeab1a9934c39e
BLAKE2b-256 a9c9c281bf7093d0e024aa7d3f016e82cba8d5c81f006ea9f371c234e576b141

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp310-cp310-win_amd64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ee83777318667229d7f4491b32c8cb6fb41d21d3b17d1ac575eaad9e0c6be1a8
MD5 54212577655105da6e9d553c24ca2f8c
BLAKE2b-256 bb05f6c83d6f1b9d1ebc1bc42d37927c7cefd43b5d31e749f8b5835f0161a258

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp310-cp310-manylinux_2_39_x86_64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 19e9763a9e7490810a4ad111bbfb92f1960f7ad0f88ed661aa1658b6565af71b
MD5 b104ddf94dd135231e772f458c808b4a
BLAKE2b-256 5d4d7ea172e459d5e2febc8d179cb7d2e6f8d96aa890b033e1df518acd2b5826

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 e40f169283012077d4035319e19dc0674fa5ea1ec15ff58ec0f7c46691a100f5
MD5 9f9ad8f30fffc8bb2f1161b30b3c69d7
BLAKE2b-256 4919507dbc2f981cb95a64825f2a1edcad21dfb2694050e184ec922a9a62b7ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp310-cp310-macosx_13_0_x86_64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pymaginverse-1.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 96.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pymaginverse-1.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9d66e580d5419a4a7fdbfa5dc45967f09b3db4daa2cfc31bc5811a1a47b5d6d2
MD5 28b4d7497c0cdeb627dbca69f16131eb
BLAKE2b-256 b27d7304120f382986108718bb783ad76936bfb9501cae6f7951da68d2934ece

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp39-cp39-win_amd64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp39-cp39-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp39-cp39-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e3d9031abe84163baf269208253e7460e4bef5fa2ce450d1daf64bae8ec4076d
MD5 df6521fb5bdfa897fd752462a12b3e58
BLAKE2b-256 b774295312bb9ca84cbb5632492534acf19f032dee12fc114483278140f071be

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp39-cp39-manylinux_2_39_x86_64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b28e1716cfd63de58c1c33d029f667ea8491eed1d4e0c6b4c14064df4ef07538
MD5 7e62c1b4b8a6ad6800cff1a3fec0a51e
BLAKE2b-256 534d76c9328b1e75ce26b55f399cb1e3becc21b4715168d6179f05ef2e3dd32d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp39-cp39-macosx_14_0_arm64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymaginverse-1.2.0-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.2.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ad84bf8f8b3469015c1e6e31777ec7cb68632952d4e2a1152bc688fc2f18662c
MD5 64d8df6223496c416b5cbaf38f9aeebc
BLAKE2b-256 64ea0514f620750663820eeac77ffabb3bb6ab42e0c750c913048994e61ca57a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.2.0-cp39-cp39-macosx_13_0_x86_64.whl:

Publisher: build_and_publish_pypi.yml on outfrenk/pymaginverse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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