Seismic Velocity Datasets (dataset)

dataset.crust2x2

Interface to use CRUST2.0 model by Laske, Masters and Reif.

All functions defined in this module return SI units (m, m/s, kg/m^3).

Note

Please refer to the REM web site if you use this model:

or

Bassin, C., Laske, G. and Masters, G., The Current Limits of Resolution for Surface Wave Tomography in North America, EOS Trans AGU, 81, F897, 2000. A description of CRUST 5.1 can be found in: Mooney, Laske and Masters, Crust 5.1: a global crustal model at 5x5 degrees, JGR, 103, 727-747, 1998.

Usage

>>> from pyrocko import crust2x2
>>> p = crust2x2.get_profile(10., 20.)
>>> print p
type, name:              G2, Archean 0.5 km seds.
elevation:                           529
crustal thickness:                 38500
average vp, vs, rho:              6460.7          3665.1          2867.5
mantle ave. vp, vs, rho:            8200            4700            3400

          0            3810            1940             920   ice
          0            1500               0            1020   water
        500            2500            1200            2100   soft sed.
          0            4000            2100            2400   hard sed.
      12500            6200            3600            2800   upper crust
      13000            6400            3600            2850   middle crust
      13000            6800            3800            2950   lower crust
>>> print p.get_weeded()
[[     0.    500.    500.  13000.  13000.  26000.  26000.  39000.  39000.]
 [  2500.   2500.   6200.   6200.   6400.   6400.   6800.   6800.   8200.]
 [  1200.   1200.   3600.   3600.   3600.   3600.   3800.   3800.   4700.]
 [  2100.   2100.   2800.   2800.   2850.   2850.   2950.   2950.   3400.]]

Constants

Layer id Layer name
LICE ice
LWATER water
LSOFTSED soft sediments
LHARDSED hard sediments
LUPPERCRUST upper crust
LMIDDLECRUST middle crust
LLOWERCRUST lower crust
LBELOWCRUST below crust

Contents

class Crust2Profile(ident, name, vp, vs, rho, thickness, elevation)[source]

Representation of a CRUST2.0 key profile.

get_weeded(include_waterlayer=False)[source]

Get layers used in the profile.

Parameters:include_waterlayer – include water layer if True. Default is False
Returns:NumPy array with rows depth, vp, vs, density
get_layer(ilayer)[source]

Get parameters for a layer.

Parameters:ilayer – id of layer
Returns:thickness, vp, vs, density
crustal_thickness()[source]

Get total crustal thickness.

Takes into account ice layer. Does not take into account water layer.

averages()[source]

Get crustal averages for vp, vs, density and total crustal thickness.

Takes into account ice layer. Does not take into account water layer.

class Crust2(directory=None)[source]

Access CRUST2.0 model.

param directory:
 Directory with the data files which contain the CRUST2.0 model data. If this is set to None, builtin CRUST2.0 files are used.
get_profile(*args, **kwargs)[source]

Get crustal profile at a specific location or raw profile for given key.

Get profile for location (lat, lon), or raw profile for given string key.

Return type:instance of Crust2Profile
static instance()[source]

Get the global default Crust2 instance.

get_profile_keys()[source]

Get list of all profile keys.

get_profile(*args, **kwargs)[source]

Get Crust2x2 profile for given location or profile key.

Get profile for (lat,lon) or raw profile for given string key.

plot_crustal_thickness(crust2=None, filename='crustal_thickness.pdf')[source]

Create a quick and dirty plot of the crustal thicknesses defined in CRUST2.0.

plot_vp_belowcrust(crust2=None, filename='vp_below_crust.pdf')[source]

Create a quick and dirty plot of vp below the crust, as defined in CRUST2.0.

dataset.crustdb

Access to the USGS Global Crustal Database.

Simple queries and statistical analysis

class VelocityProfile(*args, **kwargs)[source]

Undocumented.

uid

int, optional

Unique ID of measurement

lat

float

Latitude [deg]

lon

float

Longitude [deg]

elevation

float, default: nan

Elevation [m]

vp

pyrocko.guts.doublequoted (pyrocko.guts_array.Array)

P Wave velocities [m/s]

vs

pyrocko.guts.doublequoted (pyrocko.guts_array.Array)

S Wave velocities [m/s]

d

pyrocko.guts.doublequoted (pyrocko.guts_array.Array)

Interface depth, top [m]

h

