xdem.coreg.LZD#
- class xdem.coreg.LZD(only_translation=False, fit_minimizer=<function least_squares>, fit_loss_func='linear', max_iterations=200, tolerance=0.01, subsample=500000.0)[source]#
Least Z-difference coregistration.
See Rosenholm and Torlegård (1988), https://www.asprs.org/wp-content/uploads/pers/1988journal/oct/1988_oct_1385-1389.pdf.
Estimates a rigid transform (rotation + translation) between two elevation datasets.
The estimated transform is stored in the self.meta[“outputs”][“affine”] key “matrix”, with rotation centered on the coordinates in the key “centroid”. The translation parameters are also stored individually in the 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).
- __init__(only_translation=False, fit_minimizer=<function least_squares>, fit_loss_func='linear', max_iterations=200, tolerance=0.01, subsample=500000.0)[source]#
Instantiate an LZD coregistration object.
- Parameters:
only_translation (
bool) – Whether to solve only for a translation, otherwise solves for both translation and rotation as default.fit_minimizer (
Callable[...,tuple[ndarray[tuple[Any,...],dtype[floating[Any]]],Any]]) – Minimizer for the coregistration function.fit_loss_func (
Callable[[ndarray[tuple[Any,...],dtype[floating[Any]]]],floating[Any]] |str) – Loss function for the minimization of residuals.max_iterations (
int) – Maximum allowed iterations before stopping.tolerance (
float) – Residual change threshold after which to stop the iterations.subsample (
float|int) – Subsample the input for speed-up. <1 is parsed as a fraction. >1 is a pixel count.
Methods
__init__([only_translation, fit_minimizer, ...])Instantiate an LZD 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.