Inversion (si)

si.invert

class TimeReference(TimeReference) dummy for str[source]

Any str out of ['origin', 'centroid'].

Variables
  • choices – Allowed choices (list of str).

  • ignore_case – Whether to behave case-insensitive (bool, default: False).

class NEAMTHM18Sampler(**kwargs)[source]

Defines no. of samples drawn from NEAMTHM18

interpolation

str (pyrocko.guts.StringChoice), default: 'nearest'

Defines, if the samples are drawn from the closest point or extraced from an interpolated mixing distribution.

n_samples

int, default: 2000

Number of samples drawn from the TSUMAPS distribution

class SourceInjectionConfig(**kwargs)[source]

Configuration for prior based source injection

time_reference

str (TimeReference), default: 'origin'

Choice, if the given event time is associate with the “origin” or the “centroid” time. That may lead to time corrections depending on the used source model.

nucleation_x

numpy.ndarray (pyrocko.guts_array.Array), optional, default: array([-0.66,  0.  ,  0.66])

Relative origin x-coordinates to be tested.

nucleation_y

numpy.ndarray (pyrocko.guts_array.Array), optional, default: array([0., 0., 0.])

Relative origin y-coordinates to be tested.

tractions

numpy.ndarray (pyrocko.guts_array.Array), optional, default: array([ 500000., 1000000., 2500000., 5000000.])

Set of stress drops to be tested.

asperity

list of pyrocko.guts.Any objects, optional, default: ['total']

Which possible locations shall be tested. Choose and combine out of “total”, “left”, “center” and “right”.

neamthm18_sampler

NEAMTHM18Sampler, default: <siria.si.invert.NEAMTHM18Sampler object at 0x7f8fe34745f0>

Settings, how samples are drawn from the NEAHMTHM18 database.

fault_database

str (pyrocko.guts.StringChoice), optional, default: 'EDSF'

fault_radius_max

float, optional

If set, only orientation data from faults within radius in [m]. Else the radius is derived from scaling relation.

length_factor

float, optional, default: 1.0

Factor to be applied on fault lengths from scaling relation.

width_factor

float, optional, default: 1.0

Factor to be applied on fault widths from scaling relation.

include_dimension_uncertainty

bool, optional, default: False

If True, uncertainties within the scaling relations are applied to lengths and widths.

fmax

float, optional

Maximum wave frequency of interest to be used for source model patch size scaling.

vmin

float, optional, default: 1000.0

Approximative minimum seismic wave speed [m/s] to be used for source model patch size scaling.

correct_event_duration

bool, optional, default: True

If True and event duration is set, the model origin time is defined as event time - (event duration * 0.5).

property nucleation

Nucleation points as 2D array.

Returns

Nucleation points to be injected.

Return type

numpy.ndarray, shape: (N, 2)

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

Extract sources to be injected in Grond.

config

SourceInjectionConfig, default: <siria.si.invert.SourceInjectionConfig object at 0x7f8fe34746b0>

rseed

int, default: 1230

Set rseed for custom random state

get_sources(event, store, grond_config=None, source_type='dynamic', nparallel=1)[source]

Extract source models to be tested for the event location.

Parameters
  • event (pyrocko.model.event.Event) – Event to extract likely source models for. Both location, magnitude and moment tensor information (if available) are used.

  • store (pyrocko.gf.store.Store) – Green’s function store needed for source generation.

  • grond_config (grond.config.Config) – Grond configuration file used to define lateral ranges and others.

  • source_type (optional, str) – If dynamic, pseudo dynamic rupture models are extracted. If point, moment tensor point sources are returned instead. rectangular yields rectangular extended rupture models.

  • nparallel (optional, int) – Number of processes which run in parallel.

Returns

Source models to be injected.

Return type

list of PseudoDynamicRupture or RectangularSource or MTSource

class Inverter(**kwargs)[source]

Inverter base class.

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

Undocumented.

grond_config

grond.config.Config, optional

Grond config

injection_config

SourceInjectionConfig, optional

Source injector config

problem_name

str, optional

event_id

str, optional

Event id

base_path

str (grond.meta.Path), default: '.'

report_path

str (grond.meta.Path), optional

store_id

str, optional

Store id to be used to generate the injected sources. If not given, the store of the first target group is used.

threads

int, optional, default: 1

Number of maximum threads used.

parallel

int, optional, default: 1

Number of maximum processes running in parallel (for source generation)

property store

Pyrocko Green’s Function store.

Returns

Green’s function store.

Return type

pyrocko.gf.store.Store

property event

Pyrocko event.

Returns

Event.

Return type

pyrocko.model.event.Event

property reportconf_path

Path to the Grond report configuration file.

Returns

Path to Grond report configuration file.

Return type

str

property sources_inject

Injected models from siria.si.invert.SourceInjector.

Returns

Sources to be injected within the run.

Return type

list of pyrocko.gf.seismosizer.Source

property fn_sources_inject

Path to the Grond source injection file.

Returns

Path to Grond source injection file.

Return type

str

sources_to_injector_config()[source]

Update Grond InjectionConfig for injected sources.

save_sources_inject()[source]

Save inject sources in file.

generate_reportconf()[source]

Generate and save Grond report config file.

run(force=False)[source]

Run Grond optimization.

Parameters

force (bool) – If True, possible existing older runs are overwritten

report()[source]

Generate Grond report for run for easier result validation.

dump_siria_sources(result_dir)[source]

Read and converts results from grond run directory to SiriaSources.

dump_best_event(result_dir, fn)[source]

Read Grond results and stores best event in event file for later use.

run_full(create_report=True, result_dir='', best_mt_fn='', dump_result_as_sources=False, *args, **kwargs)[source]

Run full optimization loop.

Different steps as source injection, report config generation, the Grond run and reporting (if wished) are performed. Arguments and keyword arguments for siria.si.invert.GrondInverter.run() can be given.

Parameters
  • create_report (optional, bool) – If True, a Grond report is created after completing the run.

  • result_dir (optional, str) – Problem result directory.

Param

dump_result_as_sources: If True, all tested sources are dumped as yaml file within the result directory.

Type

dump_result_as_sources: optional, bool