Sentinel

The vibe_core.data.sentinel module extends the core data module to handle specific data types related to Sentinel satellite products. It provides classes for representing Sentinel product metadata, rasters, and sequences, making it easier to work with data obtained from Sentinel-1 and Sentinel-2 satellites.

In addition to handling Sentinel products, the module also includes classes for handling SpaceEye rasters and sequences, further expanding its capabilities in the domain of satellite data processing and analysis.

Hierarchy

classDiagram class StrEnum { } class BaseVibe { } class DataSequence { } class DataVibe { } class CategoricalRaster { } class CloudRaster { } class Raster { } class RasterSequence { } class CloudMask { } class DownloadedSentinel1Product { } class DownloadedSentinel2Product { } class S2ProcessingLevel { } class Sentinel1Product { } class Sentinel1Raster { } class Sentinel1RasterOrbitGroup { } class Sentinel1RasterTileSequence { } class Sentinel2CloudMask { } class Sentinel2CloudMaskOrbitGroup { } class Sentinel2CloudMaskTileSequence { } class Sentinel2CloudProbability { } class Sentinel2Product { } class Sentinel2Raster { } class Sentinel2RasterOrbitGroup { } class Sentinel2RasterTileSequence { } class SentinelProduct { } class SentinelRaster { } class SpaceEyeRaster { } class SpaceEyeRasterSequence { } class TileSequence { } class TiledSentinel1Product { } DataSequence --|> DataVibe DataVibe --|> BaseVibe CategoricalRaster --|> Raster CloudRaster --|> Raster Raster --|> DataVibe RasterSequence --|> DataSequence RasterSequence --|> Raster CloudMask --|> CategoricalRaster CloudMask --|> CloudRaster CloudMask --|> Sentinel2Product DownloadedSentinel1Product --|> Sentinel1Product DownloadedSentinel2Product --|> Sentinel2Product S2ProcessingLevel --|> StrEnum Sentinel1Product --|> SentinelProduct Sentinel1Raster --|> Raster Sentinel1Raster --|> Sentinel1Product Sentinel1RasterOrbitGroup --|> Sentinel1Raster Sentinel1RasterTileSequence --|> Sentinel1Raster Sentinel1RasterTileSequence --|> TileSequence Sentinel2CloudMask --|> CloudMask Sentinel2CloudMask --|> Sentinel2Product Sentinel2CloudMaskOrbitGroup --|> Sentinel2CloudMask Sentinel2CloudMaskTileSequence --|> Sentinel2CloudMask Sentinel2CloudMaskTileSequence --|> TileSequence Sentinel2CloudProbability --|> CloudRaster Sentinel2CloudProbability --|> Sentinel2Product Sentinel2Product --|> SentinelProduct Sentinel2Raster --|> Raster Sentinel2Raster --|> Sentinel2Product Sentinel2RasterOrbitGroup --|> Sentinel2Raster Sentinel2RasterTileSequence --|> Sentinel2Raster Sentinel2RasterTileSequence --|> TileSequence SentinelProduct --|> DataVibe SentinelRaster --|> Raster SentinelRaster --|> SentinelProduct SpaceEyeRaster --|> Sentinel2Raster SpaceEyeRasterSequence --|> SpaceEyeRaster SpaceEyeRasterSequence --|> TileSequence TileSequence --|> RasterSequence TiledSentinel1Product --|> DownloadedSentinel1Product

Documentation

class vibe_core.data.sentinel.CloudMask(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, bands, categories)

Bases: CategoricalRaster, CloudRaster, Sentinel2Product

Represents a cloud mask raster for a Sentinel-2 product.

assets: List[AssetVibe]

A list of AssetVibe objects of the assets associated with the data object.

bands: Dict[str, int]

A dictionary with the name of each band and its index in the raster data.

bbox: BBox

A BBox representing the bounding box of the data object. This field is calculated from the geometry property using the shapely.geometry library.

categories: List[str]

The list of categories in the raster.

geometry: Dict[str, Any]

A dictionary representing the geometry of the data object.

id: str

A string representing the unique identifier of the data object.

time_range: TimeRange

A TimeRange representing the timestamps of to the beginning and end of sample.

class vibe_core.data.sentinel.DownloadedSentinel1Product(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, sensor_mode, polarisation_mode, asset_map=<factory>)

Bases: Sentinel1Product

Represents a downloaded Sentinel-1 product.

add_zip_asset(asset_path)

A method that adds a downloaded zip asset to the asset map of the DownloadedSentinel1Product object.

Parameters:

asset_path (str) – The path to the downloaded zip file.

get_zip_asset()

A method that retrieves the downloaded zip asset.

Returns:

AssetVibe – The downloaded zip asset.

ZIP_FILE = 'zip'

