imagecovariance class¶
- class csi.imagecovariance(name, image, verbose=True)¶
A class that allows image covariance determination.
- Args:
name : Name of the object.
image : InSAR or Opticorr data set
- Kwargs:
verbose : Talk to me
- Returns:
None
- buildCovarianceMatrix(image, dname, write2file=None)¶
Uses the fitted covariance parameters to build a covariance matrix for the dataset image of type insar or opticorr.
- Args:
image : dataset of type opticorr or insar.
dname : Name of the covariance estimator. If image is opticorr, the datasets used are “dname East” and “dname North”.
- Kwargs:
write2file: Write to a binary file (np.float32).
- Returns:
None
- computeCovariance(function='exp', ComputeCovar=True, frac=0.4, every=1.0, distmax=50.0, rampEst=True, prior=None, tol=1e-10)¶
Computes the covariance functions.
- Kwargs:
function : Type of function to fit. Can be ‘exp’or ‘gauss’.
computeCovar : Recompute the covariogram
frac : Size of the fraction of the dataset to take.
distmax : Truncate the covariance function.
every : Binning of the covariance function.
rampEst : estimate a ramp (default True).
prior : First guess for the covariance estimation [Sill, Sigma, Lambda]
tol : Tolerance for the fit
- Returns:
None
- empiricalCovariograms(frac=0.4, every=1.0, distmax=50.0, rampEst=True)¶
Computes the empirical Covariogram as a function of distance.
- Kwargs:
- fracSize of the fraction of the dataset to take (0 to 1)
frac can be an integer, then it is going to be the number of pixels used to compute the covariance
distmax : Truncate the covariance function.
every : Binning of the covariance function.
rampEst : Estimates a ramp before computing the covariaogram
- Returns:
None
- empiricalSemivariograms(frac=0.4, every=1.0, distmax=50.0, rampEst=True)¶
Computes the empirical Semivariogram as a function of distance.
- Kwargs:
frac : Size of the fraction of the dataset to take (0 to 1) frac can be an integer, then it is going to be the number of pixels used to compute the covariance
distmax : Truncate the covariance function.
every : Binning of the covariance function.
rampEst : Estimates a ramp before computing the semivariograms
- Returns:
None
- maskIn(box)¶
Select Boxes on which to compute the covariance.
- Args:
box: List of min and max lon and lat coordinates. Can be a list of lists to specify multiple regions. ex: [[ -120, -119, 34, 35], [-122, -121.7, 34.2, 34.3]]
- Returns:
None
- maskOut(box)¶
Picks out some points in order to mask them before computing the covariance.
- Args:
box : List of min and max lon and lat coordinates. Can be a list of lists to specify multiple regions. example: [[ -120, -119, 34, 35], [-122, -121.7, 34.2, 34.3]]
- Returns:
None
- plot(data='covariance', plotData=False, figure=1, figsize=(10, 5), savefig=False, show=True, savedir='./')¶
Plots the covariance function.
- Kwargs:
data : Can be covariance or semivariogram or all.
plotData : Also plots the image
figure : Figure number
savefig : True/False
show : True/False
savedir : output directory
- Returns:
None
- read_from_covfile(dname, filename)¶
Read a file that was written by write2file()
- Args:
dname : Name of the covariance estimator.
filename : file written with self.write2file()
- Returns:
None
- write2file(savedir='./')¶
Writes the results to a text file.