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

Data types and supporting functions for Sentinel data in FarmVibes.AI.

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

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

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

Represent a downloaded Sentinel-1 product.

add_zip_asset(asset_path)

Add a downloaded zip asset to the asset map of a DownloadedSentinel1Product.

Parameters:

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

get_zip_asset()

Retrieve the downloaded zip asset.

Returns:

The downloaded zip asset.

Return type:

AssetVibe

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

Represent a downloaded Sentinel-2 product.

add_downloaded_band(band_name, asset_path)

Add a downloaded band to the asset map of a 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)

Add a downloaded cloud mask to the asset map.

Parameters:

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

get_downloaded_band(band_name)

Return the downloaded band asset for the given band name.

Parameters:

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

Returns:

The downloaded band asset.

Return type:

AssetVibe

get_downloaded_cloudmask()

Retrieve the downloaded cloud mask asset.

Returns:

The downloaded cloud mask asset.

Return type:

AssetVibe

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

Represent 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

Represent 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

Represent a group of Sentinel-1 raster orbits.

add_raster(raster)

Add a raster to the orbit group.

Parameters:

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

get_ordered_assets()

Return the assets in the orbit group in ascending order of acquisition date.

Returns:

The list of sorted assets in the orbit group.

Return type:

List[AssetVibe]

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

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

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

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

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

Represent a group of Sentinel-2 cloud mask orbits.

add_raster(raster)

Add a raster to the orbit group.

Parameters:

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

get_ordered_assets()

Return the assets in the orbit group in ascending order of acquisition date.

Returns:

The list of sorted assets in the orbit group.

Return type:

List[AssetVibe]

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

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

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

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

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

Represent 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

Represent a raster for a Sentinel-2 product.

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

Represent a group of Sentinel-2 raster orbits.

add_raster(raster)

Add a raster to the orbit group.

Parameters:

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

get_ordered_assets()

Return the assets in the orbit group in ascending order of acquisition date.

Returns:

The list of sorted assets in the orbit group.

Return type:

List[AssetVibe]

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

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

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

Represent 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

Represent a raster for a Sentinel product.

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

Represent a SpaceEye raster.

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

Represent a sequence of SpaceEye rasters for a tile.

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

Represent 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

Represent a tiled Sentinel-1 product.

tile_id: str = ''

The tile ID of the product.

vibe_core.data.sentinel.discriminator_date(product_name)

Extract the date from a Sentinel-2 product name.

Parameters:

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

Returns:

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

Return type:

datetime

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]