Skip to content

ERS and Envisat processing#360

Merged
johntruckenbrodt merged 47 commits intomainfrom
feature/ers_envisat
Oct 29, 2025
Merged

ERS and Envisat processing#360
johntruckenbrodt merged 47 commits intomainfrom
feature/ers_envisat

Conversation

@johntruckenbrodt
Copy link
Copy Markdown
Owner

@johntruckenbrodt johntruckenbrodt commented Sep 4, 2025

This implements several changes to enable/improve ERS and Envisat processing..

snap

  • auxil.orb_parametrize: improved ERS/ASAR orbit handling (more work necessary to always select the best available file, because all options are limited in time (e.g. use option 1 if possible, fall back to option 2 otherwise, etc.); needs a download functionality like S1.auxil.OSV to know which ones are available)
  • util.geocode:
    • explicitly use 'Latest Auxiliary File' for Envisat calibration (just for readability, this is already the default value of the parsed node; other options: 'Product Auxiliary File', 'External Auxiliary File')
    • leave calibration node polarizations field empty when processing all polarizations (otherwise processing may finish without errors but no product is being written; looks like a SNAP bug, also reported in step-44830)
    • Calibration in/out band handling improvements
      • select source bands based on sensor and acquisition mode (also described in step-44830)
      • more explicit handling of output bands: all that are not needed set to False
      • commented out output bands that are apparently not needed
    • fixed sarsim-cc geocoding:
      • old: SAR-Simulation->Cross-Correlation->Terrain-Flattening->SARSim-Terrain-Correction (does not work because Terrain-Flattening does not pass through any source layers)
      • new: SAR-Simulation->Cross-Correlation->Warp->Terrain-Flattening->Terrain-Correction
      • this reveals a flaw in current SNAP processing: the additional Warp step introduces unnecessary resampling, the created lookup table is not passed between operators and thus makes the process inefficient, the whole procedure only works with EPSG:4326 as map geometry thus, by the looks of it, requiring three forward geocoding steps (for SAR-Simulation, Terrain-Flattening and Terrain-Correction, respectively)
  • auxil.groupbyWorkers: add Warp operator to the group of its source node, because it cannot be executed alone (just like ThermalNoiseRemoval)
  • ancillary layer writing fix: a layover shadow mask can also be created by SAR-Simulation, but the output layer is named differently ('layover_shadow_mask' instead of 'layoverShadowMask' by Terrain-Correction); this must be handled correctly in auxil.writer

drivers

  • ESA:
    • scan_Metadata:
      • read out all MPH, SPH, DSD and GEOLOCATION_GRID_ADS metadata and expose it via meta['origin']
      • use absolute orbit number as frameNumber instead of product counter (which often seems to be 0)
      • convert original metadata to Python types (int, float, datetime)
      • renamed several meta attributes
        • incidenceAngleMin -> incidence_nr
        • incidenceAngleMax -> incidence_fr
        • rangeResolution, azimuthResolution -> resolution (tuple)
        • neszNear, neszFar -> nesz (tuple)
    • new method geo_grid (like for SAFE)
    • corrected acquisition_mode for ASAR WSM, WSS
    • added MR product type
  • BEAM_DIMAP
    • improved metadata parsing
      • incidenceAngleMidSwath not always present, use incidence_near and incidence_far alternatively
      • the cycle number may be named orbit_cycle or CYCLE
      • for pyroSAR frameNumber, use ABS_ORBIT, not data_take_id as for Sentinel-1
      • added further meta attributes: swath, looks
      • always four Polarizations fields present, some may be set to None -> filtered out
      • for Sentinel-1 the product and acquisition_mode attributes can be obtained from ACQUISITION_MODE and PRODUCT_TYPE respectively; for ASAR/ERS ACQUISITION_MODE is missing and PRODUCT_TYPE contains the original values, e.g. 'ASA_APP_1P' -> must be abstracted
    • added MR product type
  • ID
    • added methods start_dt and stop_dt returning timezone-aware datetime objects

ancillary:

  • multilook_factors: fixed bug in returning 0 as range factor

@coveralls
Copy link
Copy Markdown

coveralls commented Sep 9, 2025

Pull Request Test Coverage Report for Build 18854125071

Details

  • 176 of 292 (60.27%) changed or added relevant lines in 5 files are covered.
  • 69 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.7%) to 52.935%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyroSAR/ancillary.py 2 3 66.67%
pyroSAR/snap/auxil.py 34 41 82.93%
pyroSAR/snap/util.py 42 77 54.55%
pyroSAR/drivers.py 96 169 56.8%
Files with Coverage Reduction New Missed Lines %
pyroSAR/S1/auxil.py 1 42.31%
pyroSAR/drivers.py 3 65.22%
pyroSAR/snap/util.py 4 52.11%
tests/test_auxdata.py 8 85.48%
pyroSAR/auxdata.py 53 39.75%
Totals Coverage Status
Change from base Build 18345680634: -0.7%
Covered Lines: 3887
Relevant Lines: 7343

💛 - Coveralls

…to feature/ers_envisat

# Conflicts:
#	pyroSAR/gamma/util.py
…to feature/ers_envisat

# Conflicts:
#	pyroSAR/gamma/util.py
@johntruckenbrodt johntruckenbrodt merged commit d8f3516 into main Oct 29, 2025
3 of 4 checks passed
@johntruckenbrodt johntruckenbrodt deleted the feature/ers_envisat branch February 4, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants