pyrocko.gf.seismosizer¶
High level synthetic seismogram synthesis.
Coordinate systems¶
Coordinate system names commonly used in source models.
Name |
Description |
|---|---|
|
northing, easting, depth in [m] |
|
northing, easting in [m] |
|
latitude, longitude in [deg] |
|
longitude, latitude in [deg] |
|
latitude, longitude in [deg], depth in [m] |
Classes
|
Boxcar type source time function. |
|
A pure CLVD point source. |
Mix-in class for Guts objects, providing dict-like access and cloning. |
|
|
Composite source model. |
|
Composite source model. |
|
A double-couple point source. |
|
Two double-couple point sources separated in space and time. |
|
Base class for synthetic seismogram calculators. |
|
An isotropic explosion point source. |
|
Undocumented. |
|
Undocumented. |
|
Half sinusoid type source time function. |
|
Offline synthetic seismogram calculator. |
|
A moment tensor point source. |
|
Undocumented. |
|
Excess pore pressure line source. |
|
Excess pore pressure point source. |
|
Undocumented. |
|
Combined Eikonal and Okada quasi-dynamic rupture model. |
|
Convenient range specification. |
|
Rectangular or line explosion source. |
|
Classical Haskell source model modified for bilateral rupture. |
|
Client for remote synthetic seismogram calculator. |
|
Synthetic seismogram computation request. |
|
Simple resonator like source time function. |
|
Resonse object to a synthetic seismogram computation request. |
|
A ring fault with vertical doublecouples. |
|
A single force point source. |
|
Base class for source time functions. |
|
Any |
|
Doublepulse land-slide STF which respects conservation of momentum. |
|
A single force landslide source respecting conservation of momentum. |
|
Smooth-ramp type source time function for near-field displacement. |
|
Base class for all source models. |
|
Undocumented. |
|
Undocumented. |
|
Undocumented. |
|
Undocumented. |
|
Base class for sources containing a moment magnitude. |
|
Oszillating source time function. |
|
Triangular type source time function. |
|
Volumetric linear vector dipole source. |
Exceptions
Raised when conversion between magnitude, moment, volume change or displacement failed. |
|
Raised, when a default store would be used but none is set. |
- exception NoDefaultStoreSet[source]¶
Bases:
ExceptionRaised, when a default store would be used but none is set.
- class Range(*args, **kwargs)[source]¶
Bases:
SObjectConvenient range specification.
Equivalent ways to sepecify the range [ 0., 1000., … 10000. ]:
Range('0 .. 10k : 1k') Range(start=0., stop=10e3, step=1e3) Range(0, 10e3, 1e3) Range('0 .. 10k @ 11') Range(start=0., stop=10*km, n=11) Range(0, 10e3, n=11) Range(values=[x*1e3 for x in range(11)])
Depending on the use context, it can be possible to omit any part of the specification. E.g. in the context of extracting a subset of an already existing range, the existing range’s specification values would be filled in where missing.
The values are distributed with equal spacing, unless the
spacingargument is modified. The values can be created offset or relative to an external base value with therelativeargument if the use context supports this.The range specification can be expressed with a short string representation:
'start .. stop @ num | spacing, relative' 'start .. stop : step | spacing, relative'
most parts of the expression can be omitted if not needed. Whitespace is allowed for readability but can also be omitted.
- ♦ start¶
float, optional
- ♦ stop¶
float, optional
- ♦ step¶
float, optional
- ♦ n¶
int, optional
- ♦ values¶
numpy.ndarray (
pyrocko.guts_array.Array), optional
- ♦ spacing¶
str(pyrocko.guts.StringChoice), optional, default:'lin'
- ♦ relative¶
str(pyrocko.guts.StringChoice), optional, default:''
- class GridDefElement(shorthand=None, **kwargs)[source]¶
Bases:
ObjectUndocumented.
- ♦ param¶
str(pyrocko.gf.meta.StringID)
- class GridDef(shorthand=None, **kwargs)[source]¶
Bases:
ObjectUndocumented.
- ♦ elements¶
listofGridDefElementobjects, default:[]
- class Cloneable[source]¶
Bases:
objectMix-in class for Guts objects, providing dict-like access and cloning.
- class BoxcarSTF(effective_duration=None, **kwargs)[source]¶
Bases:
STFBoxcar type source time function.
- ♦ duration¶
float, default:0.0duration of the boxcar
- ♦ anchor¶
float, default:0.0anchor point with respect to source.time: (-1.0: left -> source duration [0, T] ~ hypocenter time, 0.0: center -> source duration [-T/2, T/2] ~ centroid time, +1.0: right -> source duration [-T, 0] ~ rupture end time)
- class TriangularSTF(effective_duration=None, **kwargs)[source]¶
Bases:
STFTriangular type source time function.
- ♦ duration¶
float, default:0.0baseline of the triangle
- ♦ peak_ratio¶
float, default:0.5fraction of time compared to duration, when the maximum amplitude is reached
- ♦ anchor¶
float, default:0.0anchor point with respect to source.time: (-1.0: left -> source duration [0, T] ~ hypocenter time, 0.0: center -> source duration [-T/2, T/2] ~ centroid time, +1.0: right -> source duration [-T, 0] ~ rupture end time)
- class HalfSinusoidSTF(effective_duration=None, **kwargs)[source]¶
Bases:
STFHalf sinusoid type source time function.
- ♦ duration¶
float, default:0.0duration of the half-sinusoid (baseline)
- ♦ anchor¶
float, default:0.0anchor point with respect to source.time: (-1.0: left -> source duration [0, T] ~ hypocenter time, 0.0: center -> source duration [-T/2, T/2] ~ centroid time, +1.0: right -> source duration [-T, 0] ~ rupture end time)
- ♦ exponent¶
int, default:1set to 2 to use square of the half-period sinusoidal function.
- class SmoothRampSTF(effective_duration=None, **kwargs)[source]¶
Bases:
STFSmooth-ramp type source time function for near-field displacement. Based on moment function of double-couple point source proposed by [1].
- ♦ duration¶
float, default:0.0duration of the ramp (baseline)
- ♦ rise_ratio¶
float, default:0.5fraction of time compared to duration, when the maximum amplitude is reached
- ♦ anchor¶
float, default:0.0anchor point with respect to source.time: (-1.0: left -> source duration
[0, T]~ hypocenter time, 0.0: center -> source duration[-T/2, T/2]~ centroid time, +1.0: right -> source duration[-T, 0]~ rupture end time)
- class ResonatorSTF(effective_duration=None, **kwargs)[source]¶
Bases:
STFSimple resonator like source time function.
- ♦ duration¶
float, default:0.0decay time
- ♦ frequency¶
float, default:1.0resonance frequency
- class TremorSTF(effective_duration=None, **kwargs)[source]¶
Bases:
STFOszillating source time function.
- ♦ duration¶
float, default:0.0Tremor duration [s]
- ♦ frequency¶
float, default:1.0Frequency [Hz]
- class SimpleLandslideSTF(effective_duration=None, **kwargs)[source]¶
Bases:
STFDoublepulse land-slide STF which respects conservation of momentum.
- ♦ duration_acceleration¶
float, default:1.0Duratian of the acceleration phase [s].
- ♦ duration_deceleration¶
float, default:1.0Duration of the deceleration phase [s].
- ♦ mute_acceleration¶
bool, default:Falseset acceleration to zero (for testing)
- ♦ mute_deceleration¶
bool, default:Falseset acceleration to zero (for testing)
- class STFMode(...) str[source]¶
Bases:
StringChoiceAny
strout of['pre', 'post'].
- class Source(**kwargs)[source]¶
-
Base class for all source models.
- ♦ name¶
str, optional, default:''
- ♦ time¶
pyrocko.util.get_time_float (
pyrocko.guts.Timestamp), default:str_to_time('1970-01-01 00:00:00')source origin time.
- ♦ stf_mode¶
str(STFMode), default:'post'whether to apply source time function in pre or post-processing.
- update(**kwargs)[source]¶
Change some of the source models parameters.
Example:
>>> from pyrocko import gf >>> s = gf.DCSource() >>> s.update(strike=66., dip=33.) >>> print(s) --- !pf.DCSource depth: 0.0 time: 1970-01-01 00:00:00 magnitude: 6.0 strike: 66.0 dip: 33.0 rake: 0.0
- grid(**variables)[source]¶
Create grid of source model variations.
- Returns:
SourceGridinstance.
Example:
>>> from pyrocko import gf >>> base = DCSource() >>> R = gf.Range >>> for s in base.grid(R('
- base_key()[source]¶
Get key to decide about source discretization / GF stack sharing.
When two source models differ only in amplitude and origin time, the discretization and the GF stacking can be done only once for a unit amplitude and a zero origin time and the amplitude and origin times of the seismograms can be applied during post-processing of the synthetic seismogram.
For any derived parameterized source model, this method is called to decide if discretization and stacking of the source should be shared. When two source models return an equal vector of values discretization is shared.
- get_factor()[source]¶
Get the scaling factor to be applied during post-processing.
Discretization of the base seismogram is usually done for a unit amplitude, because a common factor can be efficiently multiplied to final seismograms. This eliminates to do repeat the stacking when creating seismograms for a series of source models only differing in amplitude.
This method should return the scaling factor to apply in the post-processing (often this is simply the scalar moment of the source).
- effective_stf_pre()[source]¶
Return the STF applied before stacking of the Green’s functions.
This STF is used during discretization of the parameterized source models, i.e. to produce a temporal distribution of point sources.
Handling of the STF before stacking of the GFs is less efficient but allows to use different source time functions for different parts of the source.
- effective_stf_post()[source]¶
Return the STF applied after stacking of the Green’s fuctions.
This STF is used in the post-processing of the synthetic seismograms.
Handling of the STF after stacking of the GFs is usually more efficient but is only possible when a common STF is used for all subsources.
- class SourceWithMagnitude(**kwargs)[source]¶
Bases:
SourceBase class for sources containing a moment magnitude.
- ♦ magnitude¶
float, default:6.0Moment magnitude Mw as in [Hanks and Kanamori, 1979]
- exception DerivedMagnitudeError[source]¶
Bases:
ValidationErrorRaised when conversion between magnitude, moment, volume change or displacement failed.
- class SourceWithDerivedMagnitude(**kwargs)[source]¶
Bases:
SourceUndocumented.
- check_conflicts()[source]¶
Check for parameter conflicts.
To be overloaded in subclasses. Raises
DerivedMagnitudeErroron conflicts.
- class ExplosionSource(**kwargs)[source]¶
Bases:
SourceWithDerivedMagnitudeAn isotropic explosion point source.
- ♦ magnitude¶
float, optionalmoment magnitude Mw as in [Hanks and Kanamori, 1979]
- ♦ volume_change¶
float, optionalvolume change of the explosion/implosion or the contracting/extending magmatic source. [m^3]
- discretized_source_class¶
alias of
DiscretizedExplosionSource
- class RectangularExplosionSource(**kwargs)[source]¶
Bases:
ExplosionSourceRectangular or line explosion source.
- ♦ strike¶
float, default:0.0strike direction in [deg], measured clockwise from north
- ♦ dip¶
float, default:90.0dip angle in [deg], measured downward from horizontal
- ♦ length¶
float, default:0.0length of rectangular source area [m]
- ♦ width¶
float, default:0.0width of rectangular source area [m]
- ♦ anchor¶
str(pyrocko.guts.StringChoice), optional, default:'center'Anchor point for positioning the plane, can be: top, center orbottom and also top_left, top_right,bottom_left,bottom_right, center_left and center right
- ♦ nucleation_x¶
float, optionalhorizontal position of rupture nucleation in normalized fault plane coordinates (-1 = left edge, +1 = right edge)
- ♦ nucleation_y¶
float, optionaldown-dip position of rupture nucleation in normalized fault plane coordinates (-1 = upper edge, +1 = lower edge)
- ♦ velocity¶
float, default:3500.0speed of explosion front [m/s]
- ♦ aggressive_oversampling¶
bool, default:FalseAggressive oversampling for basesource discretization. When using ‘multilinear’ interpolation oversampling has practically no effect.
- discretized_source_class¶
alias of
DiscretizedExplosionSource
- class DCSource(**kwargs)[source]¶
Bases:
SourceWithMagnitudeA double-couple point source.
- ♦ strike¶
float, default:0.0strike direction in [deg], measured clockwise from north
- ♦ dip¶
float, default:90.0dip angle in [deg], measured downward from horizontal
- ♦ rake¶
float, default:0.0rake angle in [deg], measured counter-clockwise from right-horizontal in on-plane view
- discretized_source_class¶
alias of
DiscretizedMTSource
- class CLVDSource(**kwargs)[source]¶
Bases:
SourceWithMagnitudeA pure CLVD point source.
- ♦ azimuth¶
float, default:0.0azimuth direction of largest dipole, clockwise from north [deg]
- ♦ dip¶
float, default:90.0dip direction of largest dipole, downward from horizontal [deg]
- discretized_source_class¶
alias of
DiscretizedMTSource
- class VLVDSource(**kwargs)[source]¶
Bases:
SourceWithDerivedMagnitudeVolumetric linear vector dipole source.
This source is a parameterization for a restricted moment tensor point source, useful to represent dyke or sill like inflation or deflation sources. The restriction is such that the moment tensor is rotational symmetric. It can be represented by a superposition of a linear vector dipole (here we use a CLVD for convenience) and an isotropic component. The restricted moment tensor has 4 degrees of freedom: 2 independent eigenvalues and 2 rotation angles orienting the the symmetry axis.
In this parameterization, the isotropic component is controlled by
volume_change. To define the moment tensor, it must be converted to the scalar moment of the the MT’s isotropic component. For the conversion, the shear modulus at the source’s position must be known. This value is extracted from the earth model defined in the GF store in use.The CLVD part by controlled by its scalar moment
:
clvd_moment. The sign ofclvd_momentis used to switch between a positiv or negativ CLVD (the sign of the largest eigenvalue).- ♦ azimuth¶
float, default:0.0azimuth direction of symmetry axis, clockwise from north [deg].
- ♦ dip¶
float, default:90.0dip direction of symmetry axis, downward from horizontal [deg].
- ♦ volume_change¶
float, default:0.0volume change of the inflation/deflation [m^3].
- ♦ clvd_moment¶
float, default:0.0scalar moment
of the CLVD component [Nm]. The sign controls the sign of the CLVD (the sign of its largest eigenvalue).
- discretized_source_class¶
alias of
DiscretizedMTSource
- class MTSource(**kwargs)[source]¶
Bases:
SourceA moment tensor point source.
- ♦ mnn¶
float, default:1.0north-north component of moment tensor in [Nm]
- ♦ mee¶
float, default:1.0east-east component of moment tensor in [Nm]
- ♦ mdd¶
float, default:1.0down-down component of moment tensor in [Nm]
- ♦ mne¶
float, default:0.0north-east component of moment tensor in [Nm]
- ♦ mnd¶
float, default:0.0north-down component of moment tensor in [Nm]
- ♦ med¶
float, default:0.0east-down component of moment tensor in [Nm]
- discretized_source_class¶
alias of
DiscretizedMTSource
- class RectangularSource(**kwargs)[source]¶
Bases:
SourceWithDerivedMagnitudeClassical Haskell source model modified for bilateral rupture.
- ♦ magnitude¶
float, optionalmoment magnitude Mw as in [Hanks and Kanamori, 1979]
- ♦ strike¶
float, default:0.0strike direction in [deg], measured clockwise from north
- ♦ dip¶
float, default:90.0dip angle in [deg], measured downward from horizontal
- ♦ rake¶
float, default:0.0rake angle in [deg], measured counter-clockwise from right-horizontal in on-plane view
- ♦ length¶
float, default:0.0length of rectangular source area [m]
- ♦ width¶
float, default:0.0width of rectangular source area [m]
- ♦ anchor¶
str(pyrocko.guts.StringChoice), optional, default:'center'Anchor point for positioning the plane, can be:
top, center bottom, top_left, top_right,bottom_left,bottom_right, center_left, center right.
- ♦ nucleation_x¶
float, optionalhorizontal position of rupture nucleation in normalized fault plane coordinates (
-1.= left edge,+1.= right edge)
- ♦ nucleation_y¶
float, optionaldown-dip position of rupture nucleation in normalized fault plane coordinates (
-1.= upper edge,+1.= lower edge)
- ♦ velocity¶
float, default:3500.0speed of rupture front [m/s]
- ♦ slip¶
float, optionalSlip on the rectangular source area [m]
- ♦ opening_fraction¶
float, default:0.0Determines fraction of slip related to opening. (
-1: pure tensile closing,0: pure shear,1: pure tensile opening)
- ♦ decimation_factor¶
int, optional, default:1Sub-source decimation factor, a larger decimation will make the result inaccurate but shorten the necessary computation time (use for testing puposes only).
- ♦ aggressive_oversampling¶
bool, default:FalseAggressive oversampling for basesource discretization. When using ‘multilinear’ interpolation oversampling has practically no effect.
- discretized_source_class¶
alias of
DiscretizedMTSource
- class PseudoDynamicRupture(**kwargs)[source]¶
Bases:
SourceWithDerivedMagnitudeCombined Eikonal and Okada quasi-dynamic rupture model.
Details are described in Pseudo Dynamic Rupture - A stress-based self-similar finite source model. Note: attribute stf is not used so far, but kept for future applications.
- ♦ strike¶
float, default:0.0Strike direction in [deg], measured clockwise from north.
- ♦ dip¶
float, default:0.0Dip angle in [deg], measured downward from horizontal.
- ♦ length¶
float, default:10000.0Length of rectangular source area in [m].
- ♦ width¶
float, default:5000.0Width of rectangular source area in [m].
- ♦ anchor¶
str(pyrocko.guts.StringChoice), optional, default:'center'Anchor point for positioning the plane, can be:
top, center, bottom, top_left, top_right, bottom_left, bottom_right, center_left, center_right.
- ♦ nucleation_x¶
numpy.ndarray (
pyrocko.guts_array.Array), default:array([0.])Horizontal position of rupture nucleation in normalized fault plane coordinates (
-1.= left edge,+1.= right edge).
- ♦ nucleation_y¶
numpy.ndarray (
pyrocko.guts_array.Array), default:array([0.])Down-dip position of rupture nucleation in normalized fault plane coordinates (
-1.= upper edge,+1.= lower edge).
- ♦ nucleation_time¶
numpy.ndarray (
pyrocko.guts_array.Array), optionalTime in [s] after origin, when nucleation points defined by
nucleation_xandnucleation_yrupture.
- ♦ gamma¶
float, default:0.8Scaling factor between rupture velocity and S-wave velocity:
.
- ♦ nx¶
int, default:2Number of discrete source patches in x direction (along strike).
- ♦ ny¶
int, default:2Number of discrete source patches in y direction (down dip).
- ♦ slip¶
float, optionalMaximum slip of the rectangular source [m]. Setting the slip the tractions/stress field will be normalized to accomodate the desired maximum slip.
- ♦ rake¶
float, optionalRake angle in [deg], measured counter-clockwise from right-horizontal in on-plane view. Rake is translated into homogenous tractions in strike and up-dip direction.
rakeis mutually exclusive with tractions parameter.
- ♦ patches¶
listofpyrocko.modelling.okada.OkadaSourceobjects, optionalList of all boundary elements/sub faults/fault patches.
- ♦ patch_mask¶
numpy.ndarray (
pyrocko.guts_array.Array), optionalMask for all boundary elements/sub faults/fault patches. True leaves the patch in the calculation, False excludes the patch.
- ♦ tractions¶
pyrocko.gf.tractions.TractionField, optionalTraction field the rupture plane is exposed to. See the
pyrocko.gf.tractionsmodule for more details. Iftractions=Noneandrakeis givenDirectedTractionswill be used.
- ♦ coef_mat¶
numpy.ndarray (
pyrocko.guts_array.Array), optionalCoefficient matrix linking traction and dislocation field.
- ♦ eikonal_decimation¶
int, optional, default:1Sub-source eikonal factor, a smaller eikonal factor will increase the accuracy of rupture front calculation but increases also the computation time.
- ♦ decimation_factor¶
int, optional, default:1Sub-source decimation factor, a larger decimation will make the result inaccurate but shorten the necessary computation time (use for testing puposes only).
- ♦ nthreads¶
int, optional, default:1Number of threads for Okada forward modelling, matrix inversion and calculation of point subsources. Note: for small/medium matrices 1 thread is most efficient.
- ♦ pure_shear¶
bool, optional, default:FalseCalculate only shear tractions and omit tensile tractions.
- ♦ smooth_rupture¶
bool, default:TrueSmooth the tractions by weighting partially ruptured fault patches.
- ♦ aggressive_oversampling¶
bool, default:FalseAggressive oversampling for basesource discretization. When using ‘multilinear’ interpolation oversampling has practically no effect.
- discretized_source_class¶
alias of
DiscretizedMTSource
- get_tractions()[source]¶
Get source traction vectors.
If
rakeis given, unit length directed traction vectors (DirectedTractions) are returned, else the giventractionsare used.- Returns:
Traction vectors per patch.
- Return type:
ndarray:(n_patches, 3).
- get_scaled_tractions(store)[source]¶
Get traction vectors rescaled to given slip.
Opposing to
get_tractions()traction vectors (DirectedTractions) are rescaled to the givenslipbefore returning. If noslipandrakeare provided, the giventractionsare returned without scaling.
- get_magnitude(store=None, target=None)[source]¶
Get total seismic moment magnitude Mw.
- Parameters:
store (
Store) – GF store to guide the discretization and providing the earthmodel which is needed to calculate moment from slip.target (
pyrocko.gf.targets.Target) – Target, used to get GF interpolation settings.
- Returns:
Moment magnitude
- Return type:
- outline(cs='xyz')[source]¶
Get source outline corner coordinates.
- Parameters:
cs (str) – Output coordinate system.
- Returns:
Corner points in desired coordinate system.
- Return type:
ndarray:(5, [2, 3]).
- points_on_source(cs='xyz', **kwargs)[source]¶
Convert relative plane coordinates to geographical coordinates.
Given x and y coordinates (relative source coordinates between -1. and 1.) are converted to desired geographical coordinates. Coordinates need to be given as
ndarrayargumentspoints_xandpoints_y.- Parameters:
cs (str) – Output coordinate system.
- Returns:
Point coordinates in desired coordinate system.
- Return type:
ndarray:(n_points, [2, 3]).
- pyrocko_moment_tensor(store=None, target=None)[source]¶
Get overall moment tensor of the rupture.
- Parameters:
store (
Store) – GF store to guide the discretization and providing the earthmodel which is needed to calculate moment from slip.target (
pyrocko.gf.targets.Target) – Target, used to get GF interpolation settings.
- Returns:
Moment tensor.
- Return type:
- discretize_time(store, interpolation='nearest_neighbor', vr=None, times=None, *args, **kwargs)[source]¶
Get rupture start time for discrete points on source plane.
- Parameters:
store (
Store) – Green’s function database (needs to cover whole region of the source)interpolation (str) – Interpolation method to use (choose between
'nearest_neighbor'and'multilinear').vr (
ndarray) – Array, containing rupture user defined rupture velocity values.times (
ndarray) – Array, containing zeros, where rupture is starting, real positive numbers at later secondary nucleation points and -1, where time will be calculated. If not given, rupture starts at nucleation_x, nucleation_y. Times are given for discrete points with equal horizontal and vertical spacing.
- Returns:
Coordinates (latlondepth), coordinates (xy), rupture velocity, rupture propagation time of discrete points.
- Return type:
ndarray:(n_points, 3),ndarray:(n_points, 2),ndarray:(n_points_dip, n_points_strike),ndarray:(n_points_dip, n_points_strike).
- get_vr_time_interpolators(store, interpolation='nearest_neighbor', force=False, **kwargs)[source]¶
Get interpolators for rupture velocity and rupture time.
Additional
**kwargsare passed todiscretize_time().- Parameters:
store (
Store) – Green’s function database (needs to cover whole region of the source).interpolation (str) – Interpolation method to use (choose between
'nearest_neighbor'and'multilinear').force (bool) – Force recalculation of the interpolators (e.g. after change of nucleation point locations/times). Default is
False.
- discretize_patches(store, interpolation='nearest_neighbor', force=False, grid_shape=(), **kwargs)[source]¶
Get rupture start time and OkadaSource elements for points on rupture.
All source elements and their corresponding center points are calculated and stored in the
patchesattribute.Additional
**kwargsare passed todiscretize_time().- Parameters:
store (
Store) – Green’s function database (needs to cover whole region of the source).interpolation (str) – Interpolation method to use (choose between
'nearest_neighbor'and'multilinear').force (bool) – Force recalculation of the vr and time interpolators ( e.g. after change of nucleation point locations/times). Default is
False.grid_shape (
tupleofint) – Desired sub fault patch grid size (nlength, nwidth). Either factor or grid_shape should be set.
- discretize_basesource(store, target=None)[source]¶
Prepare source for synthetic waveform calculation.
- Parameters:
- Returns:
Source discretized by a set of moment tensors and times.
- Return type:
- get_slip(time=None, scale_slip=True, interpolation='nearest_neighbor', **kwargs)[source]¶
Get slip per subfault patch for given time after rupture start.
- Parameters:
time (float) – Time after origin [s], for which slip is computed. If not given, final static slip is returned.
scale_slip (bool) – If
Trueandslipgiven, all slip values are scaled to fit the given maximum slip.interpolation (str) – Interpolation method to use (choose between
'nearest_neighbor'and'multilinear').
- Returns:
Inverted dislocations (
) for each source patch.
- Return type:
ndarray:(n_sources, 3)
- get_delta_slip(store=None, deltat=None, delta=True, interpolation='nearest_neighbor', **kwargs)[source]¶
Get slip change snapshots.
The time interval, within which the slip changes are computed is determined by the sampling rate of the Green’s function database or
deltat. Additional**kwargsare passed toget_slip().- Parameters:
store (
Store) – Green’s function database (needs to cover whole region of of the source). Its sampling interval is used as time increment for slip difference calculation. Eitherdeltatorstoreshould be given.deltat (float) – Time interval for slip difference calculation [s]. Either
deltatorstoreshould be given.delta (bool) – If
True, slip differences between two time steps are given. IfFalse, cumulative slip for all time steps.interpolation (str) – Interpolation method to use (choose between
'nearest_neighbor'and'multilinear').
- Returns:
Displacement changes(
) for each source patch and time; corner times, for which delta slip is computed. The order of displacement changes array is:
- Return type:
- get_slip_rate(*args, **kwargs)[source]¶
Get slip rate inverted from patches.
The time interval, within which the slip rates are computed is determined by the sampling rate of the Green’s function database or
deltat. Additional*argsand**kwargsare passed toget_delta_slip().
- get_moment_rate_patches(*args, **kwargs)[source]¶
Get scalar seismic moment rate for each patch individually.
Additional
*argsand**kwargsare passed toget_slip_rate().
- get_moment_rate(store, target=None, deltat=None)[source]¶
Get seismic source moment rate for the total source (STF).
- Parameters:
store (
Store) – Green’s function database (needs to cover whole region of of the source). Itsdeltat[s] is used as time increment for slip difference calculation. Eitherdeltatorstoreshould be given.target (
Target) – Target information, needed for interpolation method.deltat (float) – Time increment for slip difference calculation [s]. If not given
store.deltatis used.
- Returns:
Seismic moment rate [Nm/s] for each time; corner times, for which moment rate is computed. The order of the moment rate array is:
- Return type:
- get_moment(*args, **kwargs)[source]¶
Get cumulative seismic moment.
Additional
*argsand**kwargsare passed toget_magnitude().- Returns:
Cumulative seismic moment in [Nm].
- Return type:
- rescale_slip(magnitude=None, moment=None, **kwargs)[source]¶
Rescale source slip based on given target magnitude or seismic moment.
Rescale the maximum source slip to fit the source moment magnitude or seismic moment to the given target values. Either
magnitudeormomentneed to be given. Additional**kwargsare passed toget_moment().
- get_centroid(store, *args, **kwargs)[source]¶
Centroid of the pseudo dynamic rupture model.
The centroid location and time are derived from the locations and times of the individual patches weighted with their moment contribution. Additional
**kwargsare passed topyrocko_moment_tensor().- Parameters:
store (
Store) – Green’s function database (needs to cover whole region of of the source). Itsdeltat[s] is used as time increment for slip difference calculation. Eitherdeltatorstoreshould be given.- Returns:
The centroid location and associated moment tensor.
- Return type:
- get_coulomb_failure_stress(receiver_points, friction, pressure, strike, dip, rake, time=None, *args, **kwargs)[source]¶
Calculate Coulomb failure stress change CFS.
The function obtains the Coulomb failure stress change
at arbitrary receiver points with a commonly oriented receiver plane assuming:
with the shear stress
, the coefficient of friction
, the normal stress
, and the pore fluid pressure change
. Each receiver point is characterized by its geographical coordinates, and depth. The required receiver plane orientation is defined by
strike,dip, andrake. The Coulomb failure stress change is calculated for a given time after rupture origin time.- Parameters:
receiver_points (
ndarray:(n_receiver, 3)) – Location of the receiver points in Northing, Easting, and depth in [m].friction (float) – Coefficient of friction.
pressure (float) – Pore pressure change in [Pa].
strike (float) – Strike of the receiver plane in [deg].
dip (float) – Dip of the receiver plane in [deg].
rake (float) – Rake of the receiver plane in [deg].
time (float) – Time after origin [s], for which the resulting
is computed. If not given,
is derived based on the final static slip.
- Returns:
The Coulomb failure stress change
at each receiver point in [Pa].
- Return type:
ndarray:(n_receiver,)
- class DoubleDCSource(**kwargs)[source]¶
Bases:
SourceWithMagnitudeTwo double-couple point sources separated in space and time. Moment share between the sub-sources is controlled by the parameter mix. The position of the subsources is dependent on the moment distribution between the two sources. Depth, east and north shift are given for the centroid between the two double-couples. The subsources will positioned according to their moment shares around this centroid position. This is done according to their delta parameters, which are therefore in relation to that centroid. Note that depth of the subsources therefore can be depth+/-delta_depth. For shallow earthquakes therefore the depth has to be chosen deeper to avoid sampling above surface.
- ♦ strike1¶
float, default:0.0strike direction in [deg], measured clockwise from north
- ♦ dip1¶
float, default:90.0dip angle in [deg], measured downward from horizontal
- ♦ azimuth¶
float, default:0.0azimuth to second double-couple [deg], measured at first, clockwise from north
- ♦ rake1¶
float, default:0.0rake angle in [deg], measured counter-clockwise from right-horizontal in on-plane view
- ♦ strike2¶
float, default:0.0strike direction in [deg], measured clockwise from north
- ♦ dip2¶
float, default:90.0dip angle in [deg], measured downward from horizontal
- ♦ rake2¶
float, default:0.0rake angle in [deg], measured counter-clockwise from right-horizontal in on-plane view
- ♦ delta_time¶
float, default:0.0separation of double-couples in time (t2-t1) [s]
- ♦ delta_depth¶
float, default:0.0difference in depth (z2-z1) [m]
- ♦ distance¶
float, default:0.0distance between the two double-couples [m]
- ♦ mix¶
float, default:0.5how to distribute the moment to the two doublecouples mix=0 -> m1=1 and m2=0; mix=1 -> m1=0, m2=1
- ♦ stf1¶
STF, optionalSource time function of subsource 1 (if given, overrides STF from attribute
Source.stf)
- ♦ stf2¶
STF, optionalSource time function of subsource 2 (if given, overrides STF from attribute
Source.stf)
- discretized_source_class¶
alias of
DiscretizedMTSource
- class RingfaultSource(**kwargs)[source]¶
Bases:
SourceWithMagnitudeA ring fault with vertical doublecouples.
- ♦ diameter¶
float, default:1.0diameter of the ring in [m]
- ♦ sign¶
float, default:1.0inside of the ring moves up (+1) or down (-1)
- ♦ strike¶
float, default:0.0strike direction of the ring plane, clockwise from north, in [deg]
- ♦ dip¶
float, default:0.0dip angle of the ring plane from horizontal in [deg]
- ♦ npointsources¶
int, default:360number of point sources to use
- discretized_source_class¶
alias of
DiscretizedMTSource
- class CombiSource(subsources=[], **kwargs)[source]¶
Bases:
SourceComposite source model.
- discretized_source_class¶
alias of
DiscretizedMTSource
- class CombiSFSource(subsources=[], **kwargs)[source]¶
Bases:
SourceComposite source model.
- discretized_source_class¶
alias of
DiscretizedSFSource
- class SFSource(**kwargs)[source]¶
Bases:
SourceA single force point source.
Supported GF schemes: ‘elastic5’.
- ♦ fn¶
float, default:0.0northward component of single force [N]
- ♦ fe¶
float, default:0.0eastward component of single force [N]
- ♦ fd¶
float, default:0.0downward component of single force [N]
- discretized_source_class¶
alias of
DiscretizedSFSource
- class SimpleLandslideSource(**kwargs)[source]¶
Bases:
SourceA single force landslide source respecting conservation of momentum.
The landslide is modelled point-like in space but with individual source time functions for each force component. The source time functions
SimpleLandslideSTFimpose the constraint that everything is at rest before and after the event but are allowed to have different acceleration and deceleration durations. It should thus be suitable as a first order approximation of a rock fall or landslide. For realistic landslides, the horizontal accelerations and decelerations can be delayed with respect to the vertical ones but cannot precede them.Supported GF schemes: ‘elastic5’.
- ♦ impulse_n¶
float, default:0.0northward component of impulse [Ns]
- ♦ impulse_e¶
float, default:0.0eastward component of impulse [Ns]
- ♦ impulse_d¶
float, default:0.0downward component of impulse [Ns]
- ♦ azimuth¶
float, default:0.0azimuth direction of the mass movement [deg]
- ♦ stf_v¶
SimpleLandslideSTF, default:SimpleLandslideSTF()source time function for vertical force component
- ♦ stf_h¶
SimpleLandslideSTF, default:SimpleLandslideSTF()source time function for horizontal force component
- ♦ anchor_stf¶
str(pyrocko.guts.StringChoice), default:'onset'"onset": STFs start at origin time"centroid": STFs all start at the same time but so that the centroid is at the given origin time.
- discretized_source_class¶
alias of
DiscretizedSFSource
- class PorePressurePointSource(**kwargs)[source]¶
Bases:
SourceExcess pore pressure point source.
For poro-elastic initial value problem where an excess pore pressure is brought into a small source volume.
- ♦ pp¶
float, default:1.0initial excess pore pressure in [Pa]
- discretized_source_class¶
alias of
DiscretizedPorePressureSource
- class PorePressureLineSource(**kwargs)[source]¶
Bases:
SourceExcess pore pressure line source.
The line source is centered at (north_shift, east_shift, depth).
- ♦ pp¶
float, default:1.0initial excess pore pressure in [Pa]
- ♦ length¶
float, default:0.0length of the line source [m]
- ♦ azimuth¶
float, default:0.0azimuth direction, clockwise from north [deg]
- ♦ dip¶
float, default:90.0dip direction, downward from horizontal [deg]
- discretized_source_class¶
alias of
DiscretizedPorePressureSource
- class Request(*args, **kwargs)[source]¶
Bases:
ObjectSynthetic seismogram computation request.
Request(**kwargs) Request(sources, targets, **kwargs)
- ♦ targets¶
listofpyrocko.gf.targets.Targetobjects, default:[]list of targets for which to produce synthetics.
- class ProcessingStats(**kwargs)[source]¶
Bases:
ObjectUndocumented.
- ♦ t_perc_get_store_and_receiver¶
float, default:0.0
- ♦ t_perc_discretize_source¶
float, default:0.0
- ♦ t_perc_make_base_seismogram¶
float, default:0.0
- ♦ t_perc_make_same_span¶
float, default:0.0
- ♦ t_perc_post_process¶
float, default:0.0
- ♦ t_perc_optimize¶
float, default:0.0
- ♦ t_perc_stack¶
float, default:0.0
- ♦ t_perc_static_get_store¶
float, default:0.0
- ♦ t_perc_static_discretize_basesource¶
float, default:0.0
- ♦ t_perc_static_sum_statics¶
float, default:0.0
- ♦ t_perc_static_post_process¶
float, default:0.0
- ♦ t_wallclock¶
float, default:0.0
- ♦ t_cpu¶
float, default:0.0
- ♦ n_read_blocks¶
int, default:0
- ♦ n_results¶
int, default:0
- ♦ n_subrequests¶
int, default:0
- ♦ n_stores¶
int, default:0
- ♦ n_records_stacked¶
int, default:0
- class Response(**kwargs)[source]¶
Bases:
ObjectResonse object to a synthetic seismogram computation request.
- ♦ results_list¶
listoflistofpyrocko.gf.meta.SeismosizerResultobjects objects, default:[]
- ♦ stats¶
- kite_scenes()[source]¶
Return a list of requested
kite.Sceneinstances.
- static_results()[source]¶
Return a list of requested
StaticResultinstances.
- class OutOfBoundsContext(**kwargs)[source]¶
Bases:
ObjectUndocumented.
- ♦ target¶
- ♦ distance¶
float
- ♦ components¶
listofstrobjects, default:[]
- class LocalEngine(**kwargs)[source]¶
Bases:
EngineOffline synthetic seismogram calculator.
- Parameters:
use_env – if
True, fillstore_superdirsandstore_dirswith paths set in environment variables GF_STORE_SUPERDIRS and GF_STORE_DIRS.use_config –
if
True, fillstore_superdirsandstore_dirswith paths set in the user’s config file.The config file can be found at
~/.pyrocko/config.pfgf_store_dirs: ['/home/pyrocko/gf_stores/ak135/'] gf_store_superdirs: ['/home/pyrocko/gf_stores/']
- ♦ store_superdirs¶
listofstrobjects, default:[]directories which are searched for Green’s function stores
- ♦ store_dirs¶
listofstrobjects, default:[]additional individual Green’s function store directories
- ♦ default_store_id¶
str, optionaldefault store ID to be used when a request does not provide one
- ♦ nthreads¶
int, default:1default number of threads to utilize
- get_store(store_id=None)[source]¶
Get a store from the engine.
- Parameters:
store_id – identifier of the store (optional)
- Returns:
Storeobject
If no
store_idis provided the store associated with thedefault_store_idis returned. RaisesNoDefaultStoreSetifdefault_store_idis undefined.
- class RemoteEngine(**kwargs)[source]¶
Bases:
EngineClient for remote synthetic seismogram calculator.
- ♦ site¶
str, optional, default:'localhost'
- ♦ url¶
str, optional, default:'%(site)s/gfws/%(service)s/%(majorversion)i/%(method)s'
- class SourceList(**kwargs)[source]¶
Bases:
SourceGroupUndocumented.