Skip to content

Commit 3301c11

Browse files
committed
refactored documentation
1 parent e863122 commit 3301c11

File tree

11 files changed

+220
-50
lines changed

11 files changed

+220
-50
lines changed

docs/api.rst

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/classes.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11

2+
Grid Classes
3+
++++++++++++
4+
5+
:mod:`~plateflex` defines the following ``Grid`` classes:
6+
7+
- :class:`~plateflex.classes.Grid`
8+
- :class:`~plateflex.classes.TopoGrid`
9+
- :class:`~plateflex.classes.GravGrid`
10+
- :class:`~plateflex.classes.BougGrid`
11+
- :class:`~plateflex.classes.FairGrid`
12+
- :class:`~plateflex.classes.RhocGrid`
13+
- :class:`~plateflex.classes.ZcGrid`
14+
15+
These classes can be initialized with a grid of the corresponding data
16+
type, and contain methods for the following functionality:
17+
18+
- Extracting contours at some level of the grid
19+
- Performing a wavelet transform using a Morlet wavelet
20+
- Obtaining the wavelet scalogram from the wavelet transform
21+
- Plotting the input grids, wavelet transform components, and scalograms
22+
223
Grid
324
----
425

@@ -41,6 +62,25 @@ ZcGrid
4162
.. autoclass:: plateflex.classes.ZcGrid
4263
:members:
4364

65+
Project Class
66+
+++++++++++++
67+
68+
This module further contains the class :class:`~plateflex.classes.Project`,
69+
which itself is a container of :class:`~plateflex.classes.Grid` objects
70+
(at least one each of :class:`~plateflex.classes.TopoGrid` and
71+
:class:`~plateflex.classes.GravGrid`). Methods are available to:
72+
73+
- Add :class:`~plateflex.classes.Grid` or :class:`~plateflex.classes.Project` objects to the project
74+
- Iterate over :class:`~plateflex.classes.Grid` objects
75+
- Initialize the project
76+
- Perform the wavelet admittance and coherence between topography (:class:`~plateflex.classes.TopoGrid` object) and gravity anomalies (:class:`~plateflex.classes.GravGrid` object)
77+
- Plot the wavelet admnittance and coherence spectra
78+
- Estimate model parameters at single grid cell
79+
- Estimate model parameters at every (or decimated) grid cell
80+
- Plot the statistics of the estimated parameters at single grid cell
81+
- Plot the observed and predicted admittance and coherence functions at single grid cell
82+
- Plot the final grids of model parameters
83+
4484
Project
4585
--------
4686

docs/conf.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Configuration module
2+
++++++++++++++++++++
13

24
.. automodule:: plateflex.conf
35
:members:

docs/estimate.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Module estimate
2-
---------------
1+
Estimate functions
2+
++++++++++++++++++
33

44
.. automodule:: plateflex.estimate
55
:members:

