pyrocko.scenario.scenario

Implementation of the scenario generator’s main class.

Classes

ScenarioGenerator(**kwargs)

Generator for synthetic seismo-geodetic scenarios.

class ScenarioGenerator(**kwargs)[source]

Bases: 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: DCSourceGenerator()

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:

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:
Returns:

Scenario

Return type:

pyrocko.scenario.scenario.ScenarioGenerator