xdem.coreg.Coreg.fit_and_apply

xdem.coreg.Coreg.fit_and_apply#

Coreg.fit_and_apply(reference_elev, to_be_aligned_elev, inlier_mask=None, bias_vars=None, weights=None, subsample=None, transform=None, crs=None, area_or_point=None, z_name='z', resample=True, resampling='bilinear', random_state=None, fit_kwargs=None, apply_kwargs=None)[source]#

Estimate and apply the coregistration to a pair of elevation data.

Overloads:
  • self, reference_elev (NDArrayf | MArrayf | RasterType | gpd.GeoDataFrame | PointCloudType), to_be_aligned_elev (MArrayf), inlier_mask (NDArrayb | Raster | None), bias_vars (dict[str, NDArrayf | MArrayf | RasterType] | None), weights (NDArrayf | None), subsample (float | int | None), transform (rio.transform.Affine | None), crs (rio.crs.CRS | None), area_or_point (Literal[‘Area’, ‘Point’] | None), z_name (str), resample (bool), resampling (str | rio.warp.Resampling), random_state (int | np.random.Generator | None), fit_kwargs (dict[str, Any] | None), apply_kwargs (dict[str, Any] | None) → tuple[MArrayf, rio.transform.Affine]

  • self, reference_elev (NDArrayf | MArrayf | RasterType | gpd.GeoDataFrame | PointCloudType), to_be_aligned_elev (NDArrayf), inlier_mask (NDArrayb | Raster | None), bias_vars (dict[str, NDArrayf | MArrayf | RasterType] | None), weights (NDArrayf | None), subsample (float | int | None), transform (rio.transform.Affine | None), crs (rio.crs.CRS | None), area_or_point (Literal[‘Area’, ‘Point’] | None), z_name (str), resample (bool), resampling (str | rio.warp.Resampling), random_state (int | np.random.Generator | None), fit_kwargs (dict[str, Any] | None), apply_kwargs (dict[str, Any] | None) → tuple[NDArrayf, rio.transform.Affine]

  • self, reference_elev (NDArrayf | MArrayf | RasterType | gpd.GeoDataFrame | PointCloudType), to_be_aligned_elev (RasterType | gpd.GeoDataFrame | PointCloudType), inlier_mask (NDArrayb | Raster | None), bias_vars (dict[str, NDArrayf | MArrayf | RasterType] | None), weights (NDArrayf | None), subsample (float | int | None), transform (rio.transform.Affine | None), crs (rio.crs.CRS | None), area_or_point (Literal[‘Area’, ‘Point’] | None), z_name (str), resample (bool), resampling (str | rio.warp.Resampling), random_state (int | np.random.Generator | None), fit_kwargs (dict[str, Any] | None), apply_kwargs (dict[str, Any] | None) → RasterType | gpd.GeoDataFrame

Parameters:
  • reference_elev (NDArray[floating[Any]] | MaskedArray[Any, dtype[floating[Any]]] | TypeVar(RasterType, bound= Raster) | GeoDataFrame | TypeVar(PointCloudType, bound= PointCloud)) – Reference elevation, either a DEM or an elevation point cloud.

  • to_be_aligned_elev (NDArray[floating[Any]] | MaskedArray[Any, dtype[floating[Any]]] | TypeVar(RasterType, bound= Raster) | GeoDataFrame | TypeVar(PointCloudType, bound= PointCloud)) – To-be-aligned elevation, either a DEM or an elevation point cloud.

  • inlier_mask (NDArray[bool] | Raster | None) – Raster or boolean array of areas to include (inliers=True).

  • bias_vars (dict[str, NDArray[floating[Any]] | MaskedArray[Any, dtype[floating[Any]]] | TypeVar(RasterType, bound= Raster)] | None) – Auxiliary variables for certain bias correction classes, as raster or arrays.

  • weights (NDArray[floating[Any]] | None) – Array of weights for the coregistration.

  • subsample (float | int | None) – Subsample the input to increase performance. <1 is parsed as a fraction. >1 is a pixel count.

  • transform (Affine | None) – Transform of the reference elevation, only if provided as 2D array.

  • crs (CRS | None) – CRS of the reference elevation, only if provided as 2D array.

  • area_or_point (Literal['Area', 'Point'] | None) – Pixel interpretation of the DEMs, only if provided as 2D arrays.

  • z_name (str) – Column name to use as elevation, only for point elevation data passed as geodataframe.

  • resample (bool) – If set to True, will reproject output Raster on the same grid as input. Otherwise, only the transform might be updated and no resampling is done.

  • resampling (str | Resampling) – Resampling method if resample is used. Defaults to “bilinear”.

  • random_state (int | Generator | None) – Random state or seed number to use for calculations (to fix random sampling).

  • fit_kwargs (dict[str, Any] | None) – Keyword arguments to be passed to fit.

  • apply_kwargs (dict[str, Any] | None) – Keyword argument to be passed to apply.