gf
¶
Storage and calculation of synthetic seismograms
The pyrocko.gf
subpackage splits functionality into several submodules:
 The
pyrocko.gf.store
module deals with the storage, retrieval and summation of Green’s functions.  The
pyrocko.gf.meta
module provides data structures for the meta information associated with the Green’s function stores and implements various the Green’s function lookup indexing schemes.  The
pyrocko.gf.builder
module defines a common base for Green’s function store builders.  The
pyrocko.gf.seismosizer
module provides high level synthetic seismogram synthesis.
All classes defined in the pyrocko.gf.*
submodules are imported into the
pyrocko.gf
namespace, so user scripts may simply use from pyrocko
import gf
or from pyrocko.gf import *
for convenience.
gf.store
¶

class
GFTrace
(data=None, itmin=None, deltat=1.0, is_zero=False, begin_value=None, end_value=None, tmin=None)[source]¶ Bases:
object
Green’s Function trace class for handling traces from the GF Store.

t
¶ Time vector of the GF trace.
Returns: Time vector Return type: numpy.Array


exception
CannotCreate
[source]¶ Bases:
pyrocko.gf.store.StoreError

exception
CannotOpen
[source]¶ Bases:
pyrocko.gf.store.StoreError

exception
DuplicateInsert
[source]¶ Bases:
pyrocko.gf.store.StoreError

exception
NotAllowedToInterpolate
[source]¶ Bases:
pyrocko.gf.store.StoreError

exception
NoSuchExtra
(s)[source]¶ Bases:
pyrocko.gf.store.StoreError

exception
NoSuchPhase
(s)[source]¶ Bases:
pyrocko.gf.store.StoreError

class
Store
(store_dir, mode='r', use_memmap=True)[source]¶ Bases:
pyrocko.gf.store.BaseStore
Green’s function disk storage and summation machine.
The Store can be used to efficiently store, retrieve, and sum Green’s function traces. A Store contains many 1D time traces sampled at even multiples of a global sampling rate, where each time trace has an individual start and end time. The traces are treated as having repeating end points, so the functions they represent can be nonconstant only between begin and end time. It provides capabilities to retrieve decimated traces and to extract parts of the traces. The main purpose of this class is to provide a fast, easy to use, and flexible machanism to compute weighted delayandsum stacks with many Green’s function traces involved.
Individual Green’s functions are accessed through a single integer index at low level. On top of that, various indexing schemes can be implemented by providing a mapping from physical coordinates to the low level index i. E.g. for a problem with cylindrical symmetry, one might define a mapping from the coordinates (receiver_depth, source_depth, distance) to the low level index. Index translation is done in the
pyrocko.gf.meta.Config
subclass object associated with the Store. It is accessible through the store’sconfig
attribute, and contains all meta information about the store, including physical extent, geometry, sampling rate, and information about the type of the stored Green’s functions. Information about the underlying earth model can also be found there.A GF store can also contain tabulated phase arrivals. In basic cases, these can be created with the
make_ttt()
and evaluated with thet()
methods.
config
¶ The
pyrocko.gf.meta.Config
derived object associated with the store which contains all meta information about the store and provides the highlevel to lowlevel index mapping.

store_dir
¶ Path to the store’s data directory.

mode
¶ The mode in which the store is opened:
'r'
: readonly,'w'
: writeable.

static
create
(store_dir, config, force=False, extra=None)[source]¶ Create new GF store.
Creates a new GF store at path
store_dir
. The layout of the GF is defined with the parameters given inconfig
, which should be an object of a subclass ofpyrocko.gf.meta.Config
. This function will refuse to overwrite an existing GF store, unlessforce
is set toTrue
. If more information, e.g. parameters used for the modelling code, earth models or other, should be saved along with the GF store, these may be provided though a dict given toextra
. The keys of this dict must be names and the values must be guts type objects.Parameters:  store_dir (string) – GF Store path
 config (
pyrocko.gf.meta.Config
) – GF Store Config  force (bool, optional) – Force overwrite, defaults to False
 extra (dict, optional) – Extra information, defaults to None

put
(args, trace)[source]¶ Insert trace into GF store.
Store a single GF trace at (highlevel) index
args
.Parameters: args (tuple) – pyrocko.gf.meta.Config
index tuple, e.g.(source_depth, distance, component)
as inpyrocko.gf.meta.ConfigTypeA
.Returns: GF Trace at args
Return type: pyrocko.gf.store.GFTrace

get
(args, itmin=None, nsamples=None, decimate=1, interpolation='nearest_neighbor', implementation='c')[source]¶ Retrieve GF trace from store.
Retrieve a single GF trace from the store at (highlevel) index
args
. By default, the full trace is retrieved. Givenitmin
andnsamples
, only the selected portion of the trace is extracted. Ifdecimate
is an integer in the range [2,8], the trace is decimated on the fly or, if available, the trace is read from a decimated version of the GF store.Parameters:  args (tuple) –
pyrocko.gf.meta.Config
index tuple, e.g.(source_depth, distance, component)
as inpyrocko.gf.meta.ConfigTypeA
.  itmin (integer, optional) – Start time index (start time is
itmin * dt
), defaults to None  nsamples (integer, optional) – Number of samples, defaults to None
 decimate (integer, optional) – Decimatation factor, defaults to 1
 interpolation (str, optional) – Interpolation method
['nearest_neighbor', 'multilinear', 'off']
, defaults to'nearest_neighbor'
 implementation (str, optional) – Implementation mode, defaults to
