PyCurious
PyCurious: A Python module for computing the Curie depth from the magnetic anomaly. - Published in JOSS (2019)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 10 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org, zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Keywords from Contributors
Scientific Fields
Repository
Python package for computing the Curie depth from the magnetic anomaly
Basic Info
- Host: GitHub
- Owner: brmather
- License: lgpl-3.0
- Language: Jupyter Notebook
- Default Branch: master
- Homepage: https://brmather.github.io/pycurious/
- Size: 11.6 MB
Statistics
- Stars: 42
- Watchers: 5
- Forks: 19
- Open Issues: 3
- Releases: 7
Topics
Metadata Files
README.md

Magnetic data is one of the most common geophysics datasets available on the surface of the Earth. Curie depth is the depth at which rocks lose their magnetism. The most prevalent magnetic mineral is magnetite, which has a Curie point of 580°C, thus the Curie depth is often interpreted as the 580°C isotherm.
Current methods to derive Curie depth first compute the (fast) Fourier transform over a square window of a magnetic anomaly that has been reduced to the pole. The depth and thickness of magnetic sources is estimated from the slope of the radial power spectrum. pycurious implements the Tanaka et al. (1999) and Bouligand et al. (2009) methods for computing the thickness of a buried magnetic source. pycurious ingests maps of the magnetic anomaly and distributes the computation of Curie depth across multiple CPUs. Common computational workflows and geospatial manipulation of magnetic data are covered in the Jupyter notebooks bundled with this package.
Binder
Launch the demonstration at mybinder.org
Citation
Mather, B. and Delhaye, R. (2019). PyCurious: A Python module for computing the Curie depth from the magnetic anomaly. Journal of Open Source Software, 4(39), 1544, https://doi.org/10.21105/joss.01544
Navigation / Notebooks
There are two matching sets of Jupyter notebooks - one set for the Tanaka and one for Bouligand implementations. The Bouligand set of noteboks are a natural choice for Bayesian inference applications.
Note, these examples can be installed from the package itself by running:
python
import pycurious
pycurious.install_documentation(path="Notebooks")
Tanaka
Bouligand
- Ex1-Plot-power-spectrum.ipynb
- Ex2-Compute-Curie-depth.ipynb
- Ex3-Posing-the-inverse-problem.ipynb
- Ex4-Spatial-variation-of-Curie-depth.ipynb
- Ex5-Mapping-Curie-depth-EMAG2.ipynb
Installation
Dependencies
You will need Python 2.7 or 3.5+. Also, the following packages are required:
Optional dependencies for mapping module and running the Notebooks:
Installing using pip
You can install pycurious using the
pip package manager with either version of Python:
bash
python2 -m pip install pycurious
python3 -m pip install pycurious
All the dependencies will be automatically installed by pip.
Installing with conda
You can install pycurious using the conda package manager.
Its required dependencies can be easily installed with:
bash
conda install numpy scipy cython
And the full set of dependencies with:
bash
conda install numpy scipy cython matplotlib pyproj cartopy
Then pycurious can be installed with pip:
bash
pip install pycurious
Conda environment
Alternatively, you can create a custom
conda environment
where pycurious can be installed along with its dependencies.
Clone the repository:
bash
git clone https://github.com/brmather/pycurious
cd pycurious
Create the environment from the environment.yml file:
bash
conda env create -f environment.yml
Activate the newly created environment:
bash
conda activate pycurious
And install pycurious with pip:
bash
pip install pycurious
Issue with gcc
If the pycurious installation fails due to an issue with gcc and
Anaconda, you just
need to install gxx_linux-64 with conda:
bash
conda install gxx_linux-64
And then install pycurious normally.
Installing using Docker
A more straightforward installation for pycurious and all of its dependencies may be deployed with Docker.
To install the docker image and start the Jupyter notebook examples:
bash
docker run --name pycurious -p 127.0.0.1:8888:8888 brmather/pycurious:latest
Usage
PyCurious consists of 2 classes:
CurieGrid: base class that computes radial power spectrum, centroids for processing, decomposition of subgrids.CurieOptimise: optimisation module for fitting the synthetic power spectrum (inherits CurieGrid).
Also included is a mapping module for gridding scattered data points, and converting between coordinate reference systems (CRS).
Below is a simple workflow to calculate the radial power spectrum:
```python import pycurious
initialise CurieOptimise object with 2D magnetic anomaly
grid = pycurious.CurieOptimise(mag_anomaly, xmin, xmax, ymin, ymax)
extract a square window of the magnetic anomaly
subgrid = grid.subgrid(window_size, x, y)
compute the radial power spectrum
k, Phi, sigmaPhi = grid.radialspectrum(subgrid) ```
A series of tests are located in the tests subdirectory.
In order to perform these tests, clone the repository and run pytest:
bash
git checkout https://github.com/brmather/pycurious.git
cd pycurious
pytest -v
API Documentation
The API for all functions and classes in pycurious can be accessed from https://brmather.github.io/pycurious/.
References
- Bouligand, C., Glen, J. M. G., & Blakely, R. J. (2009). Mapping Curie temperature depth in the western United States with a fractal model for crustal magnetization. Journal of Geophysical Research, 114(B11104), 1–25. https://doi.org/10.1029/2009JB006494
- Tanaka, A., Okubo, Y., & Matsubayashi, O. (1999). Curie point depth based on spectrum analysis of the magnetic anomaly data in East and Southeast Asia. Tectonophysics, 306(3–4), 461–470. https://doi.org/10.1016/S0040-1951(99)00072-4
Owner
- Name: Ben Mather
- Login: brmather
- Kind: user
- Location: Sydney, Australia
- Company: University of Sydney
- Website: https://www.benmather.info
- Twitter: BenRMather
- Repositories: 4
- Profile: https://github.com/brmather
Computational Geophysicist
JOSS Publication
PyCurious: A Python module for computing the Curie depth from the magnetic anomaly.
Authors
Tags
Curie depth magnetism magnetic anomaly Bayesian inferenceGitHub Events
Total
- Issues event: 1
- Watch event: 3
- Issue comment event: 1
- Fork event: 1
Last Year
- Issues event: 1
- Watch event: 3
- Issue comment event: 1
- Fork event: 1
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Ben Mather | b****1@g****m | 109 |
| Ben Mather | b****r@c****e | 20 |
| Santiago Soler | s****r@g****m | 9 |
| rdelhaye | 3****e | 7 |
| Robert Delhaye | r****e@p****e | 7 |
| Lindsey Heagy | l****y@g****m | 1 |
| Kyle Niemeyer | k****r@g****m | 1 |
| Jesse Pisel | j****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 21
- Total pull requests: 19
- Average time to close issues: 4 days
- Average time to close pull requests: about 17 hours
- Total issue authors: 7
- Total pull request authors: 6
- Average comments per issue: 1.95
- Average comments per pull request: 0.63
- Merged pull requests: 18
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- santisoler (14)
- Geousman (2)
- zhongpenggeo (1)
- rmmilewi (1)
- manees12 (1)
- mdtanker (1)
- brandiscarlier (1)
Pull Request Authors
- brmather (11)
- santisoler (4)
- jonnyford (1)
- kyleniemeyer (1)
- lheagy (1)
- jessepisel (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 14 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 13
- Total maintainers: 1
pypi.org: pycurious
Python tool for computing the Curie depth from magnetic data
- Homepage: https://github.com/brmather/pycurious
- Documentation: https://pycurious.readthedocs.io/
- License: lgpl-3.0
-
Latest release: 1.1.1
published almost 6 years ago
Rankings
Maintainers (1)
Dependencies
- cartopy
- cython
- jupyter
- matplotlib
- numpy
- pip
- pyproj
- pytest
- python 3.7.*
- scipy
- numpy *
