Transformations
Spectral indices provide transformations to create data processing pipelines on remote sensing images.
- class spectral_indices.transformations.Aggregation(dim: str = 'time', skipna: bool = False)[source]
Base class for aggregations along a dimension (sum, mean etc..).
- Parameters:
dim (str) – Dimensions to perform aggregation on. Default to ‘time’.
skipna (bool) – To perform aggregation with nan or not. Default to False.
- class spectral_indices.transformations.ApplyMasking(maskings: ~typing.List[~spectral_indices.transformations.mask.Masking | ~typing.Dict[str, ~typing.Any]] = <factory>)[source]
Wraps multiple masking operations.
- class spectral_indices.transformations.Masking(logical_string: str = <factory>, mask: ~spectral_indices.sources.masks.Mask = <factory>)[source]
Wrap masking metadata.
- Parameters:
logical_string (
str) – A string that represent the logical to apply within a xarray.where() method. Use ‘mask’ to represent the mask array. i.e: “mask > 5”.mask – (
Mask): Corresponding Mask class.
- class spectral_indices.transformations.SaveRaster(out_path: str, nodata: float = -1000)[source]
Save xarray to a tiff file supporting dask chunk parralle save.
- Parameters:
out_path (
str) – Path to save raster.nodata (
float) – Value to fill nodata. Default to -1000
- class spectral_indices.transformations.TemporalInterpolation(method: str = 'linear', gap: timedelta | timedelta64 | Timedelta = None)[source]
Perform temporal interpolation on xarray.
- Parameters:
method (
str) – Method to perform interpolation. See https://docs.xarray.dev/en/stable/generated/xarray.DataArray.interpolate_na.html to see all available options. Default to ‘linear’.gap (
Union[timedelta, timedelta64, Timedelta) – Maximum length of nan gap to fill. Default to None (no limit).
- class spectral_indices.transformations.Transformation[source]
Base class for transformations on xarrays.
- classmethod from_dict(transformation_dict: Dict[str, Any]) Transformation[source]
Build transformation from attributes dict.
- Parameters:
trasnformation_dict (
Dict[str, Any]) – Dict of trasnformation attributes.- Returns:
Return an instance of transformation.
- Return type:
Transformation
- property name: str
Return class name.