1# http://pyrocko.org - GPLv3
2#
3# The Pyrocko Developers, 21st Century
4# ---|P------/S----------~Lg----------
5from __future__ import absolute_import, division, print_function
7import numpy as num
8from pyrocko import util
9from ..base import Generator
12class TargetGenerator(Generator):
14 def get_time_range(self, sources):
15 '''
16 Get the target's time range.
18 In the easiest case this is the sources' time range, yet for waveform
19 targets we have to consider vmin, vmax
20 '''
21 times = num.array([source.time for source in sources],
22 dtype=util.get_time_dtype())
24 return num.min(times), num.max(times)
26 def get_targets(self):
27 '''
28 Returns a list of targets, used class-internally to forward model.
29 '''
30 return []
32 def get_stations(self):
33 return []
35 def get_onsets(self, engine, sources, tmin=None, tmax=None):
36 return []
38 def get_waveforms(self, engine, sources, tmin=None, tmax=None):
39 return []
41 def get_insar_scenes(self, engine, sources, tmin=None, tmax=None):
42 return []
44 def get_gnss_campaigns(self, engine, sources, tmin=None, tmax=None):
45 return []
47 def ensure_data(self, engine, sources, path, tmin=None, tmax=None):
48 pass
50 def add_map_artists(self, engine, sources, automap):
51 pass
54class NoiseGenerator(Generator):
55 pass