pyrocko.guts.doublequoted (pyrocko.guts_array.Array)

Interface thickness [m]

heatflow

float, optional

Heatflow [W/m^2]

geographical_location

str, optional

Geographic Location

geological_province

str, optional

Geological Province

geological_age

str, optional

Geological Age

measurement_method

int, optional

Measurement method

publication_reference

str, optional

Publication Reference

interpolateProfile(depths, phase='p', stepped=True)[source]

Get a continuous velocity function at arbitrary depth.

Parameters:
  • depth (numpy.ndarray) – Depths to interpolate
  • phase (str, optional) – P or S wave velocity, p or s
  • stepped (bool) – Use a stepped velocity function or gradient
Returns:

velocities at requested depths

Return type:

numpy.ndarray

plot(axes=None)[source]

Plot the velocity profile, see pyrocko.cake.

Parameters:axes (matplotlib.Axes) – Axes to plot into.
getLayeredModel()[source]

Get a layered model, see pyrocko.cake.LayeredModel.

iterLayers()[source]

Iterator yielding a pyrocko.cake.Material for each layer.

get_weeded()[source]

Get weeded representation of layers used in the profile. See pyrocko.cake.get_weeded() for details.

class CrustDB(database_file=None, parent=None)[source]

CrustDB is a container for VelocityProfile and provides functions for spatial selection, querying, processing and visualising data from the Global Crustal Database.

velocityMatrix(depth_range=(0, 60000.0), ddepth=100.0, phase='p')[source]

Create a regular sampled velocity matrix.

Parameters:
  • depth_range (tuple) – Depth range, (dmin, dmax), defaults to (0, 6000.)
  • ddepth (float) – Stepping in [m], defaults to 100.
  • phase (str) – Phase to calculate p or s, defaults to p
Returns:

Sample depths, veloctiy matrix

Return type:

tuple, (sample_depth, numpy.ndarray)

rmsRank(ref_profile, depth_range=(0, 3500.0), ddepth=100.0, phase='p')[source]

Correlates ref_profile to each profile in the database.

Parameters:
  • ref_profile (VelocityProfile) – Reference profile
  • depth_range (tuple, optional) – Depth range in [m], (dmin, dmax), defaults to (0, 35000.)
  • ddepth (float) – Stepping in [m], defaults to 100.
  • phase (str) – Phase to calculate p or s, defaults to p
Returns:

RMS factor length of N_profiles

Return type:

numpy.ndarray

histogram2d(depth_range=(0.0, 60000.0), vel_range=None, ddepth=100.0, dvbin=100.0, ddbin=2000.0, phase='p')[source]

Create a 2D Histogram of all the velocity profiles.

Check numpy.histogram2d() for more information.

Parameters:
  • depth_range (tuple) – Depth range in [m], (dmin, dmax), defaults to (0., 60000.)
  • vel_range (tuple) – Depth range, (vmin, vmax), defaults to (5500., 8500.)
  • ddepth (float) – Stepping in [km], defaults to 100.
  • dvbin (float) – Bin size in velocity dimension [m/s], defaults to 100.
  • dvbin – Bin size in depth dimension [m], defaults to 2000.
  • phase (str) – Phase to calculate p or s, defaults to p
Returns:

numpy.histogram2d()

Return type:

tuple

meanVelocity(depth_range=(0.0, 60000.0), ddepth=100.0, phase='p')[source]

Get mean and standard deviation of velocity profile.

Parameters:
  • depth_range (tuple) – Depth range in [m], (dmin, dmax), defaults to (0., 60000.)
  • ddepth (float) – Stepping in [m], defaults to 100.
  • phase (str) – Phase to calculate p or s, defaults to p
Returns:

depth vector, mean velocities, standard deviations

Return type:

tuple of numpy.ndarray

modeVelocity(depth_range=(0.0, 60000.0), ddepth=100.0, phase='p')[source]

Get mode velocity profile and standard deviation.

Parameters:
  • depth_range (tuple) – Depth range in [m], (dmin, dmax), defaults to (0., 60000.)
  • ddepth (float) – Stepping in [m], defaults to 100.
  • phase (str) – Phase to calculate p or s, defaults to p
Returns:

depth vector, mode velocity, number of counts at each depth

Return type:

tuple of numpy.ndarray

medianVelocity(depth_range=(0.0, 60000.0), ddepth=100.0, phase='p')[source]

Median velocity profile plus std variation.

