stressfield class¶
- class csi.stressfield(name, utmzone=None, lon0=None, lat0=None, ellps='WGS84', verbose=True)¶
A class that handles a stress field. Not used in a long time, untested, could be incorrect.
- Args:
name : Name of the StressField dataset.
- Kwargs:
utmzone : UTM zone. Default is 10 (Western US).
lon0 : Longitude of the custom utmzone
lat0 : Latitude of the custom utmzone
ellps : ellipsoid
verbose : talk to me
- Fault2Stress(fault, factor=0.001, mu=30000000000.0, nu=0.25, slipdirection='sd', force_dip=None, stressonpatches=False, verbose=False)¶
Takes a fault, or a list of faults, and computes the stress change associated with the slip on the fault.
- Args:
fault : Fault object (RectangularFault).
- Kwargs:
factor : Conversion factor between the slip units and distance units. Usually, distances are in Km. Therefore, if slip is in mm, then factor=1e-6.
slipdirection : any combination of s, d, and t.
mu : Shear Modulus (default is 30GPa).
nu : Poisson’s ratio (default is 0.25).
stressonpatches : Re-sets the station locations to be where the center of the patches are.
force_dip : Specify the dip angle of the patches
verbos : talk to me
- Returns:
None
- computeTrace()¶
Computes the Trace of the stress tensor.
- computeTractions(strike, dip)¶
Computes the tractions given a plane with a given strike and dip.
- Args:
strike : Strike (radians).
dip : Dip (radians).
If these are floats, all the tensors will be projected on that plane. Otherwise, they need to be the size ofthe number of tensors.
Positive Normal Traction means extension. Positive Shear Traction means left-lateral.
- getTractions(strike, dip)¶
Just a wrapper around computeTractions to store the result, if necessary.
- Args:
strike : Strike (radians).
dip : Dip (radians).
If these are floats, all the tensors will be projected on that plane. Otherwise, they need to be the size ofthe number of tensors.
Positive Normal Traction means extension. Positive Shear Traction means left-lateral.
- getprofile(name, loncenter, latcenter, length, azimuth, width, data='trace')¶
Project the wanted quantity onto a profile. Works on the lat/lon coordinates system.
- Args:
name : Name of the profile.
loncenter : Profile origin along longitude.
latcenter : Profile origin along latitude.
length : Length of profile.
azimuth : Azimuth in degrees.
width : Width of the profile.
- Kwargs:
data : name of the data to use (‘trace’)
- Returns:
None
- intersectProfileFault(name, fault)¶
Gets the distance between the fault/profile intersection and the profile center.
- Args:
name : name of the profile.
fault : fault object.
- Returns:
None
- output2GRD(outfile, data='dilatation', comp=None)¶
Output the desired field to a grd file.
- Args:
outfile : Name of the outputgrd file.
- Kwargs:
data : Type of data to output. Can be ‘veast’, ‘vnorth’, ‘dilatation’, ‘projection’, ‘strainrateprojection’
comp : if data is projection or ‘strainrateprojection’, give the name of the projection you want.
- Returns:
None
- plot(data='trace', faults=None, gps=None, figure=123, ref='utm', legend=False, comp=None)¶
Plot one component of the strain field.
- Kwargs:
data : Type of data to plot. Can be ‘trace’
faults : list of faults to plot.
gps : list of gps networks to plot.
figure : figure number
ref : utm or lonlat
legend : add a legend
comp : ??
- Returns:
None
- plotprofile(name, data='veast', fault=None, comp=None)¶
Plot profile.
- Args:
name : Name of the profile.
- Kwargs:
data : which data to plot
fault : fault object
comp : ??
- Returns:
None
- setLonLatZ(lon, lat, z)¶
Sets longitude, latitude and depth.
- Args:
lon : array of floats (km)
lat : array of floats (km)
z : array of floats (km)
- Returns:
None
- setXYZ(x, y, z)¶
Sets the values of x, y and z.
- Args:
x : array of floats (km)
y : array of floats (km)
z : array of floats (km)
- Returns:
None
- strikedip2normal(strike, dip)¶
Returns a vector normal to a plane with a given strike and dip (radians).
- Args:
strike : strike angle in radians
dip : dip angle in radians
- Returns:
tuple of unit vectors
- total2deviatoric()¶
Computes the deviatoric stress tensor dS = S - Tr(S)I
- writeProfile2File(name, filename, fault=None)¶
Writes the profile named ‘name’ to the ascii file filename.
- Args:
name : name of the profile to work with
filename : output file name
- Kwargs:
fault : fualt object
- Returns:
None