Set#

class Set(output_path: str | CloudPath | Path | None = None, id: str | None = None, remove_tmp: bool = True, **kwargs)[source]#

Bases: object

Abstract class of set. Basically implementing output management

__init__(output_path: str | CloudPath | Path | None = None, id: str | None = None, remove_tmp: bool = True, **kwargs)[source]#

Output path of the pairs.

abstract clean_tmp()[source]#

Clean the temporary directory of the current product

abstract clear()[source]#

Clear this product’s cache

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

crs#

CRS of the mosaic. If not provided in kwargs, using the first product’s crs.

abstract extent() GeoDataFrame[source]#

Get the extent of the set.

Returns:

Extent of the set

Return type:

gpd.GeoDataFrame

abstract footprint() GeoDataFrame[source]#

Get the footprint of the set.

Returns:

Footprint of the set

Return type:

gpd.GeoDataFrame

full_name: str#

Mosaic full name.

get_attr(attr: str, **kwargs) Any[source]#

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'>)[source]#
get_first_prod() Product[source]#

Get first product, which should be coherent with all others

Returns:

First reference product

Return type:

Product

abstract get_prods() list[source]#

Get all the products as a list.

Returns:

Products list

Return type:

list

has_band(band: BandNames | str) bool[source]#

Does this moasic have products with the specified band ?

By band, we mean:

  • satellite band

  • index

  • DEM band

  • cloud band

Parameters:

band (Union[BandNames, str]) – EOReader band (optical, SAR, clouds, DEM)

Returns:

True if the products has the specified band

Return type:

bool

has_bands(bands: list | BandNames | str) bool[source]#

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.

Parameters:

bands (Union[list, BandNames, str]) – EOReader bands (optical, SAR, clouds, DEM)

Returns:

True if the products has the specified band

Return type:

bool

id: str#

ID of the reference product, given by the creator of the mosaic. If not, a mix based on the dates and constellations of its components.

is_homogeneous(attr: str) bool[source]#

Check if the given attribute is the same for all products constituting the mosaic.

Parameters:

attr (str) – Attribute to be checked. Must be available in EOReader’s Product

Returns:

True if this attribute is the same for all products constituting the mosaic.

Return type:

bool

nodata#

Nodata of the mosaic. If not provided in kwargs, using the first product’s nodata.

nof_prods: int#

Number of products.

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.

abstract read_mtd()[source]#
same_constellation#

Is the mosaic constituted of the same constellation?

same_crs#

Is the mosaic constituted of the same sensor type?