pyrocko.dataset.crustdb

Access to the USGS Global Crustal Database.

The USGS Global Crustal Database provides empirical velocity measurements of the earth for statistical analysis.

Citation

Mooney, W. D., Laske, G., & Masters, T. G. (1998). CRUST 5.1: A global crustal model at 5x5. Journal of Geophysical Research: Solid Earth, 103(B1), 727-747.

Classes

CrustDB([database_file, parent])

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

VelocityProfile(*args, **kwargs)

Undocumented.

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

Bases: Object

Undocumented.

uid

int, optional

Unique ID of measurement

lat

float

Latitude [deg]

lon

float

Longitude [deg]

elevation

float, default: nan

Elevation [m]

vp

numpy.ndarray (pyrocko.guts_array.Array)

P Wave velocities [m/s]

vs

numpy.ndarray (pyrocko.guts_array.Array)

S Wave velocities [m/s]

d

numpy.ndarray (pyrocko.guts_array.Array)

Interface depth, top [m]

h

numpy.ndarray (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) – 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) – 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.

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

Bases: object

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) – 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) – Velocity range, defaults to (5.5, 8.5)

  • bins (int) – bins, defaults to 30 (see numpy.histogram())

  • phase (str) – Property to plot out of ['vp', 'vs'], defaults to ‘vp’

  • figure (matplotlib.figure.Figure) – 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) – 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 of numpy.ndarray

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