docs/getting_started.rst

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
2+
.. figure:: ../plateflex/examples/picture/plateflex_logo.png
3+
:align: center
4+
5+
.. automodule:: plateflex
6+
:members:
7+
8+
Global Variables
9+
----------------
10+
11+
Making gridded data
12+
-------------------
13+
14+
Packaged with this software is a set of topography, gravity and crustal structure data that
15+
are easily imported into the ``PlateFlex`` package. Those data sets have been produced by
16+
processing global grids of data from the
17+
`WGM2012 <http://bgi.omp.obs-mip.fr/data-products/Grids-and-models/wgm2012>`_,
18+
`GEBCO <https://www.gebco.net/data_and_products/gridded_bathymetry_data/>`_ and
19+
`CRUST1.0 <https://igppweb.ucsd.edu/~gabi/crust1.html>`_ models using
20+
`GMT <https://www.generic-mapping-tools.org>`_.
21+
22+
The WGM2012 models are used to extract Topography, Bouguer and Free-air anomaly data
23+
over North America, and Free-air anomaly data over the NW Pacific.
24+
The GEBCO model is used for the Bathymetry over the NW Pacific.
25+
The CRUST1.0 models are used to extract the crustal thickness and crustal
26+
density (corresponding to upper crust, or layer #6) over both North America and the NW Pacific.
27+
Since those models are all defined using a different registration and grid sampling,
28+
we use GMT to manipulate the grids and produce consistent data sets to use with
29+
``PlateFlex``. We used GMT 5.4.1 in the following examples. These commands should be
30+
copied to a bash script file and executed from the terminal.
31+
32+
WGM2012
33+
*******
34+
35+
These models are defined at a resolution of 2' with a gridline registration.
36+
37+
.. sourcecode:: bash
38+
39+
# Set region and projection for North America. Use a transverse mercator
40+
# with a central meridian of -95 degrees to minimize high-latitude distortions.
41+
reg=-R-125/13/-28/58+r
42+
proj=-JT-95/3i
43+
44+
# Make map of region
45+
ps=Bouguer_NA.ps
46+
gmt grdimage WGM2012_Bouguer_ponc_2min.grd $reg $proj -K -P \
47+
-B10WSne -CPALET_WGM_Bouguer_Global.cpt -X1.5i -Y1.25i > $ps
48+
gmt psscale -CPALET_WGM_Bouguer_Global.cpt -DJRM+o0.25i/0+e+mc -R -J -O >> $ps
49+
50+
# Project onto Cartesian grid with sampling interval of 20 km
51+
gmt grdproject WGM2012_Bouguer_ponc_2min.grd -GBouguer_NA.grd $proj $reg -D20 -Fk
52+
53+
# Save grid information as header for use with PlateFlex software
54+
gmt grdinfo -C Bouguer_NA.grd > header.txt
55+
sed 's/^/# /g' header.txt > Bouguer_NA.xyz
56+
gmt grd2xyz Bouguer_NA.grd >> Bouguer_NA.xyz
57+
58+
You can repeat these commands for the corresponding Free-air anomaly and Topography data.
59+
60+
GEBCO
61+
*****
62+
63+
This model is defined on a very fine grid (15" resolution) with a gridline registration.
64+
We first resample the grid onto a 2' grid.
65+
66+
.. sourcecode:: bash
67+
68+
# Set region and projection for NW Pacific - here we use a regular
69+
# Mercator since it straddles the equator.
70+
reg=-R145/215/-15/45
71+
proj=-JM3i
72+
73+
# Resample on a 2' grid
74+
gmt grdsample GEBCO_data/GEBCO_2019.nc -GGEBCO_resampled_2m.grd -I2m -Rd
75+
76+
# Make map of region
77+
ps=Bathy_PAC.ps
78+
gmt grdimage GEBCO_resampled_2m.grd $reg $proj -K -P \
79+
-B10WSne -CPALET_WGM_ETOPO1_Global.cpt -X1.5i -Y1.25i > $ps
80+
gmt psscale -CPALET_WGM_ETOPO1_Global.cpt -DJRM+o0.25i/0+e+mc -R -J -O >> $ps
81+
82+
# Project onto Cartesian grid
83+
gmt grdproject GEBCO_resampled_2m.grd -GBathy_PAC.grd $proj $reg -D10 -Fk
84+
85+
# Dump grid onto ASCII file with header
86+
gmt grdinfo -C Bathy_PAC.grd > header.txt
87+
sed 's/^/# /g' header.txt > Bathy_PAC.xyz
88+
gmt grd2xyz Bathy_PAC.grd >> Bathy_PAC.xyz
89+
90+
CRUST1.0
91+
********
92+
93+
The CRUST1.0 model is defined on a very coarse grid (1 degree). This is not a
94+
problem as we only use those fields in the inversion step, and not in the
95+
calculation of the wavelet transform. However, we still require an identical
96+
grid specification, so the first step is to resample them on a fine grid
97+
using spline interpolation.
98+
99+
.. note::
100+
101+
You first need to extract the proper layer within CRUST1.0. For crustal
102+
thickness, the weblink contains a global grid of crustal thickness (crsthk.xyz).
103+
For the density layer, you will have to use the provided fortran code getCN1xyz.f
104+
and rename the output file xyz-ro6 to something like crustal_density.xyz
105+
(for example). Layer 6 corresponds to the upper crustal layer. See the weblink for details.
106+
107+
.. sourcecode:: bash
108+
109+
# Set region and projection for North America
110+
reg=-R145/215/-15/45
111+
proj=-JM3i
112+
113+
# Create 2 .grd file from the ASCII data
114+
gmt xyz2grd crsthk.xyz -Gcrust_thickness_1deg.grd -Rd -I1 -T
115+
116+
# Resample on a 2' grid using spline interpolation
117+
gmt grdsample crust_thickness_1deg.grd -Gcrust_thickness_2m.grd -nb -Rg -I2m
118+
119+
# Make map of region
120+
ps=Crust_thick_PAC.ps
121+
gmt makecpt -Chaxby -T5/30/1 > crust.cpt
122+
gmt grdimage crust_thickness_2m.grd $reg $proj -K -P \
123+
-B10WSne -Ccrust.cpt -X1.5i -Y1.25i > $ps
124+
gmt psscale -Ccrust.cpt -DJRM+o0.25i/0+e+mc -R -J -O >> $ps
125+
126+
# Project onto Cartesian grid
127+
gmt grdproject crust_thickness_2m.grd -Gcrust_thickness.grd $proj $reg -D10 -Fk
128+
129+
# Dump grid onto ASCII file with header
130+
gmt grdinfo -C crust_thickness.grd > header.txt
131+
sed 's/^/# /g' header.txt > crustal_thickness_PAC.xyz
132+
gmt grd2xyz crust_thickness.grd >> crustal_thickness_PAC.xyz

docs/index.rst

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22
.. figure:: ../plateflex/examples/picture/logo_plateflex.png
33
:align: center
44

5-
.. image:: https://travis-ci.com/paudetseis/PlateFlex.svg?branch=master
6-
:target: https://travis-ci.com/paudetseis/PlateFlex
7-
8-
PlateFlex Project Documentation
9-
===============================
5+
Documentation
6+
=============
107

118
The flexure of elastic plates is a central concept in the theory of plate tectonics,
129
where the Earth's lithosphere (crust and uppermost mantle) reacts to applied loads
@@ -15,18 +12,10 @@ parameterized by the *flexural rigidity*, which is proportional to the product o
1512
Young's modulus with the cube of the elastic plate thickness. Estimating the *effective*
1613
elastic thickness (:math:`T_e`) of the lithosphere (thickness
1714
of an equivalent ideal elastic plate) gives important clues on the rheology of the
18-
lithosphere and its thermal state.
19-
20-
Estimating :math:`T_e` can be done by modeling the cross-spectral properties
21-
(admittance and coherence) between topography and gravity anomaly data,
22-
which are proxies for the distribution of flexurally compensated surface and subsurface
23-
loads. These spectral properties can be calculated using different spectral
24-
estimation techniques - however, to map :math:`T_e` variations it is
25-
important to use analysis windows small enough for good spatial resolution, but
26-
large enough to capture the effect of flexure at long wavelengths. The wavelet
27-
transform is particularly well suited for this analysis because it avoids splitting
28-
the grids into small windows and can therefore produce cross-spectral functions
29-
at each point of the input grid.
15+
lithosphere and its thermal state. Estimating :math:`T_e` is typically done by
16+
modeling the cross-spectral properties (admittance and coherence) between
17+
topography and gravity anomaly data, which are proxies for the distribution of
18+
flexurally compensated surface and subsurface loads.
3019

3120
This package contains ``python`` and ``fortran`` modules to calculate the wavelet spectral
3221
and cross-spectral quantities of 2D gridded data of topography and gravity anomalies.
@@ -37,9 +26,7 @@ load ratio (:math:`F`) and optionally the initial phase difference between
3726
surface and subsurface loads (:math:`\alpha`). The software uses the analytical
3827
functions with uniform :math:`F` and :math:`\alpha` to fit the admittance and/or coherence functions.
3928
The estimation can be done using non-linear least-squares or probabilistic (i.e., bayesian)
40-
inference methods.
41-
42-
The analysis can be done using either the Bouguer or Free air gravity anomalies, and
29+
inference methods. The analysis can be done using either the Bouguer or Free air gravity anomalies, and
4330
over land or ocean areas. Computational workflows are covered in the Jupyter
4431
notebooks bundled with this package. The software contains methods to make beautiful and
4532
insightful plots using the `seaborn` package.
@@ -49,6 +36,9 @@ insightful plots using the `seaborn` package.
4936
The cross-spectral quantities calculated here are the real-valued
5037
admittance and squared-real coherency, as discussed in the references
5138

39+
.. image:: https://travis-ci.com/paudetseis/PlateFlex.svg?branch=master
40+
:target: https://travis-ci.com/paudetseis/PlateFlex
41+
5242

5343
.. toctree::
5444
:maxdepth: 1
@@ -60,24 +50,14 @@ insightful plots using the `seaborn` package.
6050
:maxdepth: 1
6151
:caption: Getting Started
6252

63-
api
53+
getting_started
6454

6555
.. toctree::
6656
:maxdepth: 1
67-
:caption: Configuration modules
57+
:caption: API Documentation
6858

6959
conf
70-
71-
.. toctree::
72-
:maxdepth: 1
73-
:caption: Classes
74-
7560
classes
76-
77-
.. toctree::
78-
:maxdepth: 1
79-
:caption: Modules
80-
8161
estimate
8262
plotting
8363

docs/links.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,22 @@ GitHub Repository
22
-----------------
33

44
* `PlateFlex Git repository <https://github.com/paudetseis/PlateFlex>`_
5+
6+
References
7+
----------
8+
9+
* Audet, P. (2014). Toward mapping the effective elastic thickness of planetary lithospheres
10+
from a spherical wavelet analysis of gravity and topography. Physics of the Earth and
11+
Planetary Interiors, 226, 48-82. https://doi.org/10.1016/j.pepi.2013.09.011
12+
13+
* Kalnins, L.M., and Watts, A.B. (2009). Spatial variations in effective elastic thickness
14+
in the Western Pacific Ocean and their implications for Mesozoic volcanism. Earth and
15+
Planetary Science Letters, 286, 89-100. https://doi.org/10.1016/j.epsl.2009.06.018
16+
17+
* Kirby, J.F., and Swain, C.J. (2009). A reassessment of spectral Te estimation in
18+
continental interiors: The case of North America. Journal of Geophysical Research, 114,
19+
B08401. https://doi.org/10.1029/2009JB006356
20+
21+
* Kirby, J.F. (2014). Estimation of the effective elastic thickness of the lithosphere
22+
using inverse spectral methods: The state of the art. Tectonophysics,
23+
631, 87-116. https://doi.org/10.1016/j.tecto.2014.04.021

docs/plotting.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Module plotting
2-
---------------
1+
Plotting functions
2+
++++++++++++++++++
33

44
.. automodule:: plateflex.plotting
55
:members:

plateflex/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,20 @@
112112
from the package by running:
113113
114114
.. sourcecode:: python
115+
115116
from plateflex import doc
116117
doc.install_doc(path='Examples')
117118
118119
To run the notebooks you will have to further install ``jupyter``:
119120
120121
.. sourcecode:: bash
122+
121123
conda install jupyter
122124
123125
Then:
124126
125127
.. sourcecode:: bash
128+
126129
unzip data.zip
127130
cd Examples
128131
jupyter notebook

plateflex/plotting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
2222
"""
23-
This :mod:`~plateflex`` module contains the following functions for plotting:
23+
This :mod:`~plateflex` module contains the following functions for plotting:
2424
2525
- :func:`~plateflex.plotting.plot_real_grid`
2626
- :func:`~plateflex.plotting.plot_bayes_stats`

0 commit comments

Comments
 (0)