Skip to content

Commit

Permalink
ENH: Calibration step for Capella products now exists in ESA SNAP. …
Browse files Browse the repository at this point in the history
…Add it in pre-processing.
  • Loading branch information
remi-braun committed Nov 14, 2023
1 parent 9ee2c2e commit 9a22bc5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- **ENH: Manage Sentinel-2 as formatted on the cloud (Element84 or Sinergise's way). ([#104](https://github.com/sertit/eoreader/issues/104)**
- **ENH: Handle Python 3.12. ([#113](https://github.com/sertit/eoreader/issues/113)**
- **ENH: Guard against S1 COG format, not yet handled by SNAP.**
- **ENH: Calibration step for `Capella` products now exists in ESA SNAP. Add it in pre-processing.**
- FIX: Fix jpg, png... quicklooks management when plotting
- FIX: Fix an `xarray` issue when trying to compute percentiles when stacking bands
- CI: Update pre-commit hooks
Expand Down
12 changes: 7 additions & 5 deletions eoreader/products/sar/capella_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ def _set_pixel_size(self) -> None:
def _set_instrument(self) -> None:
"""
Set instrument
ICEYE: https://earth.esa.int/eogateway/missions/iceye
"""
self.instrument = "SAR X-band"

Expand All @@ -209,7 +207,11 @@ def _post_init(self, **kwargs) -> None:
"""
# Private attributes
self.snap_filename = str(next(self.path.glob("*CAPELLA*.json")).name)
self._raw_band_regex = f"{self.name}.tif"
try:
self._raw_band_regex = str(next(self.path.glob(f"{self.name}.tif")).name)
except StopIteration:
# For SICD and SIDD
self._raw_band_regex = str(next(self.path.glob(f"{self.name}.ntf")).name)

# Post init done by the super class
super()._post_init(**kwargs)
Expand Down Expand Up @@ -420,7 +422,7 @@ def _read_mtd(self) -> (etree._Element, dict):
def get_raw_band_paths(self, **kwargs) -> dict:
"""
Return the existing path of the VV band (as they come with the archived products).
ICEYE product only contains a VV band !
Capella product only contains a VV band !
Args:
**kwargs: Additional arguments
Expand All @@ -436,7 +438,7 @@ def get_raw_band_paths(self, **kwargs) -> dict:
)
except FileNotFoundError:
raise InvalidProductError(
"An ICEYE product should at least contain one band !"
f"An {self.constellation.name} product should at least contain one band !"
)

return band_paths
Expand Down
9 changes: 1 addition & 8 deletions eoreader/products/sar/sar_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,7 @@ def _pre_process_sar(self, band: sab, pixel_size: float = None, **kwargs) -> str

# Pre-process graph
if PP_GRAPH not in os.environ:
if self.constellation == Constellation.CAPELLA:
LOGGER.debug(
"SNAP Error: [NodeId: Calibration] Mission Capella is currently not supported for calibration. Removing this step."
)
pp_graph = utils.get_data_dir().joinpath(
"grd_sar_preprocess_fallback.xml"
)
elif (
if (
self.constellation == Constellation.CSG
and self.sar_prod_type == SarProductType.CPLX
):
Expand Down
2 changes: 1 addition & 1 deletion eoreader/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class Constellation(ListEnum):
Constellation.MAXAR: r"\d{12}_\d{2}_P\d{3}_(MUL|PAN|PSH|MOS)",
Constellation.ICEYE: r"((SM|SL|SC|SLEA)[HW]*_\d{5,}|ICEYE_X\d_(SM|SL|SC|SLEA)H*_\d{5,}_\d{8}T\d{6})",
Constellation.SAOCOM: r".+EOL1[ABCD]SARSAO1[AB]\d+(-product|)",
Constellation.CAPELLA: r"CAPELLA_C\d{2}_S[PMS]_(GEO|GEC|SLC)_(HH|VV)_\d{14}_\d{14}",
Constellation.CAPELLA: r"CAPELLA_C\d{2}_S[PMS]_(GEO|GEC|SLC|SICD|SIDD)_(HH|VV)_\d{14}_\d{14}",
Constellation.SV1: [
r"\d{13}_\d{2}",
r"SV1-0[1-4]_\d{8}_L(1B|2A)\d{10}_\d{13}_\d{2}-(MUX|PSH)\.xml",
Expand Down

0 comments on commit 9a22bc5

Please sign in to comment.