The key for the zip asset in the asset map.

asset_map: Dict[str, str]

A dictionary mapping the band name to the asset ID.

class vibe_core.data.sentinel.DownloadedSentinel2Product(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, CLOUD_MASK='cloud_mask', asset_map=<factory>)

Bases: Sentinel2Product

Represents a downloaded Sentinel-2 product.

add_downloaded_band(band_name, asset_path)

A method that adds a downloaded band to the asset map of the DownloadedSentinel2Product object.

Parameters:
  • band_name (str) – The name of the band to add.

  • asset_path (str) – The path to the downloaded band file.

Raises:

ValueError – If the file type is not supported (types other than TIFF or JP2).

add_downloaded_cloudmask(asset_path)

A method that adds a downloaded cloud mask to the asset map of the DownloadedSentinel2Product object.

Parameters:

asset_path (str) – The path to the downloaded cloud mask file.

get_downloaded_band(band_name)

A method that returns the downloaded band asset for the given band name.

Parameters:

band_name (str) – The name of the band to return.

Returns:

AssetVibe – The downloaded band asset.

get_downloaded_cloudmask()

A method that retrieves the downloaded cloud mask asset.

Returns:

AssetVibe – The downloaded cloud mask asset.

CLOUD_MASK: str = 'cloud_mask'

The key for the cloud mask asset in the asset map.

asset_map: Dict[str, str]

A dictionary mapping the band name to the asset ID.

class vibe_core.data.sentinel.S2ProcessingLevel(value)

Bases: StrEnum

Enum for Sentinel 2 processing levels.

L1C = 'L1C'

Level 1C processing level.

L2A = 'L2A'

Level 2A processing level.

class vibe_core.data.sentinel.Sentinel1Product(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, sensor_mode, polarisation_mode)

Bases: SentinelProduct

Represents a Sentinel-1 product metadata.

polarisation_mode: str

The polarisation mode of the Sentinel-1 product.

sensor_mode: str

The sensor mode of the Sentinel-1 product.

class vibe_core.data.sentinel.Sentinel1Raster(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, sensor_mode, polarisation_mode, bands, tile_id)

Bases: Raster, Sentinel1Product

Represents a raster for a Sentinel-1 product.

tile_id: str

The tile ID of the raster.

class vibe_core.data.sentinel.Sentinel1RasterOrbitGroup(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, sensor_mode, polarisation_mode, bands, tile_id, asset_map=<factory>)

Bases: Sentinel1Raster

Represents a group of Sentinel-1 raster orbits.

add_raster(raster)

A method that adds a raster to the orbit group.

Parameters:

raster (Sentinel1Raster) – The raster to add to the orbit group.

get_ordered_assets()

A method that returns the assets in the orbit group in ascending order of acquisition date.

Returns:

List[AssetVibe] – The list of sorted assets in the orbit group.

asset_map: Dict[str, str]

A dictionary mapping the asset ID to the acquisition date.

class vibe_core.data.sentinel.Sentinel1RasterTileSequence(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, sensor_mode, polarisation_mode, bands, tile_id, asset_order=<factory>, asset_time_range=<factory>, asset_geometry=<factory>, write_time_range=<factory>)

Bases: TileSequence, Sentinel1Raster

Represents a sequence of Sentinel-1 rasters for a tile.

write_time_range: Tuple[datetime, datetime]

The time range of the sequence.

class vibe_core.data.sentinel.Sentinel2CloudMask(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, bands, categories)

Bases: CloudMask, Sentinel2Product

Represents a cloud mask raster for a Sentinel-2 product.

assets: List[AssetVibe]

A list of AssetVibe objects of the assets associated with the data object.

bands: Dict[str, int]

A dictionary with the name of each band and its index in the raster data.

bbox: BBox

A BBox representing the bounding box of the data object. This field is calculated from the geometry property using the shapely.geometry library.

categories: List[str]

The list of categories in the raster.

extra_info: Dict[str, Any]

A dictionary with extra information about the Sentinel product.

geometry: Dict[str, Any]

A dictionary representing the geometry of the data object.

id: str

A string representing the unique identifier of the data object.

orbit_direction: str

The orbit direction of the Sentinel product.

orbit_number: int

The orbit number of the Sentinel product.

platform: str

The platform of the Sentinel product.

processing_level: str

The processing level of the Sentinel-2 product.

product_name: str

The name of the Sentinel product.

relative_orbit_number: int

The relative orbit number of the Sentinel product.

tile_id: str

The tile ID of the Sentinel-2 product.

time_range: TimeRange

A TimeRange representing the timestamps of to the beginning and end of sample.

class vibe_core.data.sentinel.Sentinel2CloudMaskOrbitGroup(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, bands, categories, asset_map=<factory>)

Bases: Sentinel2CloudMask

