RectangularPatchesKin class¶
- class csi.RectangularPatchesKin(name, utmzone=None, ellps='WGS84', lon0=None, lat0=None, verbose=True)¶
A class that can handle what is required for a kinematic inversion with AlTar for a fault with rectangular patches.
- Args:
name : Name of the fault.
- Kwargs:
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’)
verbose : Speak to me (default=True)
- buildBigCd(seismic_data)¶
Assemble Cd from multiple kinematic datasets
- Args:
seismic_data : Data to take care of
- Returns:
None
- buildBigGD(eik_solver, seismic_data, rakes, vmax, Nt, Dt, rakes_key=None, dtype='np.float64', fastsweep=False, indexing='Altar')¶
Build BigG and bigD matrices from Green’s functions and data dictionaries
- Args:
eik_solver: Eikonal solver (e.g., FastSweep or None)
data: Seismic data object or list of objects
rakes: List of rake angles
vmax: Maximum rupture velocity
Nt: Number of rupture time-steps
Dt: Rupture time-steps
- Kwargs:
rakes_key: If GFs are stored under different keywords than rake value, provide them here
fastsweep: If True and vmax is set, solves min arrival time using fastsweep algo. If false, uses analytical solution.
- Returns:
tmin: Array of ???
- buildKK(data, rakes=[0.0, 90.0], Mu=None, slip=1.0, coord0=None, causal=False, filter=True)¶
Build Kikuchi-Kanamori Green’s functions
- Args:
data: teleseismic data object
- Kwargs:
rake: Rake angles (default [0.,90.])
Mu: Shear modulus (optional)
slip: Slip amplitude for tsunami GF calculation (default: 1. m)
coord0: lon,lat,dep of reference point to shift GFs (optional)
causal: if True impose causality of the source (no slip before time=0.)
filter: if True, filter the Green’s functions (according to i_master parameters in the KK run directory)
- Returns:
None
- buildKinGFsFromDB(data, wave_engine, slip, rakes, rake_key=None, Mu=None, filter_coef=None, differentiate=False)¶
Build Kinematic Green’s functions based on the discretized fault and a pre-calculated GF database. 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
wave_engine : waveform generator
slip : slip amplitude (in m)
- Kwargs:
rakes : rake angle (in deg). Can be a scalar or an array of len(self.patch)
rake_key : By default, GFs are stored in a dictionnarry
Mu : Shear modulus (optional)
filter_coef : Array or dictionnary of second-order filter coefficients (optional), see scipy.signal.sosfilt
- Returns:
None
- buildSubGrid(nbp_strike, nbp_dip)¶
Define a subgrid of point sources on the fault (multiple point src per patches) All patches must have the same size
- Args:
p_nstrike: Number of subgrid points per patch along strike
p_ndip: Number of subgrid points per patch along dip
- Returns:
None
- castbigM(n_ramp_param, eik_solver, npt=4, Dtriangles=1.0, grid_space=1.0)¶
Cast kinematic model into bigM for forward modeling using bigG (model should be specified in slip, tr and vr attributes, hypocenter must be specified)
- Args:
n_ramp_param : number of nuisance parameters (e.g., InSAR orbits)
eik_solver : eikonal solver
- Kwargs:
npt**2 : numper of point sources per patch
Dtriangles : ??
grid_space : ??
- Returns:
bigM matrix
- getHypoToCenter(p, ds_dist=False)¶
Get patch center coordinates from hypocenter
- Args:
p : Patch number.
- Kwargs:
ds_dist: If true, will return along dip (first) and along strike distances
- Returns:
Hypocenter coordinates
- initializekinmodel(n=None)¶
Re-initializes the fault slip array to zero values.
- Kwargs:
n : Number of slip values. If None, it’ll take the number of patches.
- Returns:
None
- loadBigGD(bigDfile='data.kin', bigGfile='gf.kin', dtype='np.float64')¶
Load bigG and bigD to binary file
- Kwargs:
bigDfile : bigD filename (optional)
bigGfile : bigG gilename (optional)
dtype : data binary type
- loadKinGF(data, rakes, inputDir='GFs', prefix='gf')¶
Load kinematic Green’s functions in i_path
- Args:
data : seismic data object
rakes : list of rake angle
- Kwargs:
inputDir : input directory where GFs are stored
prefix : GFs files prefix
- Returns:
None
- read3DsquareGrid(filename)¶
This routine read the square fault geometry
- Format:
lon
lat
E[km]
N[km]
Dep[km]
strike
dip
Area
ID
- Args:
filename : name of output file
- Returns:
None
- saveBigCd(bigCdfile='kinematicG.Cd', dtype='np.float64')¶
Save bigCd matrix
- Kwargs:
bigCdfile : Output filename
dtype : binary type for output
- Returns:
None
- saveBigGD(bigDfile='kinematicG.data', bigGfile='kinematicG.gf', dtype='np.float64')¶
Save bigG and bigD to binary file
- Kwargs:
bigDfile : bigD filename (optional)
bigGfile : bigG gilename (optional)
dtype : Data binary type
- Returns:
None
- saveKinGF(data, outputDir='GFs', prefix='gf', rmdir=True)¶
Save kinematic Green’s functions in outputDir
- Args:
data : seismic data object
- Kwargs:
outputDir : output directory where GFs will be stored
prefix : Prefix for GFs files
rmdir : CLeanup?
- Returns:
None
- setBigDmap(seismic_data)¶
Assign data_idx map for kinematic data
- Args:
seismic_data : Data to take care of
- Returns:
None
- setFaultMap(Nstrike, Ndip, leading='strike', check_depth=True)¶
Set along dip and along strike indexing for patches
- Args:
Nstrike : number of patches along strike
Ndip : number of patches along dip
- Kwargs:
leading : leadinf index of self.patch (can be ‘strike’ or ‘dip’)
check_depth : CHeck patch depths and indexes are consistent
- Returns:
None
- setHypoOnFault(h_strike, h_dip)¶
Set hypocenter attributes from fault coordinates
- Args:
h_strike: Along strike distance from the center of the top left patch
h_dip: Along dip distance from the center of the top left patch
- Returns:
None
- setHypoXY(x, y, UTM=True)¶
Set hypocenter attributes from x,y
East/West UTM/Lon coordinates, depth attributes are set
- Args:
x : east coordinates
y : north coordinates
UTM : Set true is x and y are in km, false if x and y are in degrees
- Returns:
None
- setMu(model_file, modelformat='CPS')¶
Set shear modulus values for seismic moment calculation from model_file:
if format = ‘CPS’
Thickness, Vp, Vs, Rho
if format = ‘KK’
file from Kikuchi Kanamori
- Args:
model_file : Input file
- Kwargs:
modelformat : Format of the model file
- Returns:
None
- setMuLambdaRho(model_file)¶
Set shear modulus values for seismic moment calculation from model_file: Thickness Vp Vs Rho (…)
- Args:
model_file : Input file name
- Retunrs:
None