faultpostproctents class¶
- class csi.faultpostproctents(name, fault, Mu=24000000000.0, samplesh5=None, verbose=False, npoints=20)¶
- Aki2Harvard()¶
Transform the patch from the Aki convention to the Harvard convention.
- checkSymmetric(M)¶
Check if a matrix is symmetric.
- computeBetaMagnitude()¶
Computes the magnitude with a simple approximation.
- computeCentroidLonLatDepth(plotOutput=None, xyzOutput=None)¶
Computes the equivalent centroid location. Take from Theoretical Global Seismology, Dahlen & Tromp. Chapter 5. Section 4. pp. 169
- computeMagnitude(plotHist=None, outputSamp=None)¶
Computes the moment magnitude.
- computeMomentAngularDifference(Mout, form='harvard')¶
- Computes the difference in angle between the moment Mout and the moment.
- Args:
- Mout: full moment in harvard convention (if form==’aki’, moment will be
transfered to harvard convention).
- computeMomentTensor()¶
Computes the full seismic (0-order) moment tensor from the slip distribution.
- computePotencies()¶
Computes the potency of each subSources.
- computeScalarMoment()¶
Computes the scalar seismic moment.
- computeSourcesMoments()¶
Computes the Moment tensors for all subsources.
- getRectangular3Dfault()¶
Returns a 3D rectangular fault object with rectangle corresponding to the subsources computed with EDKSmp.dropSourcesInPatches Useful for stress computation
- h5_finalize()¶
Close the (potentially) open h5 file.
- h5_init(decim=1, indss=None, indds=None)¶
If the attribute self.samplesh5 is not None, we open the h5 file specified by self.samplesh5 and copy the slip values to self.fault.slip (hopefully without loading into memory).
- kwargs:
decim decimation factor for skipping samples indss : tuples (size (2,)) containing desired indices of strike slip in h5File indds : tuples (size (2,)) containing desired indices of dip slip in h5File
- integrateQuantityAlongProfile(lonc, latc, length, azimuth, width, numXBins=100, fault=None, quantity='potency', getDepth=False, method='sum')¶
Computes the cumulative potency as a function of distance to the profile origin. If the potencies were computed with multiple samples (in case of Bayesian exploration), we form histograms of potency vs. distance. Otherwise, we just compute a distance profile.
- Args:
lonc, latc : Lon and Lat of the center of the profile length : Length of the profile (km) azimuth : Azimuth of the profile (degrees) width : Width of the profile (km) numXBins : number of bins to group patches along the profile fault : If provided, the profile will be referenced at the intersection with teh fault trace. quantity : Which quantity do we deal with. Can be:
‘potency’ ‘moment’ ‘strikeslip’ ‘dipslip’ ‘tensile’
method : Can be ‘sum’, ‘mean’, ‘median’, ‘min’ or ‘max’
- integrateQuantityWithDepth(plotOutput=None, numDepthBins=5, outputSamp=None, quantity='potency', method='sum')¶
Computes the cumulative moment with depth by summing the moment per row of patches. If the moments were computed with mutiple samples, we form histograms of potency vs. depth. Otherwise, we just compute a depth profile.
- kwargs:
plotOutput output directory for figures numDepthBins number of bins to group patch depths quantity : Which quantity do we deal with. Can be:
‘potency’ ‘moment’ ‘strikeslip’ ‘dipslip’ ‘tensile’
method : Can be ‘sum’, ‘mean’, ‘median’
- ll2xy(lon, lat)¶
Uses the transformation in self to convert lon/lat vector to x/y utm. Args:
lon : Longitude array.
lat : Latitude array.
- setMuDepth(depthMu)¶
Assign values of Mu as a function of depth.
- Args:
- depthMuList of increasing (depth,mu) tuple.
depthMu = [(3, 1e9), (5, 3e9), (10, 5e9), (0, 1e10)] The last value, with depth 0 means everything under the last-1 depth.
- setSlipToSources()¶
Takes the slip vector from a fault and organize the slip vector of the postprocessing tool.
- slipVector()¶
Returns the slip vector in the cartesian space for all subsources. We do not deal with the opening component. The fault slip may be a 3D array for multiple samples of slip.
- sourceNormal()¶
Returns the Normal of the subsources
- write2GCMT(form='full', filename=None)¶
Writes in GCMT style Args:
- formformat is either ‘full’ to match with Zacharie binary
or ‘line’ to match with the option -Sm in GMT
- Example of ‘full’:
PDE 2006 1 1 7 11 57.00 31.3900 140.1300 10.0 5.3 5.0 SOUTHEAST OF HONSHU, JAP
event name: 200601010711A time shift: 10.4000 half duration: 1.5000 latitude: 31.5100 longitude: 140.0700 depth: 12.0000 Mrr: 3.090000e+24 Mtt: -2.110000e+24 Mpp: -9.740000e+23 Mrt: -6.670000e+23 Mrp: -5.540000e+23 Mtp: -5.260000e+23
- xy2ll(x, y)¶
Uses the transformation in self to convert x.y vectors to lon/lat. Args:
x : Xarray
y : Yarray