dippingfault class¶
- class csi.dippingfault(name, utmzone=None, ellps='WGS84', verbose=True, lon0=None, lat0=None)¶
- BuildPatchesVarResolution(depths, Depthpoints, Resolpoints, interpolation='linear', minpatchsize=0.1, extrap=None)¶
Patchizes the fault with a variable patch size at depth. The variable patch size is given by the respoints table. Depthpoints = [depth1, depth2, depth3, …., depthN] Resolpoints = [Resol1, Resol2, Resol3, …., ResolN] The final resolution is interpolated given the ‘interpolation’ method. Interpolation can be ‘linear’, ‘cubic’.
- ExtractAlongStrikeVariations(depth=0.5, origin=None, filename='alongstrike.dat', orientation=0.0)¶
Extract the Along Strike Variations of the creep at a given depth Args:
depth : Depth at which we extract the along strike variations of slip. origin : Computes a distance from origin. Give [lon, lat]. filename: Saves to a file. orientation: defines the direction of positive distances.
- addfaults(filename)¶
Add some other faults to plot with the modeled one.
- Args:
filename : Name of the fault file (GMT lon lat format).
- addpatch(patch, slip=[0, 0, 0])¶
Adds a patch to the list. Args:
patch : Geometry of the patch to add
slip : List of the strike, dip and tensile slip.
- assembleCd(datas, add_prediction=None)¶
Assembles the data covariance matrixes that have been built by each data structure. add_prediction: Precentage of displacement to add to the Cd diagonal to simulate a Cp (prediction error).
- assembleGFs(datas, polys=0, slipdir='sd')¶
Assemble the Green’s functions that have been built using build GFs. This routine spits out the General G and the corresponding data vector d. Args:
datas : data sets to use as inputs (from gps and insar).
- polys0 -> nothing additional is estimated
1 -> estimate a constant offset 3 -> estimate z = ax + by + c 4 -> estimate z = axy + bx + cy + d ‘full’ -> Only for GPS, estimates a rotation, translation and scaling with
respect to the center of the network (Helmert transform).
slipdir : which directions of slip to include. can be any combination of s, d and t.
- assembled(datas)¶
Assembles the data vector corresponding to the stored green’s functions. Args:
datas : list of the data object involved (from gps and insar).
- associatePatch2PDFs(directory='.', prefix='step_001_param')¶
Associates a patch with a pdf called directory/prefix_{#}.dat. import AltarExplore….
- buildCm(sigma, lam, lam0=None, extra_params=None, lim=None)¶
Builds a model covariance matrix using the equation described in Radiguet et al 2010. Args:
sigma : Amplitude of the correlation.
lam : Characteristic length scale.
lam0 : Normalizing distance (if None, lam0=min(distance between patches)).
extra_params : Add some extra values on the diagonal.
lim : Limit distance parameter (see self.distancePatchToPatch)
- buildCmGaussian(sigma, extra_params=None)¶
Builds a diagonal Cm with sigma values on the diagonal. sigma is a list of numbers, as long as you have components of slip (1, 2 or 3). extra_params is a list of extra parameters.
- buildGFs(data, vertical=True, slipdir='sd')¶
Builds the Green’s function matrix based on the discretized fault. Args:
data : data object from gps or insar.
vertical : if True, will produce green’s functions for the vertical displacements in a gps object.
slipdir : direction of the slip along the patches. can be any combination of s (strikeslip), d (dipslip) and t (tensile).
The Green’s function matrix is stored in a dictionary. Each entry of the dictionary is named after the corresponding dataset. Each of these entry is a dictionary that contains ‘strikeslip’, ‘dipslip’ and/or ‘tensile’.
- build_patches()¶
Builds rectangular patches from the discretized fault. A patch is a list of 4 corners.
- computeSlipDirection(scale=1.0, factor=1.0)¶
Computes the segment indicating the slip direction. scale can be a real number or a string in ‘total’, ‘strikeslip’, ‘dipslip’ or ‘tensile’
- computetotalslip()¶
Computes the total slip.
- deletepatch(patch)¶
Deletes a patch. Args:
patch : index of the patch to remove.
- deletepatches(tutu)¶
Deletes a list of patches.
- differentiateGFs(datas)¶
Uses the Delaunay triangulation to prepare a differential Green’s function matrix, data vector and data covariance matrix. Args:
datas : List of dataset concerned
- discretize(every=2, tol=0.5, fracstep=0.2)¶
Refine the surface fault trace prior to divide it into patches. Args:
every : Spacing between each point.
tol : Tolerance in the spacing.
- distancePatchToPatch(patch1, patch2, distance='center', lim=None)¶
Measures the distance between two patches. Args:
patch1 : geometry of the first patch.
patch2 : geometry of the second patch.
- distancedistance estimation mode
center : distance between the centers of the patches. no other method is implemented for now.
lim : if not None, list of two float, the first one is the distance above which d=lim[1].
- duplicateFault()¶
Returns a copy of the fault.
- extrap1d(interpolator)¶
Linear extrapolation routine. Found on StackOverflow by sastanin.
- extrapolate(length_added=50, tol=2.0, fracstep=5.0, extrap='ud')¶
Extrapolates the surface trace. This is usefull when building deep patches for interseismic loading. Args:
length_added : Length to add when extrapolating.
tol : Tolerance to find the good length.
fracstep : control each jump size.
- extrapif u in extrap -> extrapolates at the end
if d in extrap -> extrapolates at the beginning default is ‘ud’
- file2trace(filename)¶
Reads the fault trace directly from a file. Format is: Lon Lat
- Args:
filename : Name of the fault file.
- get2DstrainEst(data)¶
Returns the matrix to estimate the full 2d strain tensor.
- getHelmertMatrix(data)¶
Returns a Helmert matrix for a gps data set.
- getcenter(p)¶
Get the center of one patch. Args:
p : Patch geometry.
- getcenters()¶
Get the center of the patches.
- getpatchgeometry(patch, center=False)¶
Returns the patch geometry as needed for okada85. Args:
patch : index of the wanted patch or patch;
center : if true, returns the coordinates of the center of the patch. if False, returns the UL corner.
- getslip(p)¶
Returns the slip vector for a patch.
- importPatches(filename, origin=[45.0, 45.0])¶
Builds a patch geometry and the corresponding files from a relax co-seismic file type. Args:
filename : Input from Relax (See Barbot and Cie on the CIG website). origin : Origin of the reference frame used by relax. [lon, lat]
- initializeslip(n=None)¶
Re-initializes the fault slip array. Args:
n : Number of slip values. If None, it’ll take the number of patches.
- ll2xy(lon, lat)¶
Do the lat lon 2 utm transform
- mergePatches(p1, p2)¶
Merges 2 patches that have common corners. Args:
p1 : index of the patch #1.
p2 : index of the patch #2.
- plot(ref='utm', figure=134, add=False, maxdepth=None, axis='equal', value_to_plot='total')¶
Plot the available elements of the fault.
- Args:
ref : Referential for the plot (‘utm’ or ‘lonlat’).
figure : Number of the figure.
- readPatchesFromFile(filename)¶
Read the patches from a GMT formatted file. Args:
filename : Name of the file.
- rotationHoriz(center, angle)¶
Rotates the geometry of the fault around center, of an angle. Args:
center : [lon,lat]
angle : degrees
- saveGFs(dtype='d')¶
Saves the Green’s functions in different files Args:
dtype : Format of the binary data saved.
- setGFs(data, strikeslip=[None, None, None], dipslip=[None, None, None], tensile=[None, None, None], vertical=False)¶
Stores the Green’s functions matrices into the fault structure. Args:
data : Data structure from gps or insar.
strikeslip : List of matrices of the Strikeslip Green’s functions, ordered E, N, U
dipslip : List of matrices of the dipslip Green’s functions, ordered E, N, U
tensile : List of matrices of the tensile Green’s functions, ordered E, N, U
If you provide InSAR GFs, these need to be projected onto the LOS direction already.
- setGFsFromFile(data, strikeslip=None, dipslip=None, tensile=None, vertical=False, dtype='d')¶
Sets the Green’s functions from binary files. Be carefull, these have to be in the good format (i.e. if it is GPS, then GF are E, then N, then U, optional, and if insar, GF are projected already) Args:
data : Data structure from gps or insar.
strikeslip : File containing the Green’s functions for strikeslip displacements.
dipslip : File containing the Green’s functions for dipslip displacements.
tensile : File containing the Green’s functions for tensile displacements.
vertical : Deal with the UP component (gps: default is false, insar, it will be true anyway).
dtype : Type of binary data.
- setdepth(depth, top=0, num=5)¶
Set the maximum depth of the fault patches.
- Args:
depth : Depth of the fault patches.
num : Number of fault patches at depth.
- slip2dis(data, patch, slip=None)¶
Computes the surface displacement at the data location using okada.
- Args:
data : data object from gps or insar.
patch : number of the patch that slips
- slipif a number is given, that is the amount of slip along strike
if three numbers are given, that is the amount of slip along strike, along dip and opening if None, values from slip are taken
- surfacesimulation(box=None, disk=None, err=None, npoints=None, lonlat=None)¶
Takes the slip vector and computes the surface displacement that corresponds on a regular grid. Args:
box : Can be a list of [minlon, maxlon, minlat, maxlat].
disk : list of [xcenter, ycenter, radius, n]
lonlat : Arrays of lat and lon. [lon, lat]
- trace(Lon, Lat)¶
Set the surface fault trace.
- Args:
Lon : Array/List containing the Lon points.
Lat : Array/List containing the Lat points.
- trace2xy()¶
Transpose the surface trace of the fault into the UTM reference.
- translationHoriz(dx, dy)¶
Translates the patches. Args:
dx : Translation along x (km)
dy : Translation along y (km)
- utmzone(utmzone)¶
Set the utm zone of the fault.
- Args:
utm : UTM zone of the fault.
- writeEDKSgeometry(ref=None)¶
This routine spits out 2 files: filename.lonlatdepth: Lon center | Lat Center | Depth Center (km) | Strike | Dip | Length (km) | Width (km) | patch ID filename.END: Easting (km) | Northing (km) | Depth Center (km) | Strike | Dip | Length (km) | Width (km) | patch ID
These files are to be used with /home/geomod/dev/edks/MPI_EDKS/calcGreenFunctions_EDKS_subRectangles.py
- Args:
ref : Lon and Lat of the reference point. If None, the patches positions is in the UTM coordinates.
- writeEDKSsubParams(data, edksfilename, amax=None, plot=False)¶
Write the subParam file needed for the interpolation of the green’s function in EDKS. Francisco’s program cuts the patches into small patches, interpolates the kernels to get the GFs at each point source, then averages the GFs on the pacth. To decide the size of the minimum patch, it uses St Vernant’s principle. If amax is specified, the minimum size is fixed. Args:
data : Data object from gps or insar.
edksfilename : Name of the file containing the kernels.
amax : Specifies the minimum size of the divided patch. If None, uses St Vernant’s principle.
plot : Activates plotting.
- Returns:
filename : Name of the subParams file created.
- writePatches2File(filename, add_slip=None, scale=1.0)¶
Writes the patch corners in a file that can be used in psxyz. Args:
filename : Name of the file.
add_slip : Put the slip as a value for the color. Can be None, strikeslip, dipslip, total.
scale : Multiply the slip value by a factor.
- writeSlipDirection2File(filename, scale=1.0, factor=1.0, neg_depth=False)¶
Write a psxyz compatible file to draw lines starting from the center of each patch, indicating the direction of slip. Tensile slip is not used… scale can be a real number or a string in ‘total’, ‘strikeslip’, ‘dipslip’ or ‘tensile’
- xy2ll(x, y)¶
Do the utm to lat lon transform