Represents a group of Sentinel-2 cloud mask orbits.

add_raster(raster)

A method that adds a raster to the orbit group.

Parameters:

raster (Sentinel2CloudMask) – The raster to add to the orbit group.

get_ordered_assets()

A method that returns the assets in the orbit group in ascending order of acquisition date.

Returns:

List[AssetVibe] – The list of sorted assets in the orbit group.

asset_map: Dict[str, str]

A dictionary mapping the asset ID to the acquisition date.

class vibe_core.data.sentinel.Sentinel2CloudMaskTileSequence(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, bands, categories, asset_order=<factory>, asset_time_range=<factory>, asset_geometry=<factory>, write_time_range=<factory>)

Bases: TileSequence, Sentinel2CloudMask

Represents a sequence of Sentinel-2 cloud masks for a tile.

write_time_range: Tuple[datetime, datetime]

The time range of the sequence.

class vibe_core.data.sentinel.Sentinel2CloudProbability(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level)

Bases: CloudRaster, Sentinel2Product

Represents a cloud probability raster for a Sentinel-2 product.

assets: List[AssetVibe]

A list of AssetVibe objects of the assets associated with the data object.

bands: Dict[str, int]

A dictionary with the name of each band and its index in the raster data.

bbox: BBox

A BBox representing the bounding box of the data object. This field is calculated from the geometry property using the shapely.geometry library.

geometry: Dict[str, Any]

A dictionary representing the geometry of the data object.

id: str

A string representing the unique identifier of the data object.

time_range: TimeRange

A TimeRange representing the timestamps of to the beginning and end of sample.

class vibe_core.data.sentinel.Sentinel2Product(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level)

Bases: SentinelProduct

Represents a Sentinel-2 product metadata.

processing_level: str

The processing level of the Sentinel-2 product.

tile_id: str

The tile ID of the Sentinel-2 product.

class vibe_core.data.sentinel.Sentinel2Raster(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, bands)

Bases: Raster, Sentinel2Product

Represents a raster for a Sentinel-2 product.

assets: List[AssetVibe]

A list of AssetVibe objects of the assets associated with the data object.

bands: Dict[str, int]

A dictionary with the name of each band and its index in the raster data.

bbox: BBox

A BBox representing the bounding box of the data object. This field is calculated from the geometry property using the shapely.geometry library.

geometry: Dict[str, Any]

A dictionary representing the geometry of the data object.

id: str

A string representing the unique identifier of the data object.

time_range: TimeRange

A TimeRange representing the timestamps of to the beginning and end of sample.

class vibe_core.data.sentinel.Sentinel2RasterOrbitGroup(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, bands, asset_map=<factory>)

Bases: Sentinel2Raster

Represents a group of Sentinel-2 raster orbits.

add_raster(raster)

A method that adds a raster to the orbit group.

Parameters:

raster (Sentinel2Raster) – The raster to add to the orbit group.

get_ordered_assets()

A method that returns the assets in the orbit group in ascending order of acquisition date.

Returns:

List[AssetVibe] – The list of sorted assets in the orbit group.

asset_map: Dict[str, str]

A dictionary mapping the asset ID to the acquisition date.

class vibe_core.data.sentinel.Sentinel2RasterTileSequence(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, bands, asset_order=<factory>, asset_time_range=<factory>, asset_geometry=<factory>, write_time_range=<factory>)

Bases: TileSequence, Sentinel2Raster

Represents a sequence of Sentinel-2 rasters for a tile.

write_time_range: Tuple[datetime, datetime]

The time range of the sequence.

class vibe_core.data.sentinel.SentinelProduct(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info)

Bases: DataVibe

Represents a Sentinel product metadata (does not include the image data).

extra_info: Dict[str, Any]

A dictionary with extra information about the Sentinel product.

orbit_direction: str

The orbit direction of the Sentinel product.

orbit_number: int

The orbit number of the Sentinel product.

platform: str

The platform of the Sentinel product.

product_name: str

The name of the Sentinel product.

relative_orbit_number: int

The relative orbit number of the Sentinel product.

class vibe_core.data.sentinel.SentinelRaster(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, bands)

Bases: Raster, SentinelProduct

Represents a raster for a Sentinel product.

assets: List[AssetVibe]

A list of AssetVibe objects of the assets associated with the data object.

bands: Dict[str, int]

A dictionary with the name of each band and its index in the raster data.

bbox: BBox

A BBox representing the bounding box of the data object. This field is calculated from the geometry property using the shapely.geometry library.

geometry: Dict[str, Any]

A dictionary representing the geometry of the data object.

id: str

A string representing the unique identifier of the data object.

time_range: TimeRange

A TimeRange representing the timestamps of to the beginning and end of sample.

