easysnowdata.optical.sentinel2.load#

easysnowdata.optical.sentinel2.load(aoi: Any = None, time: Any = None, *, items: Any = None, bands: str | Sequence[str] | None = None, source: str | None = None, collection: str | None = None, resolution: float | None = None, crs: Any = 'utm', groupby: str = 'solar_day', mask: Any = None, harmonize: bool = True, scale: bool = True, mask_nodata: bool = True, cloud_cover: float | None = None, chunks: dict[str, Any] | None = None, **kwargs: Any) Dataset[source]#

Load Sentinel-2 L2A as a lazy xarray.Dataset (time, y, x).

Parameters:
  • aoi – The usual spatial and temporal inputs. clip=False on the AOI returns the covering tiles instead of the cut grid.

  • time – The usual spatial and temporal inputs. clip=False on the AOI returns the covering tiles instead of the cut grid.

  • items – A search result (GeoDataFrame or ItemCollection) to load instead of searching again.

  • bands – Common band names (DEFAULT_BANDS by default). "scl" is needed for masking.

  • source – Which catalog and collection to read (see search()).

  • collection – Which catalog and collection to read (see search()).

  • resolution – Passed to odc.stac.load; crs="utm" (default) picks the AOI’s UTM zone.

  • crs – Passed to odc.stac.load; crs="utm" (default) picks the AOI’s UTM zone.

  • groupby – Passed to odc.stac.load; crs="utm" (default) picks the AOI’s UTM zone.

  • chunks – Passed to odc.stac.load; crs="utm" (default) picks the AOI’s UTM zone.

  • **kwargs – Passed to odc.stac.load; crs="utm" (default) picks the AOI’s UTM zone.

  • maskNone/False (default) keeps every pixel; True or "scl-default" removes the legacy default SCL classes (no data, saturated, shadows, clouds, cirrus); a sequence selects classes by name or value.

  • harmonize – Put post-2022-01-25 scenes back on the old baseline: from the items’ raster:bands offsets where the catalog provides them, otherwise from the acquisition date (Planetary Computer).

  • scale – Convert the reflectance bands to 0–1 floats.

  • mask_nodata – NaN-mask the reflectance nodata value (0) and keep it as the encoded nodata. False returns the raw integers with rio.nodata set.

  • cloud_cover – Passed to search() when items is not given.