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 Distribution

pymaginverse-1.1.3.tar.gz (25.2 kB view details)

Uploaded Source

Built Distributions

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

pymaginverse-1.1.3-cp311-cp311-win_amd64.whl (27.5 kB view details)

Uploaded CPython 3.11Windows x86-64

pymaginverse-1.1.3-cp311-cp311-manylinux_2_35_x86_64.whl (490.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

pymaginverse-1.1.3-cp311-cp311-macosx_13_0_x86_64.whl (172.5 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

pymaginverse-1.1.3-cp310-cp310-win_amd64.whl (27.5 kB view details)

Uploaded CPython 3.10Windows x86-64

pymaginverse-1.1.3-cp310-cp310-manylinux_2_35_x86_64.whl (455.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

pymaginverse-1.1.3-cp310-cp310-macosx_13_0_x86_64.whl (102.3 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

pymaginverse-1.1.3-cp39-cp39-win_amd64.whl (27.5 kB view details)

Uploaded CPython 3.9Windows x86-64

pymaginverse-1.1.3-cp39-cp39-manylinux_2_35_x86_64.whl (458.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.35+ x86-64

pymaginverse-1.1.3-cp39-cp39-macosx_13_0_x86_64.whl (102.9 kB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

File details

Details for the file pymaginverse-1.1.3.tar.gz.

File metadata

  • Download URL: pymaginverse-1.1.3.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pymaginverse-1.1.3.tar.gz
Algorithm Hash digest
SHA256 d43bdca32922f08fba189ba92640e348c95c4f31d100a8a130d9a3976a81899f
MD5 ba031ea597af17d670c679072a90dd57
BLAKE2b-256 68a4457394fa64b16fdeab04b4fd8f1bc9fca624039d3148a48b47cf7321e677

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3.tar.gz:

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.1.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 672ade4414d4cc3372091834fcd576ca51a1f24cc7ebe8f2fa994cb98fb3d6ba
MD5 d4e1a05f7b62509be3c029f42b760686
BLAKE2b-256 3fc93a44f6582a18a8a66c7a80ffd94c47e28b85a668e0a91e7266d615a0db83

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3-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.1.3-cp311-cp311-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.1.3-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 0e30489c7b830dea2e2ef108beb15fc320c9df2fdb7326a2172c4e81dfd4c00e
MD5 a9a50fed070bbcc2ed7f1387af1fa2d1
BLAKE2b-256 6c950ad06b8e49c7b4361d2927c007d5553fc7870075dcfec118113d91faebe1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3-cp311-cp311-manylinux_2_35_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.1.3-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.1.3-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 457952223069dfb96a52352bf9d823e15dc10a05d9e5a7df452818e53ce7fd7b
MD5 e6f29eb4f88ac845d1e338d44a812d64
BLAKE2b-256 5e36896ef4f0ab7ee32afe3cfb138bfafe31efdc757231f13742122b4d2a7245

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3-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.1.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8df14def490b89798e8bca9143fa98640990fd197fe196268155f92bf5f039e7
MD5 73ac78112ae4603fcfcc84412b5963eb
BLAKE2b-256 4a52813bd661407f6b955b2489b308ddf09f852c74545f7e9f87c06199af1353

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3-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.1.3-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.1.3-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 bf3574f69a896f1707b85b7bf730233ecaaef881a0c35d5db85c75cddeb6b77e
MD5 674c1fdd82301e7344c5790bef437d32
BLAKE2b-256 9f74fdb1e73b3f2eb9beb2035ae02dce937f82ec600aa5c3ac4b623726bd476d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3-cp310-cp310-manylinux_2_35_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.1.3-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.1.3-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 afe2fcf2168d16245079c9bf93a5818319398f2424915b11a5f103700a054f40
MD5 047ffa064f0b54dc6b2c983273178688
BLAKE2b-256 2e4e2580c000a447e2eb92dec1f908172ecf893816cf11908b36e6c5381b0c33

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3-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.1.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pymaginverse-1.1.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pymaginverse-1.1.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 503ef1f6e31170bde03e85b998dddbed89c5c5ea72f8c68249e521f1bb1a8153
MD5 d448449d8be9208651f70104e4693505
BLAKE2b-256 2cacfdd596cc7ce32108561c39c7b4a9e8b7a8362f330a73a4085e97fd8768ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3-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.1.3-cp39-cp39-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.1.3-cp39-cp39-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 81831fb99f3aa8e00258a974d5ef801aab009c62024f8e3a5b8b369703133536
MD5 6589bd44fd239578b841e75e83e7aa32
BLAKE2b-256 ad3e81b561f362593eba8d5b95c52f29c4ba619a18a88a29187717df0a2ee20e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3-cp39-cp39-manylinux_2_35_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.1.3-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pymaginverse-1.1.3-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 57b6c968fc4cc8e79c9bf21b9cd652c6258c3870edb6dab42303b581b9cb558c
MD5 1e4bd39833771c5974a7a3bfe532e200
BLAKE2b-256 fb8681221b7a46d7c15c2a0ce701b0c8ece54a332b0679f8bffdc28db6027173

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymaginverse-1.1.3-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