Skip to content

Catalog

cdse.catalog.Catalog

STAC API catalog search for CDSE.

This class provides search functionality using the CDSE STAC API to find satellite products based on various criteria.

Attributes:

Name Type Description
CATALOG_URL

CDSE STAC API endpoint

COLLECTIONS

Available data collections

Example

catalog = Catalog(session) products = catalog.search( ... bbox=[9.0, 45.0, 9.5, 45.5], ... start_date="2024-01-01", ... end_date="2024-01-31" ... )

__init__(session: requests.Session)

Initialize catalog with authenticated session.

Parameters:

Name Type Description Default
session Session

Authenticated requests session (from OAuth2Auth)

required

search(bbox: list[float], start_date: str, end_date: str, collection: str = 'sentinel-2-l2a', cloud_cover_max: float = 100.0, limit: int = 10, **kwargs: Any) -> list[Product]

Search for products in the CDSE catalog.

Parameters:

Name Type Description Default
bbox list[float]

Bounding box [min_lon, min_lat, max_lon, max_lat]

required
start_date str

Start date in ISO format (YYYY-MM-DD)

required
end_date str

End date in ISO format (YYYY-MM-DD)

required
collection str

Collection name (default: sentinel-2-l2a)

'sentinel-2-l2a'
cloud_cover_max float

Maximum cloud coverage percentage (0-100)

100.0
limit int

Maximum number of results

10
**kwargs Any

Additional STAC API parameters

{}

Returns:

Type Description
list[Product]

List of Product objects matching the search criteria

Raises:

Type Description
ValidationError

If input parameters are invalid

CatalogError

If the API request fails

search_by_point(lon: float, lat: float, buffer_km: float = 10.0, **kwargs: Any) -> list[Product]

Search for products by geographic point.

Parameters:

Name Type Description Default
lon float

Longitude (-180 to 180)

required
lat float

Latitude (-90 to 90)

required
buffer_km float

Search radius in kilometers (default: 10)

10.0
**kwargs Any

Additional search parameters (passed to search())

{}

Returns:

Type Description
list[Product]

List of Product objects

get_collections() -> dict[str, str]

Get available collections.

Returns:

Type Description
dict[str, str]

Dictionary mapping collection IDs to descriptions.

search_by_name(name: str, exact: bool = True) -> Optional[Product]

Search for a product by name.

Parameters:

Name Type Description Default
name str

Product name (e.g., S2A_MSIL2A_20240115...)

required
exact bool

If True, require exact match. If False, use prefix match.

True

Returns:

Type Description
Optional[Product]

Product if found, None otherwise

Raises:

Type Description
CatalogError

If API request fails

search_by_id(product_id: str) -> Optional[Product]

Search for a product by UUID.

Parameters:

Name Type Description Default
product_id str

Product UUID

required

Returns:

Type Description
Optional[Product]

Product if found, None otherwise

Raises:

Type Description
CatalogError

If API request fails