'c'
Returns: GF Trace at
args
Return type:  args (tuple) –

sum
(args, delays, weights, itmin=None, nsamples=None, decimate=1, interpolation='nearest_neighbor', implementation='c', optimization='enable')[source]¶ Sum delayed and weighted GF traces.
Calculate sum of delayed and weighted GF traces.
args
is a tuple of arrays forming the (highlevel) indices of the GF traces to be selected. Delays and weights for the summation are given in the arraysdelays
andweights
.itmin
andnsamples
can be given to restrict to computation to a given time interval. Ifdecimate
is an integer in the range [2,8], decimated traces are used in the summation.Parameters:  args (tuple) –
pyrocko.gf.meta.Config
index tuple, e.g.(source_depth, distance, component)
as inpyrocko.gf.meta.ConfigTypeA
.  delays (
numpy.Array
) – Delay times  weights (
numpy.Array
) – Trace weights  itmin (integer, optional) – Start time index (start time is
itmin * dt
), defaults to None  nsamples (integer, optional) – Number of samples, defaults to None
 decimate (integer, optional) – Decimatation factor, defaults to 1
 interpolation (str, optional) – Interpolation method
['nearest_neighbor', 'multilinear', 'off']
, defaults to'nearest_neighbor'
 implementation (str, optional) – Implementation mode
['c', 'alternative']
where'alternative'
uses a Python implementation, defaults to ‘c’  optimization (str, optional) – Optimization mode
['enable', 'disable']
, defaults to'enable'
Returns: Stacked GF Trace.
Return type:  args (tuple) –

make_decimated
(decimate, config=None, force=False, show_progress=False)[source]¶ Create decimated version of GF store.
Create a downsampled version of the GF store. Downsampling is done for the integer factor
decimate
which should be in the range [2,8]. Ifconfig
isNone
, all traces of the GF store are decimated and held available (i.e. the index mapping of the original store is used), otherwise, a different spacial stepping can be specified by giving a modified GF store configuration inconfig
(seecreate()
). Decimated GF substores are created under thedecimated
subdirectory within the GF store directory. Holding available decimated versions of the GF store can save computation time, IO bandwidth, or decrease memory footprint at the cost of increased disk space usage, when computation are done for lower frequency signals.Parameters:  decimate (integer) – Decimate factor
 config (
pyrocko.gf.meta.Config
, optional) – GF Store config object, defaults to None  force (bool, optional) – Force overwrite, defaults to False
 show_progress (bool, optional) – Show progress, defaults to False

get_stored_phase
(phase_id)[source]¶ Get stored phase from GF STore
Returns: Phase information Return type: pyrocko.spit.SPTree

