{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# PyCurious\n", "\n", "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 580C, thus the Curie depth is often interpreted as the 580C isotherm.\n", "\n", "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, which are covered within Jupyter notebooks.\n", "\n", "#### Binder\n", "\n", "Launch the demonstration at [mybinder.org](https://mybinder.org/v2/gh/brmather/pycurious/binder?filepath=Notebooks%2F0-StartHere.ipynb)\n", "\n", "## Navigation / Notebooks\n", "\n", "There are two matching sets of `pycurious` notebooks - one set for the [Tanaka](#Tanaka) and one for [Bouligand](#Bouligand) implementations. The Bouligand set of noteboks are a natural choice for Bayesian inference applications.\n", "\n", "### Tanaka\n", "\n", "- [Ex1-Plot-power-spectrum.ipynb](./Notebooks/Tanaka/Ex1-Plot-power-spectrum.ipynb)\n", "- [Ex2-Compute-Curie-depth.ipynb](./Notebooks/Tanaka/Ex2-Compute-Curie-depth.ipynb)\n", "- [Ex3-Parameter-exploration.ipynb](./Notebooks/Tanaka/Ex3-Parameter-exploration.ipynb)\n", "\n", "### Bouligand\n", "\n", "- [Ex1-Plot-power-spectrum.ipynb](./Notebooks/Bouligand/Ex1-Plot-power-spectrum.ipynb)\n", "- [Ex2-Compute-Curie-depth.ipynb](./Notebooks/Bouligand/Ex2-Compute-Curie-depth.ipynb)\n", "- [Ex3-Posing-the-inverse-problem.ipynb](./Notebooks/Bouligand/Ex3-Posing-the-inverse-problem.ipynb)\n", "- [Ex4-Spatial-variation-of-Curie-depth.ipynb](./Notebooks/Bouligand/Ex4-Spatial-variation-of-Curie-depth.ipynb)\n", "- [Ex5-Mapping-Curie-depth-EMAG2.ipynb](./Notebooks/Bouligand/Ex5-Mapping-Curie-depth-EMAG2.ipynb)\n", "\n", "### Examples\n", "\n", "Note, these examples can be installed from the package itself by running:\n", "\n", "```python\n", "import pycurious\n", "pycurious.install_documentation(path=\"Notebooks\")\n", "```\n", "\n", "## Usage\n", "\n", "PyCurious consists of 2 classes:\n", "\n", "- `CurieGrid`: base class that computes radial power spectrum, centroids for processing, decomposition of subgrids.\n", "- `CurieOptimise`: optimisation module for fitting the synthetic power spectrum (inherits CurieGrid).\n", "\n", "Also included is a `mapping` module for gridding scattered data points, and converting between coordinate reference systems (CRS).\n", "\n", "Below is a simple workflow to calculate the radial power spectrum:\n", "\n", "```python\n", "import pycurious\n", "\n", "# initialise CurieOptimise object with 2D magnetic anomaly\n", "grid = pycurious.CurieOptimise(mag_anomaly, xmin, xmax, ymin, ymax)\n", "\n", "# extract a square window of the magnetic anomaly\n", "subgrid = grid.subgrid(window_size, x, y)\n", "\n", "# compute the radial power spectrum\n", "k, Phi, sigma_Phi = grid.radial_spectrum(subgrid)\n", "```\n", "\n", "## Installation\n", "\n", "To install with **setuptools**:\n", "\n", "```bash\n", "python setup.py install --user\n", "```\n", "\n", "This will compile all C source code and install them to the user directory (omit the `--user` flag to install to the system directory). Remember to delete the build folder if you are upgrading this package.\n", "\n", "Alternatively, install using **pip**:\n", "\n", "```bash\n", "pip install pycurious --user\n", "```\n", "\n", "### Dependencies\n", "\n", "- Python 2.7+ and 3.6+\n", "- Numpy 1.9+\n", "- Scipy 0.14+\n", "- Cython\n", "\n", "Optional dependencies for mapping module:\n", "\n", "- Matplotlib\n", "- [pyproj](https://github.com/jswhit/pyproj)\n", "- [Cartopy](http://scitools.org.uk/cartopy/docs/latest/index.html)\n", "\n", "### Docker\n", "\n", "A more straightforward installation for `pycurious` and all of its dependencies may be deployed with [Docker](https://www.docker.com). To install the docker image and test it is working:\n", "\n", "```bash\n", "docker pull brmather/pycurious:latest\n", "docker run --rm brmather/pycurious:latest help\n", "```\n", "\n", "## References\n", "\n", "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\n", "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\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.8" } }, "nbformat": 4, "nbformat_minor": 2 }