earthdaily.earthdatastore.cube_utils.rescale_assets_with_items

earthdaily.earthdatastore.cube_utils.rescale_assets_with_items(items_collection, ds, assets=None, boa_offset_applied_control=True, boa_offset_applied_force_by_date=True)[source]

Rescale assets in a dataset based on collection items’ metadata.

Parameters:
  • items_collection (List) – Collection of items containing asset scaling information.

  • ds (xarray.Dataset) – Input dataset to be rescaled.

  • assets (List[str], optional) – List of assets to rescale. If None, uses all dataset variables.

  • boa_offset_applied_control (bool, default True) – Apply Bottom of Atmosphere (BOA) offset control for Sentinel-2 L2A data.

  • boa_offset_applied_force_by_date (bool, default True) – Force BOA offset application for dates after 2022-02-28.

Returns:

Rescaled dataset with applied offsets and scales.

Return type:

xarray.Dataset

Raises:

ValueError – If there’s a mismatch between items and datacube time or dates.