diff --git a/CHANGES.md b/CHANGES.md index 8e6ea44..9e2be80 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +## Changes in 0.2.5 (under development) + +* Added subsetting and reprojection in analysis mode via parameters `crs`, + `resolution`, and `bbox`. + ## Changes in 0.2.4 (from 2025-11-17) * Added support for **common band names** from the [STAC EO extension](https://github.com/stac-extensions/eo?tab=readme-ov-file#common-band-names) diff --git a/docs/guide.md b/docs/guide.md index b75e002..1cbd9ff 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -36,10 +36,14 @@ form. All bands and quality flags are resampled to a unified, user-provided reso Parameters `**kwargs`: - `resolution`: Target resolution for all spatial data variables / bands. +- `crs`: Coordinate reference system of the output dataset. If not provided, a + mission-specific default CRS is used (see the respective mission sections below). +- `bbox`: Bounding box `[west, south, east, north]` used for spatial subsetting; + coordinates must be in the same CRS as `crs`. - `interp_methods`: for upsampling / interpolating - spatial data variables. Can be a single interpolation method for all - variables or a dictionary mapping variable names or dtypes to - interpolation method. Supported methods include: + spatial data variables. Can be a single interpolation method for all + variables or a dictionary mapping variable names or dtypes to + interpolation method. Supported methods include: - `0` (nearest neighbor) - `1` (linear / bilinear) @@ -47,14 +51,15 @@ Parameters `**kwargs`: - `"triangular"` - `"bilinear"` - The default is `0` for integer arrays (e.g. Sentinel-2 L2A SCL), - else `1`. + The default is `0` for integer arrays (e.g. Sentinel-2 L2A SCL), + else `1`. For more information view [xcube-resampling Documentation](https://xcube-dev.github.io/xcube-resampling/guide/#spatial-resampling-algorithms). - `agg_methods`: Optional aggregation methods to be used for downsampling spatial data variables / bands. Can be a single method for all variables or a dictionary mapping variable names or dtypes to methods. Supported methods include: `"center"`, `"count"`, `"first"`, `"last"`, `"max"`, `"mean"`, `"median"`, `"mode"`, `"min"`, `"prod"`, `"std"`, `"sum"`, and `"var"`. Defaults to `"center"` for integer arrays (e.g. Sentinel-2 L2A SCL), else `"mean"`. + For more information view [xcube-resampling Documentation](https://xcube-dev.github.io/xcube-resampling/guide/#spatial-resampling-algorithms). - `variables`: Variables to include in the dataset. Can be a name or regex pattern or iterable of the latter. - `product_type`: Product type name, such as `"MSIL1C"`. @@ -88,12 +93,22 @@ bands from multiple resolutions onto the same grid using [affine transformation - [Sentinel-2 Level-1C](https://stac.browser.user.eopf.eodc.eu/collections/sentinel-2-l1c) - [Sentinel-2 Level-2A](https://stac.browser.user.eopf.eodc.eu/collections/sentinel-2-l2a) +**Supported Variables** + +- **Surface reflectance bands**: + `b01`, `b02`, `b03`, `b04`, `b05`, `b06`, `b07`, `b08`, `b8a`, `b09`, `b11`, `b12` +- **Classification/Quality layers** (L2A only): + `cld`, `scl`, `snw` + **Specific Sentinel-2 parameters `**kwargs`:** -- `variables`: The common spectral band names specified in the [STAC EO extension](https://github.com/stac-extensions/eo?tab=readme-ov-file#common-band-names) - are supported for the Sentinel-2 analysis mode. -- `resolution`: Target resolution for all spatial data variables / bands. - Must be one of `10`, `20`, or `60`. +- `variables`: Select specific spectral bands using the names listed above in + *Supported Variables*. Common spectral band names from the [STAC EO extension](https://github.com/stac-extensions/eo?tab=readme-ov-file#common-band-names) are also supported for Sentinel-2 analysis mode. +- `crs`: Coordinate reference system of the output dataset. + If not specified, the UTM grid of the native data is used. +- `resolution`: Target resolution for all spatial variables/bands. + Choose 10, 20, or 60 meters to minimize resampling and retain some of the native + data resolution. Examples: - [Example notebook - open-sen2.ipynb](https://github.com/EOPF-Sample-Service/xarray-eopf/blob/main/examples/open-sen2.ipynb) @@ -128,6 +143,41 @@ for details. - [Sentinel-3 SLSTR Level-1 RBT](https://stac.browser.user.eopf.eodc.eu/collections/sentinel-3-slstr-l1-rbt) - [Sentinel-3 SLSTR Level-2 LST](https://stac.browser.user.eopf.eodc.eu/collections/sentinel-3-slstr-l2-lst) + +**Supported Variables:** +- `sentinel-3-olci-l1-efr`: + `oa01_radiance`, `oa02_radiance`, `oa03_radiance`, `oa04_radiance`, `oa05_radiance`, + `oa06_radiance`, `oa07_radiance`, `oa08_radiance`, `oa09_radiance`, `oa10_radiance`, + `oa11_radiance`, `oa12_radiance`, `oa13_radiance`, `oa14_radiance`, `oa15_radiance`, + `oa16_radiance`, `oa17_radiance`, `oa18_radiance`, `oa19_radiance`, `oa20_radiance`, + `oa21_radiance` +- `sentinel-3-olci-l2-lfr`: + `gifapar`, `iwv`, `otci`, `rc681`, `rc865` +- `sentinel-3-slstr-l1-rbt`: + `s1_radiance_an`, `s2_radiance_an`, `s3_radiance_an`, `s4_radiance_an`, + `s5_radiance_an`, `s6_radiance_an`, `s1_radiance_ao`, `s2_radiance_ao`, + `s3_radiance_ao`, `s4_radiance_ao`, `s5_radiance_ao`, `s6_radiance_ao`, + `s4_radiance_bn`, `s5_radiance_bn`, `s6_radiance_bn`, `s4_radiance_bo`, + `s5_radiance_bo`, `s6_radiance_bo`, `f1_bt_fn`, `f1_bt_fo`, `f2_bt_in`, + `f2_bt_io`, `s7_bt_in`, `s8_bt_in`, `s9_bt_in`, `s7_bt_io`, `s8_bt_io`, + `s9_bt_io` +- `sentinel-3-slstr-l2-lst`: + `lst` + +**Specific Sentinel-2 parameters `**kwargs`:** + +- `variables`: Select variables using the names listed above in *Supported Variables*. +- `crs`: Coordinate reference system of the output dataset. + If not specified, [EPSG:4326](https://epsg.io/4326) is used. +- `resolution`: Target resolution for all spatial variables/bands. + If not specified, the default is set per product: + + - Sentinel-3 OLCI Level-1 EFR: 300 meter + - Sentinel-3 OLCI Level-1 ERR: 1200 meter + - Sentinel-3 OLCI Level-2 LFR: 300 meter + - Sentinel-3 SLSTR Level-1 RBT: 500 meter (1000 meter if selected variables come from F- or I-stripe) + - Sentinel-3 SLSTR Level-2 LST: 1000 meter + Example: - [Example notebook (open-sen3.ipynb)](https://github.com/EOPF-Sample-Service/xarray-eopf/blob/main/examples/open-sen3.ipynb) diff --git a/examples/open-sen1.ipynb b/examples/open-sen1.ipynb index d199a1f..26817fb 100644 --- a/examples/open-sen1.ipynb +++ b/examples/open-sen1.ipynb @@ -37,9 +37,7 @@ "cell_type": "code", "execution_count": 3, "id": "a4c6364b-5573-4cfd-9426-3f68aa8fb469", - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [ { "data": { @@ -491,7 +489,7 @@ "Dimensions: ()\n", "Data variables:\n", " *empty*\n", - "Attributes: (2)