faninsar.NSBAS.inversion.NSBASMatrixFactory#
- class faninsar.NSBAS.inversion.NSBASMatrixFactory(unw: NDArray[np.floating], pairs: Pairs | Sequence[str], model: TimeSeriesModels | None = None, gamma: float = 0.0001)[source]#
Bases:
objectFactory class to generate/format NSBAS matrix.
The NSBAS matrix is usually expressed as:
d = Gm, wheredis the unwrapped interferograms matrix,Gis the NSBAS matrix, andmis the model parameters, which is the combination of the deformation increment and the model parameters. see paper: TODO for more details.Note
After initialization, the
dcan still be updated by assigning a new unwrapped interferograms matrix tod. This is useful when the unwrapped interferograms is divided into multiple patches and the NSBAS matrix is calculated for each patch separately.Examples
>>> import faninsar as fis >>> import numpy as np
>>> names = ['20170111_20170204', '20170111_20170222', '20170111_20170318', '20170204_20170222', '20170204_20170318', '20170204_20170330', '20170222_20170318', '20170222_20170330', '20170222_20170411', '20170318_20170330']
>>> pairs = fis.Pairs.from_names(names) >>> unw = np.random.randint(0, 255, (len(pairs), 5)) >>> model = fis.AnnualSinusoidalModel(pairs.dates) >>> nsbas_matrix = fis.NSBASMatrixFactory(unw, pairs, model) >>> nsbas_matrix NSBASMatrixFactory( pairs: Pairs(10) model: AnnualSinusoidalModel(dates: 6, unit: day) gamma: 0.0001 G shape: (16, 9) d shape: (16, 5) )
reset
dby assigning a new unwrapped interferograms matrix with same pairs>>> nsbas_matrix.d = np.random.randint(0, 255, (len(pairs), 10)) NSBASMatrixFactory( pairs: Pairs(10) model: AnnualSinusoidalModel(dates: 6, unit: day) gamma: 0.0001 G shape: (16, 9) d shape: (16, 10) )
- __init__(unw: NDArray[np.floating], pairs: Pairs | Sequence[str], model: TimeSeriesModels | None = None, gamma: float = 0.0001) None[source]#
Initialize NSBASMatrixFactory.
- Parameters:
unw (NDArray (n_pairs, n_pixels)) – Unwrapped interferograms matrix
pairs (Pairs | Sequence[str]) – Pairs or Sequence of pair names
model (Optional[TimeSeriesModels], optional) – Time series model. If None, generate SBAS matrix rather than NSBAS matrix, by default None.
gamma (float, optional) – weight for the model component, by default 0.0001. This parameter will be ignored if model is None.
Methods
__init__(unw, pairs[, model, gamma])Initialize NSBASMatrixFactory.
Attributes
Return
Gmatrix for NSBASd = Gm.Return
dmatrix for NSBASd = Gm.Return gamma.
Return model.
Return pairs.
- property G: NDArray[np.float32]#
Return
Gmatrix for NSBASd = Gm.
- property d: NDArray[np.float32 | np.float64]#
Return
dmatrix for NSBASd = Gm.
- property model: TimeSeriesModels | None#
Return model.