xdem.coreg.BlockwiseCoreg#

class xdem.coreg.BlockwiseCoreg(step, subdivision, success_threshold=0.8, n_threads=None, warn_failures=False)[source]#

Block-wise co-registration processing class to run a step in segmented parts of the grid.

A processing class of choice is run on an arbitrary subdivision of the raster. When later applying the step the optimal warping is interpolated based on X/Y/Z shifts from the coreg algorithm at the grid points.

For instance: a subdivision of 4 triggers a division of the DEM in four equally sized parts. These parts are then processed separately, with 4 .fit() results. If the subdivision is not divisible by the raster shape, subdivision is made as good as possible to have approximately equal pixel counts.

__init__(step, subdivision, success_threshold=0.8, n_threads=None, warn_failures=False)[source]#

Instantiate a blockwise processing object.

Parameters:
  • step (Coreg | CoregPipeline) – An instantiated co-registration step object to fit in the subdivided DEMs.

  • subdivision (int) – The number of chunks to divide the DEMs in. E.g. 4 means four different transforms.

  • success_threshold (float) – Raise an error if fewer chunks than the fraction failed for any reason.

  • n_threads (Optional[int]) – The maximum amount of threads to use. Default=auto

  • warn_failures (bool) – Trigger or ignore warnings for each exception/warning in each block.

Methods

__init__(step, subdivision[, ...])

Instantiate a blockwise processing object.

apply(dem[, transform, crs, bias_vars, resample])

Apply the estimated transform to a DEM.

apply_pts(coords)

Apply the estimated transform to a set of 3D points.

copy()

Return an identical copy of the class.

error(reference_dem, dem_to_be_aligned[, ...])

Calculate the error of a coregistration approach.

fit(reference_dem, dem_to_be_aligned[, ...])

Estimate the coregistration transform on the given DEMs.

fit_pts(reference_dem, dem_to_be_aligned[, ...])

Estimate the coregistration transform between a DEM and a reference point elevation data.

residuals(reference_dem, dem_to_be_aligned)

Calculate the residual offsets (the difference) between two DEMs after applying the transformation.

stats()

Return statistics for each chunk in the blockwise coregistration.

subdivide_array(shape)

Return the grid subdivision for a given DEM shape.

to_points()

Convert the blockwise coregistration matrices to 3D (source -> destination) points.

Attributes

is_affine

Check if the transform be explained by a 3D affine transform.