Skip to content

Commit c84c9b9

Browse files
committed
ENH: Add TerraSAR-X management of default resolution and pixel size for RE data
1 parent 7fef080 commit c84c9b9

2 files changed

Lines changed: 52 additions & 17 deletions

File tree

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
- **ENH: Desambiguate condensed name of Custom stack in case of creation of several objects with the same datetime and same constellation and product type**
66
- **ENH: Fix corrupted Maxar products with incoherent width between .IMD and .TIL files** [#242](https://github.com/sertit/eoreader/issues/242)
7+
- **ENH: Add TerraSAR-X management of default resolution and pixel size for RE data**
78
- FIX: Fix regression when stacking with a custom nodata value with VHR data to be reprojected
89
- FIX: Fix an unprecedented case with a PNEO having different name than usual (`DIM_PNEO3_STD_2025...` instead of `DIM_PNEO3_2025...`)
910
- FIX: Fix WV Legion wrong band order in Multi Spectral 1 mode [#246](https://github.com/sertit/eoreader/issues/246)
1011
- FIX: Collocate Planet spectral bands with masks for some rare cases where it fails
1112
- FIX: Loosen the constraints on PlanetScope stack name as it may change, from `Analytic` to `composite`, etc. [#244](https://github.com/sertit/eoreader/issues/244)
1213
- FIX: Add a fallback in case of impossibleness of reading ICEYE `QUICKLOOK.kml` file
1314
- FIX: Manage the case of Maxar data with negative absolute calibration factor: don't compute the reflectance and leave it as is.
14-
- FIX: Fix DEM management with RPC orthorectification: handle correctly the vertical CRS (see dem notebook and `EOREADER_DEM_VCRS` environment variable). [#53](https://github.com/sertit/eoreader/issues/53)
15+
- FIX: Fix DEM management with RPC orthorectification: handle correctly the vertical CRS (see DEM notebook and `EOREADER_DEM_VCRS` environment variable). [#53](https://github.com/sertit/eoreader/issues/53)
1516
- CI: Filter some warnings in pytest
1617

1718
## 0.22.4 (2025-07-07)

eoreader/products/sar/tsx_product.py

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ def _set_pixel_size(self) -> None:
196196
- We force Spatially Enhanced Resolution (SE) as we keep SSC resolutions (as per the ESA Data Access Portfolio)
197197
- We use the pixel_size from SE products, with incidence angle corresponding to the SSC resolution (or the highest pixel_spacing)
198198
"""
199-
# TODO: Manage RE case? Not handled by Copernicus EMS, so be careful...
200-
201199
# Read metadata
202200
try:
203201
root, _ = self.read_mtd()
204202
acq_info = root.find(".//acquisitionInfo")
205203
polarization = TsxPolarization.from_value(
206204
acq_info.findtext(".//polarisationMode")
207205
)
206+
res_variant = root.findtext(".//resolutionVariant")
207+
is_re = res_variant == "RE"
208208
except (InvalidProductError, TypeError) as exc:
209209
raise InvalidProductError(
210210
"acquisitionInfo or polarisationMode not found in metadata!"
@@ -214,29 +214,57 @@ def _set_pixel_size(self) -> None:
214214
def_pixel_size = None
215215
if self.sensor_mode == TsxSensorMode.HS:
216216
if polarization == TsxPolarization.S:
217-
def_pixel_size = 0.5
218-
def_res = 1.1
217+
if is_re:
218+
def_pixel_size = 1.5
219+
def_res = 3.1
220+
else:
221+
def_pixel_size = 0.5
222+
def_res = 1.4
219223
elif polarization == TsxPolarization.D:
220-
def_pixel_size = 1.0
221-
def_res = 2.2
224+
if is_re:
225+
def_pixel_size = 2.0
226+
def_res = 4.4
227+
else:
228+
def_pixel_size = 1.0
229+
def_res = 2.2
222230
elif self.sensor_mode == TsxSensorMode.SL:
223231
if polarization == TsxPolarization.S:
224-
def_pixel_size = 0.75
225-
def_res = 1.7
232+
if is_re:
233+
def_pixel_size = 1.75
234+
def_res = 3.8
235+
else:
236+
def_pixel_size = 0.75
237+
def_res = 1.7
226238
elif polarization == TsxPolarization.D:
227-
def_pixel_size = 1.0
228-
def_res = 3.4
239+
if is_re:
240+
def_pixel_size = 2.5
241+
def_res = 5.5
242+
else:
243+
def_pixel_size = 1.0
244+
def_res = 3.4
229245
elif self.sensor_mode == TsxSensorMode.ST:
230246
if polarization == TsxPolarization.S:
231-
def_pixel_size = 0.2
232-
def_res = 0.24
247+
if is_re:
248+
def_pixel_size = 0.4
249+
def_res = 0.9
250+
else:
251+
def_pixel_size = 0.2
252+
def_res = 0.24
233253
elif self.sensor_mode == TsxSensorMode.SM:
234254
if polarization == TsxPolarization.S:
235-
def_pixel_size = 1.25
236-
def_res = 3.3
255+
if is_re:
256+
def_pixel_size = 3.25
257+
def_res = 7.0
258+
else:
259+
def_pixel_size = 1.25
260+
def_res = 3.3
237261
elif polarization == TsxPolarization.D:
238-
def_pixel_size = 3.0
239-
def_res = 6.6
262+
if is_re:
263+
def_pixel_size = 4.5
264+
def_res = 9.9
265+
else:
266+
def_pixel_size = 3.0
267+
def_res = 6.6
240268
elif self.sensor_mode == TsxSensorMode.SC:
241269
# Read metadata
242270
try:
@@ -262,6 +290,12 @@ def _set_pixel_size(self) -> None:
262290
f"Unknown sensor mode: {self.sensor_mode} or unknown polarization: {polarization}"
263291
)
264292

293+
# Overrides the pixel size for ortho EEC products
294+
if self.product_type == TsxProductType.EEC:
295+
with rasterio.open(
296+
str(self.get_raw_band_paths()[self.get_default_band()])
297+
) as ds:
298+
def_pixel_size = ds.res[0]
265299
self.pixel_size = def_pixel_size
266300
self.resolution = def_res
267301

0 commit comments

Comments
 (0)