xdem.coreg.DirectionalBias#
- class xdem.coreg.DirectionalBias(angle=0, fit_or_bin='bin_and_fit', fit_func='nfreq_sumsin', fit_optimizer=None, bin_sizes=100, bin_statistic=<function nanmedian>, bin_apply_method='linear', subsample=1.0)[source]#
Bias correction for directional biases, for example along- or across-track of satellite angle.
The binning and/or fitting correction parameters are stored in the self.meta[“outputs”][“fitorbin”].
- __init__(angle=0, fit_or_bin='bin_and_fit', fit_func='nfreq_sumsin', fit_optimizer=None, bin_sizes=100, bin_statistic=<function nanmedian>, bin_apply_method='linear', subsample=1.0)[source]#
Instantiate a directional bias correction.
- Parameters:
angle (
float) – Angle in which to perform the directional correction (degrees) with 0° corresponding to X axis direction and increasing clockwise.fit_or_bin (
Literal['bin_and_fit'] |Literal['fit'] |Literal['bin']) – Whether to fit or bin, or both. Use “fit” to correct by optimizing a function or “bin” to correct with a statistic of central tendency in defined bins, or “bin_and_fit” to perform a fit on the binned statistics.fit_func (
Callable[...,NDArray[floating[Any]]] |Literal['norder_polynomial'] |Literal['nfreq_sumsin']) – Function to fit to the bias with variables later passed in .fit().fit_optimizer (
Callable[...,tuple[NDArray[floating[Any]],Any]] |Literal['ols'] |None) – Optimizer to minimize the function. If None, use the default for the selected fit model.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[floating[Any]]],floating[Any]]) – Statistic of central tendency (e.g., mean) to apply during the binning.bin_apply_method (
Literal['linear'] |Literal['per_bin']) – Method to correct with the binned statistics, either “linear” to interpolate linearly between bins, or “per_bin” to apply the statistic for each bin.subsample (
float|int) – Subsample the input for speed-up. <1 is parsed as a fraction. >1 is a pixel count.
Methods
__init__([angle, fit_or_bin, fit_func, ...])Instantiate a directional bias correction.
apply(elev[, bias_vars, resample, ...])Apply the estimated transform to a DEM.
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.
info([as_str])Summarize information about this coregistration.
Attributes
is_affineCheck if the transform be explained by a 3D affine transform.
is_translationmetaMetadata dictionary of the coregistration.