ASFHyP3 / hyp3-gamma

HyP3 plugin for generating SAR products with GAMMA
BSD 3-Clause "New" or "Revised" License
30 stars 6 forks source link

Heading attribute of InSAR products expressed clockwise instead of counter-clockwise for descending scenes #306

Open asjohnston-asf opened 3 years ago

asjohnston-asf commented 3 years ago

Originally reported by @yunjunz at https://github.com/insarlab/MintPy/issues/540#issuecomment-898816062

Sentinel-1 headings are expressed in degrees counter-clockwise from north in the annotation xml files provided with SLC products (around -12 degrees for ascending scenes and -168 for descending scenes).

For descending pairs, the heading attribute for InSAR products is expressed in degrees clockwise from north in the .txt metadata file (around 193 degrees). descending.txt

GAMMA's SLC_copy_S1_TOPS program appears to be the culprit, an input .par file with a -168 heading generates an output .par file with a positive heading. https://github.com/ASFHyP3/hyp3-gamma/blob/develop/hyp3_gamma/insar/ifm_sentinel.py#L335 https://github.com/ASFHyP3/hyp3-lib/blob/8594f68c4496c9c0ad1fcdc704c3c8a59f90cc70/hyp3lib/SLC_copy_S1_fullSW.py#L31

This does not appear to impact InSAR products generated from ascending pairs; the heading is still expressed as ~-12 degrees. ascending.txt

asjohnston-asf commented 3 years ago

This impacts MintPy metadata when importing InSAR products from HyP3 around https://github.com/insarlab/MintPy/blob/main/mintpy/prep_hyp3.py#L118

yunjunz commented 3 years ago

Hi @asjohnston-asf, -168 and 192 are equivalent to each other with 360 deg difference. It was my mistake. The 193 value is correct and fine.

asjohnston-asf commented 3 years ago

prep_hyp3.py may set the ORBIT_DIRECTION attribute incorrectly as a result, might need a heading = (heading % 360) - 360 at https://github.com/insarlab/MintPy/blob/main/mintpy/prep_hyp3.py#L120 or https://github.com/insarlab/MintPy/blob/main/mintpy/prep_hyp3.py#L129

yunjunz commented 3 years ago

Yes, I will adjust this value in prep_hyp3.py to make it around -168.