Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Changes in 0.2.9 (under development)
## Changes in 0.2.9 (from 2026-06-03)

- Add support for Sentinel-1 Level-2 OCN analysis mode.
- Added support for Sentinel-1 Level-2 OCN analysis mode.
- Fixed an issue in Sentinel-1 GRD analysis mode that could produce NaN values along
the edges of the bounding box.

## Changes in 0.2.8 (from 2026-05-08)

Expand Down
189 changes: 94 additions & 95 deletions docs/examples/sentinel_1_analysis.ipynb

Large diffs are not rendered by default.

28 changes: 13 additions & 15 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,15 @@ longitude coordinates.
- `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:
interpolation method (for more information view [xcube-resampling Documentation](https://xcube-dev.github.io/xcube-resampling/guide/#spatial-resampling-algorithms)).
Supported methods include:

- `0` (nearest neighbor)
- `1` (linear / bilinear)
- `0` (nearest neighbor, default for integer arrays)
- `1` (linear / bilinear, default for float arrays)
- `"nearest"`
- `"triangular"`
- `"bilinear"`

The default is `0` for integer arrays,
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:
Expand Down Expand Up @@ -209,16 +208,15 @@ bands from multiple resolutions onto the same grid using [affine transformation
- `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:
interpolation method (for more information view [xcube-resampling Documentation](https://xcube-dev.github.io/xcube-resampling/guide/#spatial-resampling-algorithms)).
Supported methods include:

- `0` (nearest neighbor)
- `1` (linear / bilinear)
- `0` (nearest neighbor, default for integer arrays)
- `1` (linear / bilinear, default for float arrays)
- `"nearest"`
- `"triangular"`
- `"bilinear"`

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:
Expand Down Expand Up @@ -300,19 +298,19 @@ for details.
- 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

- `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:
interpolation method (for more information view [xcube-resampling Documentation](https://xcube-dev.github.io/xcube-resampling/guide/#spatial-resampling-algorithms)).
Supported methods include:

- `0` (nearest neighbor)
- `1` (linear / bilinear)
- `0` (nearest neighbor, default for integer arrays)
- `1` (linear / bilinear, default for float arrays)
- `"nearest"`
- `"triangular"`
- `"bilinear"`

The default is `0` for integer arrays,
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:
Expand Down
206 changes: 102 additions & 104 deletions examples/sentinel_1_analysis.ipynb

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions xarray_eopf/amodes/sentinel1.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ def simulate_acquisition(
return out


def compute_dem_area(dem_ecef: xr.DataArray, gm_dem: xr.DataArray) -> xr.DataArray:
def compute_dem_area(dem_ecef: xr.DataArray, gm_dem: GridMapping) -> xr.DataArray:
"""Compute per-pixel surface area on the DEM in ECEF coordinates.

Args:
Expand Down Expand Up @@ -871,8 +871,16 @@ def compute_dem_area(dem_ecef: xr.DataArray, gm_dem: xr.DataArray) -> xr.DataArr

# interpolate DEM to pixel corners
chunksizes = {key: val[0] for key, val in dem_ecef.chunksizes.items()}
xyz_c = dem_ecef.interp({x_dim: x_corner}).chunk({x_dim: chunksizes[x_dim]})
xyz_c = xyz_c.interp({y_dim: y_corner}).chunk(chunksizes)
xyz_c = dem_ecef.interp(
{x_dim: x_corner},
method="linear",
kwargs={"fill_value": "extrapolate"},
).chunk({x_dim: chunksizes[x_dim]})
xyz_c = xyz_c.interp(
{y_dim: y_corner},
method="linear",
kwargs={"fill_value": "extrapolate"},
).chunk(chunksizes)

# compute edge vectors
dx = xyz_c.diff(x_dim)
Expand Down Expand Up @@ -902,7 +910,7 @@ def compute_dem_area(dem_ecef: xr.DataArray, gm_dem: xr.DataArray) -> xr.DataArr


def compute_gamma_area(
dem_ecef: xr.DataArray, gm_dem: xr.DataArray, direction: xr.DataArray
dem_ecef: xr.DataArray, gm_dem: GridMapping, direction: xr.DataArray
) -> xr.DataArray:
"""Compute gamma area by projecting DEM areas onto look direction.

Expand Down
5 changes: 3 additions & 2 deletions xarray_eopf/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ def open_dataset(
using [`pyproj.crs.CRS.from_string`](https://pyproj4.github.io/pyproj/dev/api/crs/crs.html#pyproj.crs.CRS.from_string).
interp_methods: Optional interpolation method to be used if
`op_mode="analysis"`,
- for Sentinel-1:

- for Sentinel-1 GRD:
method used during geometric and radiometric terrain correction
(GTC and RTC).

- `"nearest"`
- `"bilinear"`

- for Sentinel-2 and Sentinel-3:
- for Sentinel-1 OCN, Sentinel-2, and Sentinel-3:
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.
Expand Down
2 changes: 1 addition & 1 deletion xarray_eopf/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Permissions are hereby granted under the terms of the Apache 2.0 License:
# https://opensource.org/license/apache-2-0.

version = "0.2.9.dev0"
version = "0.2.9"
Loading