pyrocko.dataset.slab2¶
Slab2 subduction zone geometry model from the USGS (Slab2).
The model provides gridded depth, depth uncertainty, strike, dip and thickness of the subducting slabs of 27 subduction zones on a regular 0.05 degree grid.
On first use, the Slab2 distribution archive is downloaded and the gridded
text files it contains are converted into a compact binary representation,
which is cached in the directory given by the slab2_dir setting of the
Pyrocko configuration (default: ~/.pyrocko/slab2).
Example:
from pyrocko.dataset.slab2 import Slab2
slabs = Slab2()
slab = slabs.get_slab('sam')
print(slab.name, slab.depth.shape)
vertices, faces = slab.get_mesh()
Citation
Hayes, G., 2018, Slab2 - A Comprehensive Subduction Zone Geometry Model: U.S. Geological Survey data release, https://doi.org/10.5066/F7PV6JNV.
Functions
Get names of the parameters available for each slab. |
|
Get full names of all Slab2 subduction zones. |
|
Get the three-letter abbreviations of all Slab2 subduction zones. |
Classes
|
Gridded geometry of a single subduction zone slab. |
|
Access to the Slab2 subduction zone geometry model. |
- class Slab(prefix, lats, lons, **grids)[source]¶
Bases:
objectGridded geometry of a single subduction zone slab.
Grid nodes outside of the slab are set to NaN.
- Variables:
prefix – three-letter abbreviation of the slab
name – full name of the subduction zone
lats – latitudes of the grid nodes [deg], shape
(nlat,)lons – longitudes of the grid nodes [deg], shape
(nlon,). As in the original dataset, these are in the range [0, 360].depth – depth of the slab surface [m], positive downwards
depth_uncertainty – uncertainty of the slab depth [m]
strike – strike of the slab surface [deg]
dip – dip of the slab surface [deg]
thickness – slab thickness [m]
The gridded parameters are 2D arrays of shape
(nlat, nlon).- get_values(parameter)[source]¶
Get gridded values of a parameter.
- Parameters:
parameter – name of the parameter, see
get_parameter_names()- Returns:
numpy.ndarrayof shape(nlat, nlon)
- get_latlondepth()[source]¶
Get coordinates of all grid nodes inside the slab.
- Returns:
numpy.ndarrayof shape(n, 3), with columns latitude [deg], longitude [deg] and depth [m]
- get_mesh(planetradius=None)[source]¶
Get quadrilateral surface mesh of the slab.
Only cells for which all four corners are inside the slab are included.
- Parameters:
planetradius – planet radius [m], defaults to
pyrocko.cake.earthradius- Returns:
(vertices, faces), whereverticesare Cartesian coordinates of shape(nvertices, 3), normalized to the planet radius, as used inpyrocko.geometry, andfacesis an integer array of shape(nfaces, 4)with vertex indices.
- get_face_values(parameter)[source]¶
Get values of a parameter for the faces of the mesh.
The values are averaged over the four corners of each face, matching the faces returned by
get_mesh().- Parameters:
parameter – name of the parameter, see
get_parameter_names()- Returns:
numpy.ndarrayof shape(nfaces,)
- class Slab2(archive_path=None, data_dir=None)[source]¶
Bases:
objectAccess to the Slab2 subduction zone geometry model.
- Parameters:
archive_path – path to a manually downloaded copy of the Slab2 distribution archive (
Slab2Distribute_Mar2018.tar.gz). If not given, the archive is expected in (or downloaded to)data_dir.data_dir – directory where the converted data is cached. Defaults to the
slab2_dirsetting of the Pyrocko configuration.
- convert()[source]¶
Convert gridded text files from the Slab2 archive to binary cache.
All slabs are converted in a single pass through the archive.
- get_slab(prefix)[source]¶
Get geometry of a slab.
- Parameters:
prefix – three-letter abbreviation of the slab, see
get_slab_prefixes()- Returns:
Slabobject