scenario

The ScenarioGenerator (scenario.ScenarioGenerator)

This module bundles the TargetGenerators together. Available Scenario Target Generators

class ScenarioGenerator(**kwargs)[source]

Bases: pyrocko.scenario.base.LocationGenerator

Generator for synthetic seismo-geodetic scenarios.

target_generators

list of pyrocko.scenario.targets.base.TargetGenerator objects, default: []

Targets to spawn in the scenario.

source_generator

pyrocko.scenario.sources.base.SourceGenerator, default: <pyrocko.scenario.sources.dcsource.DCSourceGenerator object at 0x7fb36635cf60>

Sources to spawn in the scenario.

dump_data(path, overwrite=False)[source]

Invoke generators and dump the complete scenario.

Parameters:
  • path (str) – Output directory
  • overwrite (bool) – If True remove all previously generated files and recreating the scenario content. If False stop if previously generated content is found.

Wrapper to call prepare_data() followed by ensure_data() with default arguments.

prepare_data(path, overwrite)[source]

Prepare directory for scenario content storage.

Parameters:
  • path (str) – Output directory
  • overwrite (bool) – If True, remove all previously generated files and recreate the scenario content. If False, stop if previously generated content is found.
ensure_data(path, tmin=None, tmax=None)[source]

Generate and output scenario content to files, as needed.

Parameters:
  • path (str) – Output directory
  • tmin (timestamp, optional) – Start of time interval to generate
  • tmax (timestamp, optional) – End of time interval to generate

This method only generates the files which are relevant for the given time interval, and which have not yet been generated. It is safe to call this method several times, for different time windows, as needed.

If no time interval is given, the origin times of the generated sources and signal propagation times are taken into account to estimate a reasonable default.

classmethod initialize(path, center_lat=None, center_lon=None, radius=None, targets=[<class 'pyrocko.scenario.targets.waveform.WaveformGenerator'>, <class 'pyrocko.scenario.targets.insar.InSARGenerator'>, <class 'pyrocko.scenario.targets.gnss_campaign.GNSSCampaignGenerator'>], stationxml=None, force=False)[source]

Initialize a Scenario and create a scenario.yml

Parameters:
  • path (str) – Path to create the scenerio in
  • center_lat (float, optional) – Center latitude [deg]
  • center_lon (float, optional) – Center longitude [deg]
  • radius (float, optional) – Scenario’s radius in [m]
  • targets (list of pyrocko.scenario.TargetGenerator objects, optional) – Targets to throw into scenario, defaults to AVAILABLE_TARGETS
  • force (bool) – If set to True, overwrite directory
  • stationxml (str) – path to a StationXML to be used by the pyrocko.scenario.targets.WaveformGenerator.
Returns:

Scenario

Return type:

pyrocko.scenario.ScenarioGenerator

The ScenarioCollection (scenario.ScenarioCollection)

A collection acts like an archive for a pyrocko.scenario.ScenarioGenerator

class ScenarioCollectionItem(**kwargs)[source]

Bases: pyrocko.guts.Object

Undocumented.

scenario_id

builtins.str (pyrocko.gf.meta.StringID)

time_created

fixme!