Series#
- class Series(paths: list, id: str | None = None, output_path: str | CloudPath | Path | None = None, remove_tmp: bool = True, overlap_check: GeometryCheck | str = GeometryCheck.EXTENT, contiguity_check: GeometryCheck | str = GeometryCheck.EXTENT, alignement: Alignment | str = Alignment.FIRST, coregister: bool = False, reference_mosaic: Mosaic | int | str | None = None, **kwargs)[source]#
Bases:
Set
Class of series
- __init__(paths: list, id: str | None = None, output_path: str | CloudPath | Path | None = None, remove_tmp: bool = True, overlap_check: GeometryCheck | str = GeometryCheck.EXTENT, contiguity_check: GeometryCheck | str = GeometryCheck.EXTENT, alignement: Alignment | str = Alignment.FIRST, coregister: bool = False, reference_mosaic: Mosaic | int | str | None = None, **kwargs)[source]#
Output path of the pairs.
- alignment#
Series alignment (on first mosaic, on last mosaic, on a hypothetical mean product).
- condensed_name#
Mosaic condensed name, a mix based on the dates and constellations of the components of the mosaic.
- constellations#
List of unique constellations constituting the set
- coregister#
Do we need to coregister the time series?
- crs#
CRS of the mosaic. If not provided in kwargs, using the first product’s crs.
- get_attr(attr: str, **kwargs) Any #
Get attribute, either from kwargs or from the first product (default)
- Parameters:
attr (str) – Wanted attribute
**kwargs – Other args
- Returns:
Attribute result
- Return type:
Any
- get_bands_to_load(bands, out_suffix='tif') -> (<class 'list'>, <class 'dict'>)#
- get_first_prod() Product #
Get first product, which should be coherent with all others
- Returns:
First reference product
- Return type:
Product
- has_band(band: BandNames | str) bool #
Does this moasic have products with the specified band ?
By band, we mean:
satellite band
index
DEM band
cloud band
- has_bands(bands: list | BandNames | str) bool #
Does this moasic have products with the specified bands ?
By band, we mean:
satellite band
index
DEM band
cloud band
See
has_band
for a code example.
- is_homogeneous(attr: str) bool #
Check if the given attribute is the same for all products constituting the mosaic.
- load(bands: list | BandNames | str | None = None, pixel_size: float | None = None, resampling: Resampling = Resampling.bilinear, **kwargs) Dataset [source]#
Load the bands and compute the wanted spectral indices.
- Parameters:
- Returns:
Wanted bands as xr.Datasets
- Return type:
xr.Dataset
- mosaics#
Mosaics composing the series.
- nodata#
Nodata of the mosaic. If not provided in kwargs, using the first product’s nodata.
- property output: CloudPath | Path#
Output directory of the set
- Returns:
Output path of the set
- Return type:
AnyPathType
- pixel_size#
Pixel size of the set. If not provided in kwargs, using the first product’s pixel size.
- same_constellation#
Is the mosaic constituted of the same constellation?
- same_crs#
Is the mosaic constituted of the same sensor type?
- stack(bands: list, pixel_size: float | None = None, stack_path: str | CloudPath | Path | None = None, save_as_int: bool = False, **kwargs) DataArray [source]#
Stack bands and index of a series.
- Parameters:
bands (list) – Bands and index combination
pixel_size (float) – Stack pixel size. If not specified, use the product pixel size.
stack_path (Union[str, AnyPathType]) – Stack path
save_as_int (bool) – Convert stack to uint16 to save disk space (and therefore multiply the values by 10.000)
**kwargs – Other arguments passed to
load
orrioxarray.to_raster()
(such ascompress
)
- Returns:
Stack as a DataArray
- Return type:
xr.DataArray