Skip to content

Commit

Permalink
FIX: Remove multi-swath workaround for Cosmo products if SNAP > 11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-braun committed Nov 8, 2024
1 parent f7c9a71 commit ba87416
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- FIX: Handle ICEYE products with missing quicklook
- FIX: Fix Sentinel-1 name with weird PDFs names (i.e. ending with `.SAFE-report...`)
- FIX: Remove multi-swath workaround for Cosmo products if SNAP > 11.0
- FIX: By default, try to assign a constellation (in a pure dummy way) to any `Product` created
- FIX: Add ways of knowing if a constellation is a real one or not (i.e. CUSTOM or template such as Maxar)
- FIX: Create TDX and PAZ (completely inherited) classes to disambiguate their constellations
Expand Down
7 changes: 5 additions & 2 deletions eoreader/products/sar/cosmo_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from lxml import etree
from lxml.builder import E
from rasterio import merge
from sertit import AnyPath, path, rasters, rasters_rio, strings, vectors
from sertit import AnyPath, misc, path, rasters, rasters_rio, strings, vectors
from sertit.misc import ListEnum
from sertit.types import AnyPathStrType
from shapely.geometry import Polygon, box
Expand Down Expand Up @@ -484,12 +484,15 @@ def _pre_process_sar(self, band, pixel_size: float = None, **kwargs) -> str:
Returns:
str: Band path
"""
if misc.compare_version(self.get_snap_version(), "11.0.0", ">="):
return super()._pre_process_sar(band, pixel_size=pixel_size, **kwargs)

with h5netcdf.File(self._img_path, phony_dims="access") as raw_h5:
if self.nof_swaths == 1:
return super()._pre_process_sar(band, pixel_size, **kwargs)
else:
LOGGER.warning(
"Currently, SNAP doesn't handle multiswath Cosmo-SkyMed products. This is a workaround. See https://github.com/sertit/eoreader/issues/78"
"SNAP (before version 11.0.0) doesn't handle multiswath Cosmo-SkyMed products. This is a workaround. See https://github.com/sertit/eoreader/issues/78"
)

# For every swath, pre-process the swath array alone
Expand Down

0 comments on commit ba87416

Please sign in to comment.