Pressure class¶
- class csi.Pressure(name, utmzone=None, ellps='WGS84', lon0=None, lat0=None, verbose=True)¶
- assembleCd(datas, add_prediction=None, verbose=False)¶
Assembles the data covariance matrices that have been built for each data structure.
- Args:
datas : List of data instances or one data instance
- Kwargs:
- add_prediction: Precentage of displacement to add to the Cd
diagonal to simulate a Cp (dirty version of a prediction error covariance, see Duputel et al 2013, GJI).
verbose : Talk to me (overwrites self.verbose)
- Returns:
None
- assembleGFs(datas, polys=None, verbose=True, custom=False, computeNormFact=True)¶
Assemble the Green’s functions corresponding to the data in datas. This method allows to specify which transformation is going to be estimated in the data sets, through the polys argument.
Assembled Green’s function matrix is stored in self.Gassembled
- Args:
- dataslist of data sets. If only one data set is
used, can be a data instance only.
- Kwargs:
polys : None -> nothing additional is estimated
- For InSAR, Optical, GPS:
1 -> estimate a constant offset 3 -> estimate z = ax + by + c 4 -> estimate z = axy + bx + cy + d
- For GPS only:
- ‘full’ -> Estimates a rotation,
translation and scaling (Helmert transform).
- ‘strain’ -> Estimates the full strain
tensor (Rotation + Translation + Internal strain)
- ‘strainnorotation’ -> Estimates the strain tensor and a
translation
‘strainonly’ -> Estimates the strain tensor ‘strainnotranslation’ -> Estimates the strain tensor and a
rotation
‘translation’ -> Estimates the translation ‘translationrotation -> Estimates the translation and a
rotation
- customIf True, gets the additional Green’s function
from the dictionary self.G[data.name][‘custom’]
- computeNormFactbool
if True, compute new OrbNormalizingFactor if False, uses parameters in self.OrbNormalizingFactor
verbose : Talk to me (overwrites self.verbose)
- Returns:
None
- assembled(datas, verbose=True)¶
Assembles a data vector for inversion using the list datas Assembled vector is stored in self.dassembled
- Args:
datas : list of data objects
- Returns:
None
- buildCm(sigma, extra_params=None, user_Cm=None, verbose=True)¶
Builds a dummy model covariance matrix using user-defined value.
Model covariance is stored in self.Cm.
- Kwargs:
extra_params : a list of extra parameters.
user_Cm : user-defined value for the covariance matrix
verbose : Talk to me (overwrites self.verrbose)
- Returns:
None
- buildGFs(data, vertical=True, method='volume', slipdir=None, verbose=True)¶
Builds the Green’s function matrix based on the pressure source.
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 ‘volume’ or ‘pressure’
- Args:
data : Data object (gps, insar, optical, …)
- Kwargs:
- verticalIf True, will produce green’s functions for
the vertical displacements in a gps object.
method : Can be “volume”. Converted to pressure for the case of Mogi and Yang before the calculation
verbose : Writes stuff to the screen (overwrites self.verbose)
- Returns:
None
- static chooseSource(name, x0, y0, z0, ax, ay, az, dip, strike, plunge, utmzone=None, ellps='WGS84', lon0=None, lat0=None, verbose=True)¶
Method used to initialize object as CDM or one of its degenerate cases (pCDM, mogi, or yang)
- Args:
x0, y0 : Center of pressure source in lat/lon or utm
z0 : Depth
ax, ay, az : Semi-axes of the CDM along the x, y and z axes respectively, before applying rotations.
dip : Clockwise around N-S (Y) axis; dip = 90 means vertical source
strike : Clockwise from N; strike = 0 means source is oriented N-S
plunge : Clockwise along E-W (X) axis
- duplicatePressure()¶
Returns a full copy (copy.deepcopy) of the pressure object.
- Return:
pressure : pressure object
- emptyGFs(data, vertical=True, slipdir='sd', verbose=True)¶
Build zero GFs.
- Args:
data : Data object (gps, insar, optical, …)
- Kwargs:
vertical : If True, will produce green’s functions for the vertical displacements in a gps object.
slipdir : Direction of slip along the patches. Can be any combination of s (strikeslip), d (dipslip), t (tensile) and c (coupling)
verbose : Writes stuff to the screen (overwrites self.verbose)
- Returns:
G : Dictionnary of GFs
- homogeneousGFs(data, volumedir='xyz', vertical=True, donotreadpressure=True, verbose=True)¶
Builds the Green’s functions for a homogeneous half-space.
- Args:
data : Data object (gps, insar, optical, …)
- Kwargs:
- verticalIf True, will produce green’s functions for
the vertical displacements in a gps object.
–> Needs to be implemented: * volumedir : For pCDM, want to solve for volume change in which direction?
verbose : Writes stuff to the screen (overwrites self.verbose)
- Returns:
G : Dictionary of the built Green’s functions
- initializeEmptyPressure()¶
Initializes what is required for a pressure source with no volume change
Returns: None
- initializepressure(values=None)¶
Re-initializes the volume/pressure change.
- Returns:
None
- pressure2ll()¶
Transpose the initial pressure source position in UTM coordinates into lat/lon. Lon/Lat coordinates are stored in self.lon and self.lat in degrees
- Returns:
None
- pressure2xy()¶
Transpose the initial pressure source position in lat/lon into the UTM reference. UTM coordinates are stored in self.xf and self.yf in km
- Returns:
None
- readPressureFromFile(filename, Cm=None, inputCoordinates='lonlat', donotreadvolume=False)¶
Read the pressure source parameters from a GMT formatted file. Args:
filename : Name of the file.
- Returns:
None
- saveData(dtype='d', outputDir='.')¶
Saves the Data in binary files.
- Kwargs:
- dtypeFormat of the binary data saved
‘d’ for double ‘f’ for np.float32
outputDir : Directory to save binary data
- Returns:
None
- saveGFs(dtype='d', outputDir='.', suffix={'pressure': 'dP', 'pressureDVx': 'dVx', 'pressureDVy': 'dVy', 'pressureDVz': 'dVz'})¶
Saves the Green’s functions in different files.
- Kwargs:
- dtypeFormat of the binary data saved
‘d’ for double ‘f’ for np.float32
outputDir : Directory to save binary data.
suffix : suffix for GFs name (dictionary)
- Returns:
None
- setGFs(data, deltapressure=[None, None, None], GDVx=[None, None, None], GDVy=[None, None, None], GDVz=[None, None, None], vertical=False, synthetic=False)¶
Stores the input Green’s functions matrices into the pressure source structure.
These GFs are organized in a dictionary structure in self.G Entries of self.G are the data set names (data.name).
Entries of self.G[data.name] are ‘deltapressure’.
If you provide GPS GFs, those are organised with E, N and U in lines
If you provide Optical GFs, those are organised with E and N in lines
If you provide InSAR GFs, these need to be projected onto the LOS direction already.
- Args:
data : Data structure
- Kwargs:
- deltapressureList of matrices of the pressure source
Green’s functions
- Returns:
None
- setGFsFromFile(data, pressure=None, DVx=None, DVy=None, DVz=None, custom=None, vertical=False, dtype='d')¶
Sets the Green’s functions reading 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). Basically, it will work better if you have computed the GFs using csi…
- Args:
data : Data object
- kwargs:
- pressureFile containing the Green’s functions for
pressure source related displacements.
- verticalDeal with the UP component (gps: default is false,
insar: it will be true anyway).
- dtypeType of binary data.
‘d’ for double/float64 ‘f’ for np.float32
- Returns:
None
- surfacesimulation(volume, box=None, disk=None, err=None, lonlat=None, name='simulation', verbose=True)¶
Takes the source caracteristics and computes the surface displacement that corresponds on a regular grid for a given volume change.
- Args:
volume : Volume change
- Kwargs:
box : Can be a list of [minlon, maxlon, minlat, maxlat, n].
disk : list of [xcenter, ycenter, radius, n]
err :
lonlat : Arrays of lat and lon. [lon, lat]
verbose : Default is True
- trace(x, y, utm=False)¶
Set the initial pressure source position from Lat/Lon or UTM coordinates Surface initial pressure source position is stored in self.xf, self.yf (UTM) and self.lon, self.lat (Lon/lat)
- Args:
Lon : Array/List containing the Lon points.
Lat : Array/List containing the Lat points.
- Kwargs:
- utmIf False, considers x and y are lon/lat
If True, considers x and y are utm in km
- Returns:
None
- writePressure2File(filename, add_volume=None, scale=1.0, stdh5=None, decim=1)¶
Writes the pressure parameters in a file. Trying to make this as generic as possible. Args:
filename : Name of the file.
add_volume : Put the volume as a value for the color. Can be None or volume for pCDM.
scale : Multiply the volume change by a factor.
- Returns:
None