All Projects → brmather → Pycurious

brmather / Pycurious

Licence: lgpl-3.0
Python package for computing the Curie depth from the magnetic anomaly

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pycurious

A Nice Mc
Code for "A-NICE-MC: Adversarial Training for MCMC"
Stars: ✭ 115 (+422.73%)
Mutual labels:  jupyter-notebook, bayesian-inference
Rethinking Tensorflow Probability
Statistical Rethinking (2nd Ed) with Tensorflow Probability
Stars: ✭ 152 (+590.91%)
Mutual labels:  jupyter-notebook, bayesian-inference
Rethinking Pyro
Statistical Rethinking with PyTorch and Pyro
Stars: ✭ 116 (+427.27%)
Mutual labels:  jupyter-notebook, bayesian-inference
Bayesian Cognitive Modeling In Pymc3
PyMC3 codes of Lee and Wagenmakers' Bayesian Cognitive Modeling - A Pratical Course
Stars: ✭ 93 (+322.73%)
Mutual labels:  jupyter-notebook, bayesian-inference
Bayesian Stats Modelling Tutorial
How to do Bayesian statistical modelling using numpy and PyMC3
Stars: ✭ 480 (+2081.82%)
Mutual labels:  jupyter-notebook, bayesian-inference
Neural Tangents
Fast and Easy Infinite Neural Networks in Python
Stars: ✭ 1,357 (+6068.18%)
Mutual labels:  jupyter-notebook, bayesian-inference
Celeste.jl
Scalable inference for a generative model of astronomical images
Stars: ✭ 142 (+545.45%)
Mutual labels:  jupyter-notebook, bayesian-inference
Hmm for autonomous driving
🎓 Educational application of Hidden Markov Model to Autonomous Driving 🚕🚙🚗
Stars: ✭ 39 (+77.27%)
Mutual labels:  jupyter-notebook, bayesian-inference
Bayesian Analysis Recipes
A collection of Bayesian data analysis recipes using PyMC3
Stars: ✭ 479 (+2077.27%)
Mutual labels:  jupyter-notebook, bayesian-inference
Vae cf
Variational autoencoders for collaborative filtering
Stars: ✭ 386 (+1654.55%)
Mutual labels:  jupyter-notebook, bayesian-inference
Pymc Example Project
Example PyMC3 project for performing Bayesian data analysis using a probabilistic programming approach to machine learning.
Stars: ✭ 90 (+309.09%)
Mutual labels:  jupyter-notebook, bayesian-inference
Bda py demos
Bayesian Data Analysis demos for Python
Stars: ✭ 781 (+3450%)
Mutual labels:  jupyter-notebook, bayesian-inference
Alice
NIPS 2017: ALICE: Towards Understanding Adversarial Learning for Joint Distribution Matching
Stars: ✭ 80 (+263.64%)
Mutual labels:  jupyter-notebook, bayesian-inference
Pymc3 vs pystan
Personal project to compare hierarchical linear regression in PyMC3 and PyStan, as presented at http://pydata.org/london2016/schedule/presentation/30/ video: https://www.youtube.com/watch?v=Jb9eklfbDyg
Stars: ✭ 110 (+400%)
Mutual labels:  jupyter-notebook, bayesian-inference
Bnlearn
Python package for learning the graphical structure of Bayesian networks, parameter learning, inference and sampling methods.
Stars: ✭ 51 (+131.82%)
Mutual labels:  jupyter-notebook, bayesian-inference
Glmm In Python
Generalized linear mixed-effect model in Python
Stars: ✭ 131 (+495.45%)
Mutual labels:  jupyter-notebook, bayesian-inference
Resources
PyMC3 educational resources
Stars: ✭ 930 (+4127.27%)
Mutual labels:  jupyter-notebook, bayesian-inference
Sbi
Simulation-based inference in PyTorch
Stars: ✭ 164 (+645.45%)
Mutual labels:  jupyter-notebook, bayesian-inference
Dbda Python
Doing Bayesian Data Analysis, 2nd Edition (Kruschke, 2015): Python/PyMC3 code
Stars: ✭ 502 (+2181.82%)
Mutual labels:  jupyter-notebook, bayesian-inference
Bayesian Neural Networks
Pytorch implementations of Bayes By Backprop, MC Dropout, SGLD, the Local Reparametrization Trick, KF-Laplace, SG-HMC and more
Stars: ✭ 900 (+3990.91%)
Mutual labels:  jupyter-notebook, bayesian-inference

PyCurious

Docker Cloud Automated build PyPI DOI Build Status

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

badge

Citation

DOI

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:

import pycurious
pycurious.install_documentation(path="Notebooks")

Tanaka

Bouligand

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:

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:

conda install numpy scipy cython

And the full set of dependencies with:

conda install numpy scipy cython matplotlib pyproj cartopy

Then pycurious can be installed with pip:

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:

git clone https://github.com/brmather/pycurious
cd pycurious

Create the environment from the environment.yml file:

conda env create -f environment.yml

Activate the newly created environment:

conda activate pycurious

And install pycurious with pip:

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:

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:

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:

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, sigma_Phi = grid.radial_spectrum(subgrid)

A series of tests are located in the tests subdirectory. In order to perform these tests, clone the repository and run pytest:

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

  1. 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
  2. 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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].