Skip to content

Conversation

@mohseniaref
Copy link
Owner

Summary

  • invoke prep_licsar via the standard metadata preparation flow
  • expand prep_licsar to parse LiCSAR metadata/baseline files more robustly and derive interferogram attributes

Testing

  • python -m compileall src/mintpy/prep_licsar.py

https://chatgpt.com/codex/tasks/task_e_68ed631ed92c832098d858654646f970

Mohammad Mohseni Aref added 4 commits October 15, 2025 05:06
…egration

This commit adds full LiCSAR product support to MintPy, including:

1. Enhanced baseline handling (prep_licsar.py):
   - Read LiCSAR baselines file with format: frame_master_date acquisition_date perp_baseline temporal_baseline
   - Calculate perpendicular baseline as difference between acquisition dates relative to frame master
   - Fixed DATE12 extraction to get both master and slave dates from YYYYMMDD_YYYYMMDD filename pattern
   - Fixed interferogram detection to recognize .unw. and .cc. file patterns
   - Add temporal baseline (T_BASELINE) calculation

2. E,N,U geometry components support (load_data.py):
   - Add basisEast, basisNorth, basisUp to GEOM_DSET_NAME2TEMPLATE_KEY mapping
   - Create enhance_licsar_geometry_file() function to calculate derived geometry datasets
   - Calculate incidenceAngle from E,N,U using utils0.incidence_angle_from_enu()
   - Calculate azimuthAngle from E,N,U using utils0.azimuth_angle_from_enu()
   - Calculate slantRangeDistance from incidenceAngle using utils0.incidence_angle2slant_range_distance()
   - Add satellite HEIGHT attribute (693 km for Sentinel-1) for slant range calculation

3. Geometry dataset names (stack.py):
   - Add basisEast, basisNorth, basisUp to GEOMETRY_DSET_NAMES list
   - Enable recognition of E,N,U components in geometry processing

4. XML parsing fix (readfile.py):
   - Handle PAMDataset XML files without ENVI metadata domain
   - Add None check before accessing metadata to prevent AttributeError

Result: Complete LiCSAR workflow with 2000 interferograms, proper baselines, and full geometry including pixel-wise incidence/azimuth angles calculated from E,N,U basis vectors.
…oint

This commit adds:

1. New utility functions in utils0.py:
   - incidence_angle_from_enu(): Calculate incidence angle from E,N,U unit vectors using θ = arccos(|U|)
   - azimuth_angle_from_enu(): Calculate azimuth angle from E,N,U using α = atan2(E, N)
   Both functions follow MintPy coordinate conventions and include quality masking

2. CLI entry point in pyproject.toml:
   - Add create_licsar_geometry.py command for standalone geometry file creation

3. Standalone geometry creation tool (create_licsar_geometry.py):
   - Command-line tool to create enhanced LiCSAR geometry files
   - Reads E,N,U components and calculates all required geometry datasets
   - Can be used independently or called from load_data.py
- Update enhance_licsar_geometry_file() to generate 2D lat/lon grids
- Use X_FIRST, X_STEP, Y_FIRST, Y_STEP from metadata
- Grids match gdalinfo corner coordinates
- Float32 format with lzf compression
- Tested and verified with test_latlon_simple.py
- RLOOKS = (X_STEP in meters) / (range pixel spacing in ground range)
- ALOOKS = (Y_STEP in meters) / (azimuth pixel spacing)
- Convert slant range spacing to ground range: slant / sin(incidence)
- Use native Sentinel-1 pixel spacing: range=2.3m, azimuth=13.9m
- Fixes KeyError: 'ALOOKS' during ifgram_inversion step
- Correctly accounts for multilooking in geocoded LiCSAR products
@mohseniaref mohseniaref merged commit 77ea07b into licsar Oct 17, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants