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-06 15:01 +0000

1# http://pyrocko.org - GPLv3 

2# 

3# The Pyrocko Developers, 21st Century 

4# ---|P------/S----------~Lg---------- 

5 

6''' 

7Base class for target generators. 

8''' 

9 

10import numpy as num 

11from pyrocko import util 

12from pyrocko.scenario.base import Generator 

13 

14 

15class TargetGenerator(Generator): 

16 ''' 

17 Base class for observational target generators. 

18 ''' 

19 

20 def get_time_range(self, sources): 

21 ''' 

22 Get the target's time range. 

23 

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()) 

29 

30 return num.min(times), num.max(times) 

31 

32 def get_targets(self): 

33 ''' 

34 Returns a list of targets, used class-internally to forward model. 

35 ''' 

36 return [] 

37 

38 def get_stations(self): 

39 return [] 

40 

41 def get_onsets(self, engine, sources, tmin=None, tmax=None): 

42 return [] 

43 

44 def get_waveforms(self, engine, sources, tmin=None, tmax=None): 

45 return [] 

46 

47 def get_insar_scenes(self, engine, sources, tmin=None, tmax=None): 

48 return [] 

49 

50 def get_gnss_campaigns(self, engine, sources, tmin=None, tmax=None): 

51 return [] 

52 

53 def ensure_data(self, engine, sources, path, tmin=None, tmax=None): 

54 pass 

55 

56 def add_map_artists(self, engine, sources, automap): 

57 pass 

58 

59 

60class NoiseGenerator(Generator): 

61 ''' 

62 Base class for random noise generators. 

63 ''' 

64 pass