planarfaultkinematic class¶
- class csi.planarfaultkinematic(name, utmzone=None, ellps='WGS84', lon0=None, lat0=None)¶
- buildFault(lon, lat, dep, f_strike, f_dip, f_length, f_width, grid_size, p_nstrike, p_ndip)¶
Build fault patches/grid Args:
lat,lon,dep: coordinates at the center of the top edge of the fault (in degrees)
strike: strike angle in degrees (from North)
dip: dip angle in degrees (from horizontal)
f_length: Fault length, km
f_width: Fault width, km
grid_size: Spacing between point sources within each patch
p_nstrike: Number of subgrid points per patch along strike (multiple pts src per patch)
p_ndip: Number of subgrid points per patch along dip (multiple pts src per patch)
- buildKinDataTriangleMRF(data, eik_solver, Mu, rake_para=0.0, out_type='D', verbose=True, ofd=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, efd=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>)¶
Build Kinematic Green’s functions based on the discretized fault. Green’s functions will be calculated for a given shear modulus and a given slip (cf., slip) along a given rake angle (cf., rake) Args:
data: Seismic data object
eik_solver: eikonal solver
Mu: Shear modulus
rake_para: Rake of the slip parallel component in deg (default=0. deg)
out_type: ‘D’ for displacement, ‘V’ for velocity, ‘A’ for acceleration (default=’D’)
verbose: True or False (default=True)
WARNING: ONLY VALID FOR HOMOGENEOUS RUPTURE VELOCITY
- buildKinGFs(data, Mu, rake, slip=1.0, rise_time=2.0, stf_type='triangle', rfile_name=None, out_type='D', verbose=True, ofd=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, efd=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>)¶
Build Kinematic Green’s functions based on the discretized fault. Green’s functions will be calculated for a given shear modulus and a given slip (cf., slip) along a given rake angle (cf., rake) Args:
data: Seismic data object
Mu: Shear modulus
rake: Rake used to compute Green’s functions
slip: Slip amplitude used to compute Green’s functions (in m)
rise_time: Duration of the STF in each patch
stf_type: Type of STF pulse
rfile_name: User specified stf file name if stf_type=’rfile’
out_type: ‘D’ for displacement, ‘V’ for velocity, ‘A’ for acceleration
verbose: True or False
- buildSubGrid(grid_size, nbp_strike, nbp_dip)¶
Define a subgrid of point sources on the fault (multiple point src per patches) Args:
grid_size: Spacing between point sources within each patch
p_nstrike: Number of subgrid points per patch along strike
p_ndip: Number of subgrid points per patch along dip
- creaWav(data, include_G=True, include_d=True)¶
Create a list of Waveform dictionaries Args:
data: Data object
include_G: if True, include G (default=True)
include_d: if True, include d (default=True)
- filter(data, a, b, filtFunc, mean_npts=None, filter_G=True, filter_d=True)¶
Waveform filtering Args:
data: Data object
a: numerator polynomial of the IIR filter
b: denominator polynomial of the IIR filter
filtFunc: filter function
mean_npts: remove mean over the leading mean_npts points (default=None)
filter_G: if True, filter G (default=True)
filter_d: if True, filter d (default=True)
- getHypoToCenter(p, sd_dist=False)¶
Get patch center coordinates from hypocenter Args:
p : Patch number.
sd_dist: If true, will return along dip and along strike distances
- loadKinData(data, i_dir='data_kin', station_file=None)¶
Read Data (1 sac file per channel) Args:
data : Data object corresponding to the Green’s function to be loaded i_dir : Input directory station_file: read station list from ‘station_file’
- loadKinGFs(data, rake=[0, 90], i_dir='gf_kin', station_file=None)¶
Reading Green’s functions (1 sac file per channel per patch for each rake) Args:
data : Data object corresponding to the Green’s function to be loaded rake : List of rake values (default=0 and 90 deg) i_dir : Output directory name (default=’gf_kin’) station_file: read station list from ‘station_file’
- saveKinData(data, o_dir='data_kin')¶
Write Data (1 sac file per channel) Args:
data : Data object corresponding to the Green’s function to be saved o_dir : Output file name
- saveKinGFs(data, o_dir='gf_kin')¶
Writing Green’s functions (1 sac file per channel per patch for each rake) Args:
data : Data object corresponding to the Green’s function to be saved o_dir : Output directory name
- setHypoXY(x, y, UTM=True)¶
Set hypocenter attributes from x,y Outputs: East/West UTM/Lon coordinates, depth attributes Args:
x: east coordinates
y: north coordinates
- UTM: default=True, x and y is in UTM coordinates (in km)
if ==False x=lon and y=lat (in deg)
- trim(data, mint, maxt, trim_G=True, trim_d=True)¶
Waveform windowing Args:
data: Data object
mint: Minimum time
maxt: Maximum time
trim_G: if True, trim G (default=True)
trim_d: if True, trim d (default=True)