xdem.coreg.DhMinimize#
- class xdem.coreg.DhMinimize(fit_minimizer=<function minimize>, fit_loss_func=<function nmad>, subsample=500000.0, initial_shift=None)[source]#
Elevation difference minimization coregistration.
Estimates vertical and horizontal translations.
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__(fit_minimizer=<function minimize>, fit_loss_func=<function nmad>, subsample=500000.0, initial_shift=None)[source]#
Instantiate dh minimization object.
- Parameters:
fit_minimizer (
Callable[...,tuple[NDArray[floating[Any]],Any]]) – Minimizer for the coregistration function.fit_loss_func (
Callable[[NDArray[floating[Any]]],floating[Any]]) – Loss function for the minimization of residuals.subsample (
int|float) – Subsample the input for speed-up. <1 is parsed as a fraction. >1 is a pixel count.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__([fit_minimizer, fit_loss_func, ...])Instantiate dh minimization object.
apply(elev[, bias_vars, resample, ...])Apply the estimated transform to a DEM.
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)Estimate and apply the coregistration to a pair of elevation data.
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])Summarize information about this coregistration.
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.