class vibe_core.data.sentinel.SpaceEyeRaster(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, bands)

Bases: Sentinel2Raster

Represents a SpaceEye raster.

assets: List[AssetVibe]

A list of AssetVibe objects of the assets associated with the data object.

bands: Dict[str, int]

A dictionary with the name of each band and its index in the raster data.

bbox: BBox

A BBox representing the bounding box of the data object. This field is calculated from the geometry property using the shapely.geometry library.

extra_info: Dict[str, Any]

A dictionary with extra information about the Sentinel product.

geometry: Dict[str, Any]

A dictionary representing the geometry of the data object.

id: str

A string representing the unique identifier of the data object.

orbit_direction: str

The orbit direction of the Sentinel product.

orbit_number: int

The orbit number of the Sentinel product.

platform: str

The platform of the Sentinel product.

processing_level: str

The processing level of the Sentinel-2 product.

product_name: str

The name of the Sentinel product.

relative_orbit_number: int

The relative orbit number of the Sentinel product.

tile_id: str

The tile ID of the Sentinel-2 product.

time_range: TimeRange

A TimeRange representing the timestamps of to the beginning and end of sample.

class vibe_core.data.sentinel.SpaceEyeRasterSequence(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, tile_id, processing_level, bands, asset_order=<factory>, asset_time_range=<factory>, asset_geometry=<factory>, write_time_range=<factory>)

Bases: TileSequence, SpaceEyeRaster

Represents a sequence of SpaceEye rasters for a tile.

write_time_range: Tuple[datetime, datetime]

The time range of the sequence.

class vibe_core.data.sentinel.TileSequence(id, time_range, geometry, assets, bands, asset_order=<factory>, asset_time_range=<factory>, asset_geometry=<factory>, write_time_range=<factory>)

Bases: RasterSequence

Represents a sequence of rasters for a tile.

write_time_range: Tuple[datetime, datetime]

The time range of the sequence.

class vibe_core.data.sentinel.TiledSentinel1Product(id, time_range, geometry, assets, product_name, orbit_number, relative_orbit_number, orbit_direction, platform, extra_info, sensor_mode, polarisation_mode, asset_map=<factory>, tile_id='')

Bases: DownloadedSentinel1Product

Represents a tiled Sentinel-1 product.

tile_id: str = ''

The tile ID of the product.

vibe_core.data.sentinel.discriminator_date(product_name)

A function that extracts the date from a Sentinel-2 product name.

Parameters:

product_name (str) – The name of the Sentinel-2 product.

Returns:

datetime – The date of the Sentinel-2 product as a datetime object.

vibe_core.data.sentinel.ListTileData

A type alias for a list of TileData.

alias of List[Union[Sentinel1Raster, Sentinel2Raster, Sentinel2CloudMask]]

vibe_core.data.sentinel.Sequence2Tile = {<class 'vibe_core.data.sentinel.Sentinel1RasterTileSequence'>: <class 'vibe_core.data.sentinel.Sentinel1Raster'>, <class 'vibe_core.data.sentinel.Sentinel2RasterTileSequence'>: <class 'vibe_core.data.sentinel.Sentinel2Raster'>, <class 'vibe_core.data.sentinel.Sentinel2CloudMaskTileSequence'>: <class 'vibe_core.data.sentinel.Sentinel2CloudMask'>, <class 'vibe_core.data.sentinel.SpaceEyeRasterSequence'>: <class 'vibe_core.data.sentinel.SpaceEyeRaster'>}

A dictionary mapping tile sequence data classes to tile data classes.

vibe_core.data.sentinel.Tile2Sequence = {<class 'vibe_core.data.sentinel.Sentinel1Raster'>: <class 'vibe_core.data.sentinel.Sentinel1RasterTileSequence'>, <class 'vibe_core.data.sentinel.Sentinel2Raster'>: <class 'vibe_core.data.sentinel.Sentinel2RasterTileSequence'>, <class 'vibe_core.data.sentinel.Sentinel2CloudMask'>: <class 'vibe_core.data.sentinel.Sentinel2CloudMaskTileSequence'>}

A dictionary mapping the tile data classes to the tile sequence data classes.

vibe_core.data.sentinel.TileData

A type alias for any of the tile data classes (Sentinel1Raster, Sentinel2Raster, and Sentinel2CloudMask).

alias of Union[Sentinel1Raster, Sentinel2Raster, Sentinel2CloudMask]

vibe_core.data.sentinel.TileSequenceData

A type alias for any of the tile sequence data classes (Sentinel1RasterTileSequence, Sentinel2RasterTileSequence, and Sentinel2CloudMaskTileSequence).

alias of Union[Sentinel1RasterTileSequence, Sentinel2RasterTileSequence, Sentinel2CloudMaskTileSequence]