Coverage for /usr/local/lib/python3.11/dist-packages/pyrocko/scenario/targets/base.py: 88%
26 statements
« prev ^ index » next coverage.py v6.5.0, created at 2023-10-04 09:52 +0000
« prev ^ index » next coverage.py v6.5.0, created at 2023-10-04 09:52 +0000
1# http://pyrocko.org - GPLv3
2#
3# The Pyrocko Developers, 21st Century
4# ---|P------/S----------~Lg----------
6'''
7Base class for target generators.
8'''
10import numpy as num
11from pyrocko import util
12from pyrocko.scenario.base import Generator
15class TargetGenerator(Generator):
16 '''
17 Base class for observational target generators.
18 '''
20 def get_time_range(self, sources):
21 '''
22 Get the target's time range.
24 In the easiest case this is the sources' time range, yet for waveform
25 targets we have to consider vmin, vmax
26 '''
27 times = num.array([source.time for source in sources],
28 dtype=util.get_time_dtype())
30 return num.min(times), num.max(times)
32 def get_targets(self):
33 '''
34 Returns a list of targets, used class-internally to forward model.
35 '''
36 return []
38 def get_stations(self):
39 return []
41 def get_onsets(self, engine, sources, tmin=None, tmax=None):
42 return []
44 def get_waveforms(self, engine, sources, tmin=None, tmax=None):
45 return []
47 def get_insar_scenes(self, engine, sources, tmin=None, tmax=None):
48 return []
50 def get_gnss_campaigns(self, engine, sources, tmin=None, tmax=None):
51 return []
53 def ensure_data(self, engine, sources, path, tmin=None, tmax=None):
54 pass
56 def add_map_artists(self, engine, sources, automap):
57 pass
60class NoiseGenerator(Generator):
61 '''
62 Base class for random noise generators.
63 '''
64 pass