Parameters:
  • depth_range (tuple) – Depth range in [m], (dmin, dmax), defaults to (0., 60000.)
  • ddepth (float) – Stepping in [m], defaults to 100.
  • phase (str) – Phase to calculate p or s, defaults to p
Returns:

depth vector, median velocities, standard deviations

Return type:

tuple of numpy.ndarray

plotHistogram(vel_range=None, bins=36, phase='vp', axes=None)[source]

Plot 1D histogram of seismic velocities in the container.

Parameters:
  • vel_range (tuple, optional) – Velocity range, defaults to (5.5, 8.5)
  • bins (int, optional) – bins, defaults to 30 (see numpy.histogram())
  • phase (str, optional) – Property to plot out of ['vp', 'vs'], defaults to ‘vp’
  • figure (matplotlib.Figure, optional) – Figure to plot in, defaults to None
plot(depth_range=(0, 60000.0), ddepth=100.0, ddbin=2000.0, vel_range=None, dvbin=100.0, percent=False, plot_mode=True, plot_median=True, plot_mean=False, show_cbar=True, aspect=0.02, phase='p', axes=None)[source]

Plot a two 2D Histogram of seismic velocities.

Parameters:
  • depth_range (tuple) – Depth range, (dmin, dmax), defaults to (0, 60)
  • vel_range (tuple) – Velocity range, (vmin, vmax)
  • ddepth (float) – Stepping in [m], defaults to .1
  • dvbin (float) – Bin size in velocity dimension [m/s], defaults to .1
  • dvbin – Bin size in depth dimension [m], defaults to 2000.
  • phase (str) – Phase to calculate p or s, defaults to p
  • plot_mode (bool) – Plot the Mode
  • plot_mean (bool) – Plot the Mean
  • plot_median (bool) – Plot the Median
  • axes (matplotlib.Axes) – Axes to plot into, defaults to None
plotVelocitySurface(v_max, d_min=0.0, d_max=6000.0, axes=None)[source]

Plot a triangulated a depth surface exceeding velocity.

exceedVelocity(v_max, d_min=0, d_max=60)[source]

Returns the last depth v_max has not been exceeded.

Parameters:
  • v_max – maximal velocity
  • dz (float) – depth is sampled in dz steps
  • d_max (int) – maximum depth
  • d_min (int) – minimum depth
Returns:

Lat, Lon, Depth and uid where v_max is exceeded

Return type:

list(num.array)

selectRegion(west, east, south, north)[source]

Select profiles within a region by geographic corner coordinates.

Parameters:
  • west (float) – west corner
  • east (float) – east corner
  • south (float) – south corner
  • north (float) – north corner
Returns:

Selected profiles

Return type:

CrustDB

selectPolygon(poly)[source]

Select profiles within a polygon.

The algorithm is called the Ray Casting Method

Parameters:poly – Latitude Longitude pairs of the polygon
Returns:Selected profiles
Return type:CrustDB
selectLocation(lat, lon, radius=10)[source]

Select profiles at a geographic location within a radius.

Parameters:
  • lat (float) – Latitude in [deg]
  • lon (float) – Longitude in [deg]
  • radius (float) – Radius in [deg]
Returns:

Selected profiles

Return type:

CrustDB

selectMinLayers(nlayers)[source]

Select profiles with more than nlayers.

Parameters:nlayers (int) – Minimum number of layers
Returns:Selected profiles
Return type:CrustDB
selectMaxLayers(nlayers)[source]

Select profiles with more than nlayers.

Parameters:nlayers (int) – Maximum number of layers
Returns:Selected profiles
Return type:CrustDB
selectMinDepth(depth)[source]

Select profiles describing layers deeper than depth.

Parameters:depth (float) – Minumum depth in [m]
Returns:Selected profiles
Return type:CrustDB
selectMaxDepth(depth)[source]

Select profiles describing layers shallower than depth.

Parameters:depth (float) – Maximum depth in [m]
Returns:Selected profiles
Return type:CrustDB
selectVp()[source]

Select profiles describing P wave velocity.

:returns Selected profiles :rtype: CrustDB

selectVs()[source]

Select profiles describing P wave velocity.

Returns:Selected profiles
Return type:CrustDB
exportCSV(filename=None)[source]

Export as CSV file.

Parameters:filename (str) – Export filename
exportYAML(filename=None)[source]

Export as YAML file.

Parameters:filename (str) – Export filename