t
(timing, *args)[source]¶ Compute interpolated phase arrivals.
Examples:
If
test_store
is ofpyrocko.gf.meta.ConfigTypeA
:test_store.t('p', (1000, 10000)) test_store.t('last{PPdiff}', (1000, 10000)) # The latter arrival # of P or diffracted # P phase
If
test_store
is ofpyrocko.gf.meta.ConfigTypeB
:test_store.t('S', (1000, 1000, 10000)) test_store.t('first{PpPdiffsP}', (1000, 1000, 10000)) # The ` # first arrival of # the given phases is # selected
Parameters:  timing (string or
pyrocko.gf.meta.Timing
) – Timing string as described above  *args (tuple) –
pyrocko.gf.meta.Config
index tuple, e.g.(source_depth, distance, component)
as inpyrocko.gf.meta.ConfigTypeA
.
Returns: Phase arrival according to
timing
Return type:  timing (string or

make_timing_params
(begin, end, snap_vred=True, force=False)[source]¶ Compute tight parameterized time ranges to include given timings.
Calculates appropriate time ranges to cover given begin and end timings over all GF points in the store. A dict with the following keys is returned:
'tmin'
: time [s], minimum of begin timing over all GF points'tmax'
: time [s], maximum of end timing over all GF points'vred'
,'tmin_vred'
: slope [m/s] and offset [s] of reduction velocity [m/s] appropriate to catch begin timing over all GF points'tlenmax_vred'
: maximum time length needed to cover all end timings, when using linear slope given with (vred
,tmin_vred
) as start

make_ttt
(force=False)[source]¶ Compute travel time tables.
Travel time tables are computed using the 1D earth model defined in
pyrocko.gf.meta.Config.earthmodel_1d
for each defined phase inpyrocko.gf.meta.Config.tabulated_phases
. The accuracy of the tablulated times is adjusted to the sampling rate of the store.

gf.builder
¶
gf.seismosizer
¶

class
Range
(*args, **kwargs)[source]¶ Bases:
pyrocko.guts.SObject
Convenient 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
spacing
argument is modified. The values can be created offset or relative to an external base value with therelative
argument 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
¶ builtins.str
(pyrocko.guts.StringChoice
), optional, default:'lin'

♦
relative
¶ builtins.str
(pyrocko.guts.StringChoice
), optional, default:''

♦

class
STF
(effective_duration=None, **kwargs)[source]¶ Bases:
pyrocko.guts.Object
,pyrocko.gf.seismosizer.Cloneable
Base class for source time functions.

class
BoxcarSTF
(effective_duration=None, **kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.STF
Boxcar type source time function.

♦
duration
¶ float
, default:0.0
duration of the boxcar

♦
anchor
¶ float
, default:0.0
anchor 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:
pyrocko.gf.seismosizer.STF
Triangular type source time function.

♦
duration
¶ float
, default:0.0
baseline of the triangle

♦
peak_ratio
¶ float
, default:0.5
fraction of time compared to duration, when the maximum amplitude is reached

♦
anchor
¶ float
, default:0.0
anchor 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:
pyrocko.gf.seismosizer.STF
Half sinusoid type source time function.

♦
duration
¶ float
, default:0.0
duration of the halfsinusoid (baseline)

♦
anchor
¶ float
, default:0.0
anchor 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
STFMode
(dummy) → str[source]¶ Bases:
pyrocko.guts.StringChoice
Any
str
out of['pre', 'post']
.

class
Source
(**kwargs)[source]¶ Bases:
pyrocko.model.location.Location
,pyrocko.gf.seismosizer.Cloneable
Base class for all source models.

♦
name
¶ str
, optional, default:''

♦
time
¶ builtins.float
(pyrocko.guts.Timestamp
), default:0.0
source origin time

♦
stf_mode
¶ builtins.str
(STFMode
), default:'post'
whether to apply source time function in pre or postprocessing

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: 19700101 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: SourceGrid
instance.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 postprocessing 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_timeshift
()[source]¶ Get the timeshift to be applied during postprocessing.
When discretizing the base seismogram, the source time this is usually done for a source origin time of zero. Different source origin times can be efficiently handled in postprocessing of the synthetic seismogram (so GF stacking only has to be done once for source models differing only in origin time).
This method should return the time shift to apply in the postprocessing (usually the origin time).

get_factor
()[source]¶ Get the scaling factor to be applied during postprocessing.
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 postprocessing (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 postprocessing of the synthetic seismograms (Not implemented yet).
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:
pyrocko.gf.seismosizer.Source
Base class for sources containing a moment magnitude.

♦
magnitude
¶ float
, default:6.0
moment magnitude Mw as in [Hanks and Kanamori, 1979]

♦

class
SourceWithDerivedMagnitude
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.Source
Undocumented.

♦
magnitude
¶ float
, optionalmoment magnitude Mw as in [Hanks and Kanamori, 1979]

check_conflicts
()[source]¶ Check for parameter conflicts.
To be overloaded in subclasses. Raises
DerivedMagnitudeError
on conflicts.

♦

class
ExplosionSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.SourceWithDerivedMagnitude
An isotropic explosion point source.

♦
volume_change
¶ float
, optionalvolume change of the explosion/implosion or the contracting/extending magmatic source. [m^3]

discretized_source_class
¶

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 postprocessing 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.

check_conflicts
()[source]¶ Check for parameter conflicts.
To be overloaded in subclasses. Raises
DerivedMagnitudeError
on conflicts.

get_factor
()[source]¶ Get the scaling factor to be applied during postprocessing.
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 postprocessing (often this is simply the scalar moment of the source).

♦

class
RectangularExplosionSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.ExplosionSource
Rectangular or line explosion source.

♦
strike
¶ float
, default:0.0
strike direction in [deg], measured clockwise from north

♦
dip
¶ float
, default:90.0
dip angle in [deg], measured downward from horizontal

♦
length
¶ float
, default:0.0
length of rectangular source area [m]

♦
width
¶ float
, default:0.0
width of rectangular source area [m]

♦
anchor
¶ builtins.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
, optionaldowndip position of rupture nucleation in normalized fault plane coordinates (1 = upper edge, +1 = lower edge)

♦
velocity
¶ float
, default:3500.0
speed of explosion front [m/s]

discretized_source_class
¶

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 postprocessing 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.

♦

class
DCSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.SourceWithMagnitude
A doublecouple point source.

♦
strike
¶ float
, default:0.0
strike direction in [deg], measured clockwise from north

♦
dip
¶ float
, default:90.0
dip angle in [deg], measured downward from horizontal

♦
rake
¶ float
, default:0.0
rake angle in [deg], measured counterclockwise from righthorizontal in onplane view

discretized_source_class
¶ alias of
pyrocko.gf.meta.DiscretizedMTSource

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 postprocessing 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 postprocessing.
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 postprocessing (often this is simply the scalar moment of the source).

♦

class
CLVDSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.SourceWithMagnitude
A pure CLVD point source.

♦
azimuth
¶ float
, default:0.0
azimuth direction of largest dipole, clockwise from north [deg]

♦
dip
¶ float
, default:90.0
dip direction of largest dipole, downward from horizontal [deg]

discretized_source_class
¶ alias of
pyrocko.gf.meta.DiscretizedMTSource

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 postprocessing 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 postprocessing.
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 postprocessing (often this is simply the scalar moment of the source).

♦

class
MTSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.Source
A moment tensor point source.

♦
mnn
¶ float
, default:1.0
northnorth component of moment tensor in [Nm]

♦
mee
¶ float
, default:1.0
easteast component of moment tensor in [Nm]

♦
mdd
¶ float
, default:1.0
downdown component of moment tensor in [Nm]

♦
mne
¶ float
, default:0.0
northeast component of moment tensor in [Nm]

♦
mnd
¶ float
, default:0.0
northdown component of moment tensor in [Nm]

♦
med
¶ float
, default:0.0
eastdown component of moment tensor in [Nm]

discretized_source_class
¶ alias of
pyrocko.gf.meta.DiscretizedMTSource

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 postprocessing 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.

♦

class
RectangularSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.SourceWithDerivedMagnitude
Classical Haskell source model modified for bilateral rupture.

♦
strike
¶ float
, default:0.0
strike direction in [deg], measured clockwise from north

♦
dip
¶ float
, default:90.0
dip angle in [deg], measured downward from horizontal

♦
rake
¶ float
, default:0.0
rake angle in [deg], measured counterclockwise from righthorizontal in onplane view

♦
length
¶ float
, default:0.0
length of rectangular source area [m]

♦
width
¶ float
, default:0.0
width of rectangular source area [m]

♦
anchor
¶ builtins.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
, optionaldowndip position of rupture nucleation in normalized fault plane coordinates (1 = upper edge, +1 = lower edge)

♦
velocity
¶ float
, default:3500.0
speed of rupture front [m/s]

♦
slip
¶ float
, optionalSlip on the rectangular source area [m]

♦
decimation_factor
¶ int
, optional, default:1
Subsource decimation factor, a larger decimation will shorten the necessary computation time.

discretized_source_class
¶ alias of
pyrocko.gf.meta.DiscretizedMTSource

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 postprocessing 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.

check_conflicts
()[source]¶ Check for parameter conflicts.
To be overloaded in subclasses. Raises
DerivedMagnitudeError
on conflicts.

get_factor
()[source]¶ Get the scaling factor to be applied during postprocessing.
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 postprocessing (often this is simply the scalar moment of the source).

♦

class
DoubleDCSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.SourceWithMagnitude
Two doublecouple point sources separated in space and time. Moment share between the subsources 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 doublecouples. 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.0
strike direction in [deg], measured clockwise from north

♦
dip1
¶ float
, default:90.0
dip angle in [deg], measured downward from horizontal

♦
azimuth
¶ float
, default:0.0
azimuth to second doublecouple [deg], measured at first, clockwise from north

♦
rake1
¶ float
, default:0.0
rake angle in [deg], measured counterclockwise from righthorizontal in onplane view

♦
strike2
¶ float
, default:0.0
strike direction in [deg], measured clockwise from north

♦
dip2
¶ float
, default:90.0
dip angle in [deg], measured downward from horizontal

♦
rake2
¶ float
, default:0.0
rake angle in [deg], measured counterclockwise from righthorizontal in onplane view

♦
delta_time
¶ float
, default:0.0
separation of doublecouples in time (t2t1) [s]

♦
delta_depth
¶ float
, default:0.0
difference in depth (z2z1) [m]

♦
distance
¶ float
, default:0.0
distance between the two doublecouples [m]

♦
mix
¶ float
, default:0.5
how 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
pyrocko.gf.meta.DiscretizedMTSource

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 postprocessing 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 postprocessing.
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 postprocessing (often this is simply the scalar moment of the source).

effective_stf_post
()[source]¶ Return the STF applied after stacking of the Green’s fuctions.
This STF is used in the postprocessing of the synthetic seismograms (Not implemented yet).
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
RingfaultSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.SourceWithMagnitude
A ring fault with vertical doublecouples.

♦
diameter
¶ float
, default:1.0
diameter of the ring in [m]

♦
sign
¶ float
, default:1.0
inside of the ring moves up (+1) or down (1)

♦
strike
¶ float
, default:0.0
strike direction of the ring plane, clockwise from north, in [deg]

♦
dip
¶ float
, default:0.0
dip angle of the ring plane from horizontal in [deg]

♦
npointsources
¶ int
, default:360
number of point sources to use

discretized_source_class
¶ alias of
pyrocko.gf.meta.DiscretizedMTSource

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 postprocessing 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 postprocessing.
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 postprocessing (often this is simply the scalar moment of the source).

♦

class
SFSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.Source
A single force point source.

♦
fn
¶ float
, default:0.0
northward component of single force [N]

♦
fe
¶ float
, default:0.0
eastward component of single force [N]

♦
fd
¶ float
, default:0.0
downward component of single force [N]

discretized_source_class
¶ alias of
pyrocko.gf.meta.DiscretizedSFSource

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 postprocessing 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 postprocessing.
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 postprocessing (often this is simply the scalar moment of the source).

♦

class
PorePressurePointSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.Source
Excess pore pressure point source.
For poroelastic initial value problem where an excess pore pressure is brought into a small source volume.

♦
pp
¶ float
, default:1.0
initial excess pore pressure in [Pa]

discretized_source_class
¶

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 postprocessing 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 postprocessing.
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 postprocessing (often this is simply the scalar moment of the source).

♦

class
PorePressureLineSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.Source
Excess pore pressure line source.
The line source is centered at (north_shift, east_shift, depth).

♦
pp
¶ float
, default:1.0
initial excess pore pressure in [Pa]

♦
length
¶ float
, default:0.0
length of the line source [m]

♦
azimuth
¶ float
, default:0.0
azimuth direction, clockwise from north [deg]

♦
dip
¶ float
, default:90.0
dip direction, downward from horizontal [deg]

discretized_source_class
¶

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 postprocessing 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 postprocessing.
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 postprocessing (often this is simply the scalar moment of the source).

♦

class
Request
(*args, **kwargs)[source]¶ Bases:
pyrocko.guts.Object
Synthetic seismogram computation request.
Request(**kwargs) Request(sources, targets, **kwargs)

♦
targets
¶ list
ofpyrocko.gf.targets.Target
objects, default:[]
list of targets for which to produce synthetics.

♦

class
ProcessingStats
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.

♦
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:
pyrocko.guts.Object
Resonse object to a synthetic seismogram computation request.

♦
results_list
¶ list
oflist
ofpyrocko.gf.meta.SeismosizerResult
objects objects, default:[]

♦
stats
¶

static_results
()[source]¶ Return a list of requested
StaticResult
instances.

♦

class
Engine
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Base class for synthetic seismogram calculators.

class
LocalEngine
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.Engine
Offline synthetic seismogram calculator.
Parameters:  use_env – if
True
, fillstore_superdirs
andstore_dirs
with paths set in environment variables GF_STORE_SUPERDIRS AND GF_STORE_DIRS  use_config – if
True
, fillstore_superdirs
andstore_dirs
with paths set in the user’s config file.

♦
store_superdirs
¶ list
ofstr
objects, default:[]
directories which are searched for Green’s function stores

♦
store_dirs
¶ list
ofstr
objects, 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

get_store
(store_id=None)[source]¶ Get a store from the engine.
Parameters: store_id – identifier of the store (optional) Returns: pyrocko.gf.store.Store
objectIf no
store_id
is provided the store associated with thedefault_store_id
is returned. RaisesNoDefaultStoreSet
ifdefault_store_id
is undefined.
 use_env – if

class
RemoteEngine
(**kwargs)[source]¶ Bases:
pyrocko.gf.seismosizer.Engine
Client 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:
pyrocko.gf.seismosizer.SourceGroup
Undocumented.
gf.targets
¶

class
OptimizationMethod
(dummy) → str[source]¶ Bases:
pyrocko.guts.StringChoice
Any
str
out of['enable', 'disable']
.

component_orientation
(source, target, component)[source]¶ Get component and azimuth for standard components R, T, Z, N, and E.
Parameters:  source –
pyrocko.gf.Location
object  target –
pyrocko.gf.Location
object  component – string
'R'
,'T'
,'Z'
,'N'
or'E'
 source –

class
Target
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.Receiver
A seismogram computation request for a single component, including its postprocessing parmeters.

♦
quantity
¶ builtins.str
(pyrocko.gf.meta.QuantityType
), optionalMeasurement quantity type (e.g. “displacement”, “pressure”, …)If not given, it is guessed from the channel code.Beware: If velocity is requested, the velocity is not directlyretrieved. Instead a numpy.diff is run on the retrieveddisplacements, with lower accuracy. For high accuracy werecommend using the Pyrocko object DifferentiationResponse.

♦
codes
¶ tuple
of 4str
objects, default:('', 'STA', '', 'Z')
network, station, location and channel codes to be set on the response trace.

♦
elevation
¶ float
, default:0.0
station surface elevation in [m]

♦
store_id
¶ builtins.str
(pyrocko.gf.meta.StringID
), optionalID of Green’s function store to use for the computation. If not given, the processor may use a system default.

♦
sample_rate
¶ float
, optionalsample rate to produce. If not given the GF store’s default sample rate is used. GF store specific restrictions may apply.

♦
interpolation
¶ builtins.str
(pyrocko.gf.meta.InterpolationMethod
), default:'nearest_neighbor'
Interpolation method between Green’s functions. Supported are
nearest_neighbor
andmultilinear

♦
optimization
¶ builtins.str
(OptimizationMethod
), optional, default:'enable'
disable/enable optimizations in weightdelayandsum operation

♦
tmin
¶ builtins.float
(pyrocko.guts.Timestamp
), optionaltime of first sample to request in [s]. If not given, it is determined from the Green’s functions.

♦
tmax
¶ builtins.float
(pyrocko.guts.Timestamp
), optionaltime of last sample to request in [s]. If not given, it is determined from the Green’s functions.

♦
azimuth
¶ float
, optionalazimuth of sensor component in [deg], clockwise from north. If not given, it is guessed from the channel code.

♦
dip
¶ float
, optionaldip of sensor component in [deg], measured downward from horizontal. If not given, it is guessed from the channel code.

♦

class
StaticTarget
(*args, **kwargs)[source]¶ Bases:
pyrocko.gf.meta.MultiLocation
A computation request for a spatial multilocation target of static/geodetic quantities.

♦
quantity
¶ builtins.str
(pyrocko.gf.meta.QuantityType
), optional, default:'displacement'
Measurement quantity type, for now only displacement issupported.

♦
interpolation
¶ builtins.str
(pyrocko.gf.meta.InterpolationMethod
), default:'nearest_neighbor'
Interpolation method between Green’s functions. Supported are
nearest_neighbor
andmultilinear

♦
tsnapshot
¶ builtins.float
(pyrocko.guts.Timestamp
), optionaltime of the desired snapshot in [s], If not given, the first sample is taken. If the desired sample exceeds the length of the Green’s function store, the last sample is taken.

♦
store_id
¶ builtins.str
(pyrocko.gf.meta.StringID
), optionalID of Green’s function store to use for the computation. If not given, the processor may use a system default.

ntargets
¶ Number of targets held by instance.

♦

class
SatelliteTarget
(*args, **kwargs)[source]¶ Bases:
pyrocko.gf.targets.StaticTarget
A computation request for a spatial multilocation target of static/geodetic quantities measured from a satellite instrument. The line of sight angles are provided and projecting postprocessing is applied.

♦
theta
¶ numpy.ndarray
(pyrocko.guts_array.Array
)Horizontal angle towards satellite’s line of sight in radians.
Important
is east and is north.

♦
phi
¶ numpy.ndarray
(pyrocko.guts_array.Array
)Theta is look vector elevation angle towards satellite from horizon in radians. Matrix of theta towards satellite’s line of sight.
Important
is down and is up.

♦

class
GNSSCampaignTarget
(*args, **kwargs)[source]¶ Bases:
pyrocko.gf.targets.StaticTarget
Undocumented.
gf.meta
¶

class
InterpolationMethod
(dummy) → str[source]¶ Bases:
pyrocko.guts.StringChoice
Any
str
out of['nearest_neighbor', 'multilinear']
.

class
SeismosizerTrace
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.

♦
codes
¶ tuple
of 4str
objects, default:('', 'STA', '', 'Z')
network, station, location and channel codes

♦
data
¶ numpy.ndarray
(pyrocko.guts_array.Array
)numpy array with data samples

♦
deltat
¶ float
, default:1.0
sampling interval [s]

♦
tmin
¶ builtins.float
(pyrocko.guts.Timestamp
), default:0.0
time of first sample as a system timestamp [s]

♦

class
SeismosizerResult
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.

♦
n_records_stacked
¶ int
, optional, default:1

♦
t_stack
¶ float
, optional, default:0.0

♦

class
Result
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.SeismosizerResult
Undocumented.

♦
trace
¶ SeismosizerTrace
, optional
int
, optional, default:1

♦
t_optimize
¶ float
, optional, default:0.0

♦

class
StaticResult
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.SeismosizerResult
Undocumented.

♦
result
¶ dict
ofpyrocko.guts.Any
objects, default:{}

♦

class
ComponentScheme
(dummy) → str[source]¶ Bases:
pyrocko.guts.StringChoice
Different Green’s Function component schemes are available:
Description elastic10
Elastodynamic for ConfigTypeA
andConfigTypeB
stores, MT sources onlyelastic8
Elastodynamic for farfield only ConfigTypeA
andConfigTypeB
stores, MT sources onlyelastic2
Elastodynamic for ConfigTypeA
andConfigTypeB
stores, purely isotropic sources onlyelastic5
Elastodynamic for ConfigTypeA
andConfigTypeB
stores, SF sources onlyelastic18
Elastodynamic for ConfigTypeC
stores, MT sources onlyporoelastic10
Poroelastic for ConfigTypeA
andConfigTypeB
stores

class
StringID
(dummy) → str[source]¶ Bases:
pyrocko.guts.StringPattern
Any
str
matching pattern'^[AZaz][AZaz09._]{0,64}$'
.

class
ScopeType
(dummy) → str[source]¶ Bases:
pyrocko.guts.StringChoice
Any
str
out of['global', 'regional', 'local']
.

class
NearfieldTermsType
(dummy) → str[source]¶ Bases:
pyrocko.guts.StringChoice
Any
str
out of['complete', 'incomplete', 'missing']
.

class
Reference
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.

♦
type
¶ str

♦
title
¶ str

♦
journal
¶ str
, optional

♦
volume
¶ str
, optional

♦
number
¶ str
, optional

♦
pages
¶ str
, optional

♦
year
¶ str

♦
issn
¶ str
, optional

♦
doi
¶ str
, optional

♦
url
¶ str
, optional

♦
eprint
¶ str
, optional
list
ofstr
objects, default:[]

♦
publisher
¶ str
, optional

♦
keywords
¶ str
, optional

♦
note
¶ str
, optional

♦
abstract
¶ str
, optional

♦

class
PhaseSelect
(dummy) → str[source]¶ Bases:
pyrocko.guts.StringChoice
Any
str
out of['', 'first', 'last']
.

class
Timing
(s=None, **kwargs)[source]¶ Bases:
pyrocko.guts.SObject
Definition of a time instant relative to one or more named phase arrivals
Instances of this class can be used e.g. in cutting and tapering operations. They can hold an absolute time or an offset to a named phase arrival or group of such arrivals.
Timings can be instantiated from a simple string defintion i.e. with
Timing(str)
wherestr
is something like'SELECT{PHASE_DEFS}[+]OFFSET[S]'
where'SELECT'
is'first'
,'last'
or empty,'PHASE_DEFS'
is a''
separated list of phase definitions, and'OFFSET'
is the time offset in seconds. If the an'S'
is appended to'OFFSET'
, it is interpreted as a surface slowness in [s/km].Phase definitions can be specified in either of the following ways:
'stored:PHASE_ID'
 retrieves value from stored travel time table'cake:CAKE_PHASE_DEF'
 evaluates first arrival of phase with cake (seepyrocko.cake.PhaseDef
)'vel_surface:VELOCITY'
 arrival according to surface distance / velocity [km/s]'vel:VELOCITY'
 arrival according to 3Ddistance / velocity [km/s]
Examples:
'100'
: absolute time; 100 s'{stored:P}100'
: 100 s before arrival of P phase according to stored travel time table named'P'
'{stored:Astored:B}'
: time instant of phase arrival A, or B if A is undefined for a given geometry'first{stored:Astored:B}'
: as above, but the earlier arrival of A and B is chosen, if both phases are defined for a given geometry'last{stored:Astored:B}'
: as above but the later arrival is chosen'first{stored:Astored:Bstored:C}100'
: 100 s before first out of arrivals A, B, and C

♦
phase_defs
¶ list
ofstr
objects, default:[]

♦
offset
¶ float
, default:0.0

♦
offset_is_slowness
¶ bool
, default:False

♦
select
¶ builtins.str
(PhaseSelect
), default:''
Can be either
''
,'first'
, or'last'
.

class
TPDef
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Maps an arrival phase identifier to an arrival phase definition.

♦
definition
¶ str
definition of the phase in either cake syntax as defined in
pyrocko.cake.PhaseDef
, or, if prepended with an!
, as a classic phase name, or, if it is a simple number, as a constant horizontal velocity.

♦

class
Receiver
(**kwargs)[source]¶ Bases:
pyrocko.model.location.Location
Undocumented.

♦
codes
¶ tuple
of 3str
objects, optionalnetwork, station, and location codes

♦
Bases:
Exception

class
DiscretizedExplosionSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.DiscretizedSource
Undocumented.

♦
m0s
¶ numpy.ndarray
(pyrocko.guts_array.Array
)

classmethod
combine
(sources, **kwargs)[source]¶ Combine several discretized source models.
Concatenenates all point sources in the given discretized
sources
. Care must be taken when using this function that the external amplitude factors and reference times of the parameterized (undiscretized) sources match or are accounted for.

♦

class
DiscretizedSFSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.DiscretizedSource
Undocumented.

♦
forces
¶ numpy.ndarray
(pyrocko.guts_array.Array
)

classmethod
combine
(sources, **kwargs)[source]¶ Combine several discretized source models.
Concatenenates all point sources in the given discretized
sources
. Care must be taken when using this function that the external amplitude factors and reference times of the parameterized (undiscretized) sources match or are accounted for.

♦

class
DiscretizedMTSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.DiscretizedSource
Undocumented.

♦
m6s
¶ numpy.ndarray
(pyrocko.guts_array.Array
)rows with (m_nn, m_ee, m_dd, m_ne, m_nd, m_ed)

classmethod
combine
(sources, **kwargs)[source]¶ Combine several discretized source models.
Concatenenates all point sources in the given discretized
sources
. Care must be taken when using this function that the external amplitude factors and reference times of the parameterized (undiscretized) sources match or are accounted for.

♦

class
DiscretizedPorePressureSource
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.DiscretizedSource
Undocumented.

♦
pp
¶ numpy.ndarray
(pyrocko.guts_array.Array
)

classmethod
combine
(sources, **kwargs)[source]¶ Combine several discretized source models.
Concatenenates all point sources in the given discretized
sources
. Care must be taken when using this function that the external amplitude factors and reference times of the parameterized (undiscretized) sources match or are accounted for.

♦

class
RectangularRegion
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.Region
Undocumented.

♦
lat_min
¶ float

♦
lat_max
¶ float

♦
lon_min
¶ float

♦
lon_max
¶ float

♦

class
CircularRegion
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.Region
Undocumented.

♦
lat
¶ float

♦
lon
¶ float

♦
radius
¶ float

♦

class
Config
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Green’s function store meta information.
Currently implemented
pyrocko.gf.store.Store
configurations are:pyrocko.gf.meta.ConfigTypeA
 cylindrical symmetry, 1D earth model, single receiver depth Problem is invariant to horizontal translations and rotations around vertical axis.
 All receivers must be at the same depth (e.g. at the surface)
 High level index variables:
(source_depth, receiver_distance, component)
pyrocko.gf.meta.ConfigTypeB
 cylindrical symmetry, 1D earth model, variable receiver depth Symmetries like in Type A but has additional index for receiver depth
 High level index variables:
(source_depth, receiver_distance, receiver_depth, component)
pyrocko.gf.meta.ConfigTypeC
 no symmetrical constraints but fixed receiver positions Cartesian source volume around a reference point
 High level index variables:
(ireceiver, source_depth, source_east_shift, source_north_shift, component)

♦
version
¶ str
, optional, default:'1.0'
str
, optional
str
, optional

♦
created_time
¶ builtins.float
(pyrocko.guts.Timestamp
), optional

♦
waveform_type
¶ builtins.str
(WaveformType
), optional

♦
nearfield_terms
¶ builtins.str
(NearfieldTermsType
), optional

♦
description
¶ str
, optional

♦
size
¶ int
, optional

♦
earthmodel_1d
¶ pyrocko.cake.LayeredModel
(Earthmodel1D
), optional

♦
earthmodel_receiver_1d
¶ pyrocko.cake.LayeredModel
(Earthmodel1D
), optional

♦
can_interpolate_source
¶ bool
, optional

♦
can_interpolate_receiver
¶ bool
, optional

♦
frequency_min
¶ float
, optional

♦
frequency_max
¶ float
, optional

♦
sample_rate
¶ float
, optional

♦
factor
¶ float
, optional, default:1.0

♦
component_scheme
¶ builtins.str
(ComponentScheme
), default:'elastic10'

♦
ncomponents
¶ int
, optional

get_shear_moduli
(lat, lon, points, interpolation=None)[source]¶ Get shear moduli at given points from contained velocity model.
Parameters:  lat – surface origin for coordinate system of
points
 points – NumPy array of shape
(N, 3)
, where each row is a point(north, east, depth)
, relative to origin at(lat, lon)
 interpolation – interpolation method. Choose from
('nearest_neighbor', 'multilinear')
Returns: NumPy array of length N with extracted shear moduli at each point
The default implementation retrieves and interpolates the shear moduli from the contained 1D velocity profile.
 lat – surface origin for coordinate system of

get_vs
(lat, lon, points, interpolation=None)[source]¶ Get Vs at given points from contained velocity model.
Parameters:  lat – surface origin for coordinate system of
points
 points – NumPy array of shape
(N, 3)
, where each row is a point(north, east, depth)
, relative to origin at(lat, lon)
 interpolation – interpolation method. Choose from
('nearest_neighbor', 'multilinear')
Returns: NumPy array of length N with extracted shear moduli at each point
The default implementation retrieves and interpolates Vs from the contained 1D velocity profile.
 lat – surface origin for coordinate system of

get_vp
(lat, lon, points, interpolation=None)[source]¶ Get Vp at given points from contained velocity model.
Parameters:  lat – surface origin for coordinate system of
points
 points – NumPy array of shape
(N, 3)
, where each row is a point(north, east, depth)
, relative to origin at(lat, lon)
 interpolation – interpolation method. Choose from
('nearest_neighbor', 'multilinear')
Returns: NumPy array of length N with extracted shear moduli at each point
The default implementation retrieves and interpolates Vp from the contained 1D velocity profile.
 lat – surface origin for coordinate system of

get_rho
(lat, lon, points, interpolation=None)[source]¶ Get rho at given points from contained velocity model.
Parameters:  lat – surface origin for coordinate system of
points
 points – NumPy array of shape
(N, 3)
, where each row is a point(north, east, depth)
, relative to origin at(lat, lon)
 interpolation – interpolation method. Choose from
('nearest_neighbor', 'multilinear')
Returns: NumPy array of length N with extracted shear moduli at each point
The default implementation retrieves and interpolates rho from the contained 1D velocity profile.
 lat – surface origin for coordinate system of

class
ConfigTypeA
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.Config
Cylindrical symmetry, 1D earth model, single receiver depth
 Problem is invariant to horizontal translations and rotations around vertical axis.
 All receivers must be at the same depth (e.g. at the surface)
High level index variables:
(source_depth, receiver_distance, component)

♦
receiver_depth
¶ float
, default:0.0

♦
source_depth_min
¶ float

♦
source_depth_max
¶ float

♦
source_depth_delta
¶ float

♦
distance_min
¶ float

♦
distance_max
¶ float

♦
distance_delta
¶ float

class
ConfigTypeB
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.Config
Cylindrical symmetry, 1D earth model, variable receiver depth
 Symmetries like in
ConfigTypeA
but has additional index for receiver depth  High level index variables:
(source_depth, receiver_distance, receiver_depth, component)

♦
receiver_depth_min
¶ float

♦
receiver_depth_max
¶ float

♦
receiver_depth_delta
¶ float

♦
source_depth_min
¶ float

♦
source_depth_max
¶ float

♦
source_depth_delta
¶ float

♦
distance_min
¶ float

♦
distance_max
¶ float

♦
distance_delta
¶ float
 Symmetries like in

class
ConfigTypeC
(**kwargs)[source]¶ Bases:
pyrocko.gf.meta.Config
No symmetrical constraints but fixed receiver positions.
 Cartesian 3D source volume around a reference point
 High level index variables:
(ireceiver, source_depth, source_east_shift, source_north_shift, component)

♦
source_origin
¶

♦
source_depth_min
¶ float

♦
source_depth_max
¶ float

♦
source_depth_delta
¶ float

♦
source_east_shift_min
¶ float

♦
source_east_shift_max
¶ float

♦
source_east_shift_delta
¶ float

♦
source_north_shift_min
¶ float

♦
source_north_shift_max
¶ float

♦
source_north_shift_delta
¶ float

class
Weighting
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.

♦
factor
¶ float
, default:1.0

♦

class
Taper
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.

♦
tfade
¶ float
, default:0.0

♦
shape
¶ builtins.str
(pyrocko.guts.StringChoice
), optional, default:'cos'

♦

class
WaveformType
(dummy) → str[source]¶ Bases:
pyrocko.guts.StringChoice
Any
str
out of['dis', 'vel', 'acc', 'amp_spec_dis', 'amp_spec_vel', 'amp_spec_acc', 'envelope_dis', 'envelope_vel', 'envelope_acc']
.

class
WaveformType
(dummy) → str[source] Bases:
pyrocko.guts.StringChoice
Any
str
out of['dis', 'vel', 'acc', 'amp_spec_dis', 'amp_spec_vel', 'amp_spec_acc', 'envelope_dis', 'envelope_vel', 'envelope_acc']
.

class
ChannelSelection
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.

♦
pattern
¶ SimplePattern
, optional

♦
min_sample_rate
¶ float
, optional

♦
max_sample_rate
¶ float
, optional

♦

class
StationSelection
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.

♦
includes
¶

♦
excludes
¶

♦
distance_min
¶ float
, optional

♦
distance_max
¶ float
, optional

♦
azimuth_min
¶ float
, optional

♦
azimuth_max
¶ float
, optional

♦

class
WaveformSelection
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.

♦
channel_selection
¶ ChannelSelection
, optional

♦
station_selection
¶ StationSelection
, optional

♦
waveform_type
¶ builtins.str
(WaveformType
), default:'dis'

♦
sample_rate
¶ float
, optional

♦

class
Location
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Geographical location.
The location is given by a reference point at the earth’s surface (
lat
,lon
) and a cartesian offset from this point (north_shift
,east_shift
,depth
). The offset corrected lat/lon coordinates of the location can be accessed though theeffective_latlon
,effective_lat
, andeffective_lon
properties.
♦
lat
¶ float
, optional, default:0.0
latitude of reference point [deg]

♦
lon
¶ float
, optional, default:0.0
longitude of reference point [deg]

♦
north_shift
¶ float
, optional, default:0.0
northward cartesian offset from reference point [m]

♦
east_shift
¶ float
, optional, default:0.0
eastward cartesian offset from reference point [m]

♦
elevation
¶ float
, default:0.0
elevation [m]

♦
depth
¶ float
, default:0.0
depth [m]

effective_latlon
¶ Property holding the offsetcorrected lat/lon pair of the location.

effective_lat
¶ Property holding the offsetcorrected latitude of the location.

effective_lon
¶ Property holding the offsetcorrected longitude of the location.

♦