xdem.coreg.NuthKaab#
- class xdem.coreg.NuthKaab(max_iterations=10, offset_threshold=0.001, bin_before_fit=True, fit_optimizer=<function curve_fit>, bin_sizes=72, bin_statistic=<function nanmedian>, subsample=500000.0, vertical_shift=True, initial_shift=None)[source]#
Nuth and Kääb (2011) coregistration, https://doi.org/10.5194/tc-5-271-2011.
Estimate horizontal and vertical translations by iterative slope/aspect alignment.
The translation parameters are stored in the self.meta[“outputs”][“affine”] keys “shift_x”, “shift_y” and “shift_z” (in georeferenced units for horizontal shifts, and unit of the elevation dataset inputs for the vertical shift), as well as in the “matrix” transform.
- __init__(max_iterations=10, offset_threshold=0.001, bin_before_fit=True, fit_optimizer=<function curve_fit>, bin_sizes=72, bin_statistic=<function nanmedian>, subsample=500000.0, vertical_shift=True, initial_shift=None)[source]#
Instantiate a new Nuth and Kääb (2011) coregistration object.
- Parameters:
max_iterations (
int) – Maximum allowed iterations before stopping.offset_threshold (
float) – Residual offset threshold after which to stop the iterations (in pixels).bin_before_fit (
bool) – Whether to bin data before fitting the coregistration function. For the Nuth and Kääb (2011) algorithm, this corresponds to bins of aspect to compute statistics on dh/tan(slope).fit_optimizer (
Callable[...,tuple[ndarray[tuple[Any,...],dtype[floating[Any]]],Any]]) – Optimizer to minimize the coregistration function.bin_sizes (
int|dict[str,int|Iterable[float]]) – Size (if integer) or edges (if iterable) for binning variables later passed in .fit().bin_statistic (
Callable[[ndarray[tuple[Any,...],dtype[floating[Any]]]],floating[Any]]) – Statistic of central tendency (e.g., mean) to apply during the binning.subsample (
int|float) – Subsample the input for speed-up. <1 is parsed as a fraction. >1 is a pixel count.vertical_shift (
bool) – Whether to apply the vertical shift or not (default is True).initial_shift (
tuple[int|float|integer[Any] |floating[Any],int|float|integer[Any] |floating[Any]] |tuple[int|float|integer[Any] |floating[Any],int|float|integer[Any] |floating[Any],int|float|integer[Any] |floating[Any]] |None) – Tuple containing x, y and z shifts (in georeferenced units). These shifts are applied before the fit() part.
Methods
__init__([max_iterations, offset_threshold, ...])Instantiate a new Nuth and Kääb (2011) coregistration object.
apply(elev[, bias_vars, resample, ...])centroid()Get the centroid of the coregistration, if defined.
copy()Return an identical copy of the class.
fit(reference_elev, to_be_aligned_elev[, ...])Estimate the coregistration transform on the given DEMs.
fit_and_apply(reference_elev, to_be_aligned_elev)from_matrix(matrix)Instantiate a generic Coreg class from a transformation matrix.
from_rotations([x_rot, y_rot, z_rot, ...])Instantiate a generic Coreg class from a X/Y/Z rotation.
from_translations([x_off, y_off, z_off])Instantiate a generic Coreg class from a X/Y/Z translation.
info([as_str])to_matrix()Convert the transform to a 4x4 transformation matrix.
to_rotations([return_degrees])Extract X/Y/Z euler rotations (extrinsic convention) from the affine transformation matrix.
to_translations()Extract X/Y/Z translations from the affine transformation matrix.
Attributes
is_affineCheck if the transform be explained by a 3D affine transform.
is_translationmetaMetadata dictionary of the coregistration.