strainfield class

class csi.strainfield(name, utmzone=None, lon0=None, lat0=None, ellps='WGS84', verbose=True)

Class that handles a strain field. Has not been used in a long time… Might be incorrect and untested.

Args:
  • name : Name of the StrainField 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

Returns:
  • None

closeHDF5()

Closes the input hdf5 file.

computeDilatationRate()

Computes the dilatation rate from the strain rate tensor. This is defined as the trace of the strain rate tensor.

computeRotationRateTensor()

Computes the rotation rate tensor on each point of the grid and stores that in self.W. The rotation rate tensor is the anti-symmetric part of the velocity gradient. It writes self.W = 1/2 (L - L’).

computeStrainRateTensor()

Computes the strain rate tensor on each point of the grid and stores that in self.D. The strain rate tensor is the symmetric part of the velocity gradient. It writes self.D = 1/2 (L + L’).

getprofile(name, loncenter, latcenter, length, azimuth, width, data='dilatation', comp=None)

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 (‘dilatation’, ‘veast’, ‘vnorth’, ‘projection’)

  • comp : if data is ‘projection’, comp is the name of the desired projection.

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 instance

Returns:
  • None

output2GRD(outfile, data='dilatation', comp=None)

Output the desired field to a grd file.

Args:
  • outfile : Name of the outputgrd file.

  • 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='veast', faults=None, gps=None, figure=123, ref='utm', legend=False, comp=None)

Plot one component of the strain field.

Args:
  • data : Type of data to plot. Can be ‘dilatation’, ‘veast’, ‘vnorth’

  • 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 se

  • fault : add a fault instance

  • comp : ??

Returns:
  • None

projectStrainRateTensor(name, angle)

Projects the strain rate tensor onto a vector that has an angle ‘angle’ with the north. The unit vector is :

V = [ 0 ]

[ -cos(angle) ] [ sin(angle) ]

The projection is obtained by doing D.V on each grid point. We then get the scalar product of the projection with V.

projectVelocities(name, angle)

Projects the velocity field along a certain angle. The output is stored in the self.velproj dictionary and has a name

Args:
  • name : Name of the projected velocity field

  • angle : azimuth of the projection

read_from_h5(filename)

Read the Continuous strain field from a hdf5 file.

Args:
  • filename : Name of the input file.

Returns:
  • None

writeProfile2File(name, filename, fault=None)

Writes the profile named ‘name’ to the ascii file filename.

Args:
  • name : name of the profile to use

  • filename : output file name

Kwargs:
  • fault : add a fault

Returns:
  • None