tsunami class¶
- class csi.tsunami(name, dtype='tsunami', utmzone=None, ellps='WGS84', lon0=None, lat0=None)¶
 A class that handles tsunami data.
- Args:
 name : Name of the dataset.
- Kwargs:
 dtype : data type
utmzone : UTM zone (optional, default=None)
lon0 : Longitude of the center of the UTM zone
lat0 : Latitude of the center of the UTM zone
ellps : ellipsoid (optional, default=’WGS84’)
- buildsynth(faults, direction='sd', poly=None)¶
 Takes the slip model in each of the faults and builds the synthetic displacement using the Green’s functions.
- Args:
 faults : list of faults to include.
- Kwargs:
 direction : list of directions to use. Can be any combination of ‘s’, ‘d’ and ‘t’.
poly : if True, add an offseta in the data
- Returns:
 None. Synthetics are stored in the synth attribute
- getGF(filename, fault, factor=1.0)¶
 Read GF from file filename.gf
- Args:
 filename : prefix of the file filename.gf
- Kwargs:
 factor: scaling factor
- Returns:
 2d arrays: returns GF_SS and GF_DS
- getRampEstimator(order)¶
 Returns the Estimator of a constant offset in the data
- Args:
 order : 1, estimate just a vertical shift in the data and ,2, estimate a ramp in the data. Order given as argument is in reality order*number_of_station
- Returns:
 a 2d array
- plot(nobs_per_trace, plot_synth=False, alpha=1.0, figsize=(13, 10), left=0.07, bottom=0.1, right=0.99, top=0.9, wspace=0.31, hspace=0.47, scale=100.0, ylim=None, yticks=None)¶
 Plot tsunami traces
- Note:
 We need a description of the options here…
- readFromTxtFile(filename, factor=1.0, fileinfo=None)¶
 Read d, Cd from files filename.data filename.Cd
- Args:
 filename : prefix of the filenames filename.d and filename.Cd
- Kwargs:
 factor : scaling factor
fileinfo : Information about the data (lon, lat and origintime)
- Returns:
 None
- setGFsInFault(fault, G, vertical=False)¶
 From a dictionary of Green’s functions, sets these correctly into the fault object fault for future computation.
- Args:
 fault : Instance of Fault
G : Dictionary with 3 entries ‘strikeslip’, ‘dipslip’ and ‘tensile’. These can be a matrix or None.
- Kwargs:
 vertical : Set here for consistency with other data objects, but will always be set to False, whatever you do.
- Returns:
 None
- write2file(namefile, data='synth')¶
 Write to a text file
- Args:
 namefile : Name of the output file
- Kwargs:
 data : can be data or synth
- Returns:
 None