Set#

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

Bases: object

Abstract class of set. Basically implementing output management

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

Output path of the pairs.

clean_tmp()[source]#

Clean the temporary directory of the current product

clear()[source]#

Clear this product’s cache

abstractmethod extent() GeoDataFrame[source]#

Get the extent of the set.

Returns:

Extent of the set

Return type:

gpd.GeoDataFrame

abstractmethod footprint() GeoDataFrame[source]#

Get the footprint of the set.

Returns:

Footprint of the set

Return type:

gpd.GeoDataFrame

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_band_file_name(band: BandNames, pixel_size: float = None, size: list | tuple = None, suffix: str = 'tif', **kwargs) str[source]#

Get the filename of any band, managing windows and other args.

Parameters:
  • band (BandNames) – Wanted band

  • pixel_size (float) – Band pixel size in meters

  • size (tuple | list) – Size of the array (width, height). Not used if pixel_size is provided.

  • kwargs – Additional arguments

Returns:

Band file name

Return type:

str

get_bands_to_load(bands, out_suffix='tif', **kwargs) -> (<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

abstractmethod get_mosaics() list[Mosaic][source]#

Get all the products as a list.

Returns:

Products list

Return type:

list

get_prods() list[Product][source]#

Get all the products as a list.

Returns:

Products list

Return type:

list

has_band(band: str | SpectralBandNames | SarBandNames | CloudsBandNames | DemBandNames | BandNames) bool[source]#

Does this moasic have products with the specified band ?

By band, we mean:

  • satellite band

  • index

  • DEM band

  • cloud band

Parameters:

band (BandType) – EOReader band (optical, SAR, clouds, DEM)

Returns:

True if the products has the specified band

Return type:

bool

has_bands(bands: list | str | SpectralBandNames | SarBandNames | CloudsBandNames | DemBandNames | BandNames) 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 (BandsType) – EOReader bands (optical, SAR, clouds, DEM)

Returns:

True if the products has the specified band

Return type:

bool

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

post_init(**kwargs)[source]#

Post initialization as the set level.

abstractmethod read_mtd()[source]#
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.

default_pixel_size: int#

by default it is the coarsest pixel size of the set.

Type:

Default pixel size of the set

full_name: str#

Mosaic full name.

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_optical: bool#

All products of this set are Optical data.

is_sar: bool#

All products of this set are SAR data.

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.

same_constellation#

Is the mosaic constituted of the same constellation?

same_crs#

Is the mosaic constituted of the same sensor type?