Skip to content

Commit 31a89af

Browse files
authored
Fix HyP3 GAMMA filename parsing for longer temporal baselines (insarlab#1479)
* Fix HyP3 GAMMA filename parsing for 4-digit day separation * Move parsing tests into existing test file
1 parent 9852991 commit 31a89af

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/mintpy/prep_hyp3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _get_product_name_and_type(filename: str) -> tuple[str, str]:
2929
job_type = 'INSAR_ISCE_MULTI_BURST'
3030

3131
elif match := re.match(
32-
r'S1[ABC]{2}(_\d{8}T\d{6}){2}_(VV|HH)[PRO]\d{3}_INT\d{2}_G_[uw][ec][123F]_[0-9A-F]{4}',
32+
r'S1[ABC]{2}(_\d{8}T\d{6}){2}_(VV|HH)[PRO]\d{3,4}_INT\d{2}_G_[uw][ec][123F]_[0-9A-F]{4}',
3333
filename,
3434
):
3535
job_type = 'INSAR_GAMMA'

tests/test_prep_hyp3.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ def test_get_product_name_and_type():
1616
'S1AA_20150504T120217_20150621T120220_VVP048_INT80_G_ueF_5CED_foo.tif'
1717
) == ('S1AA_20150504T120217_20150621T120220_VVP048_INT80_G_ueF_5CED', 'INSAR_GAMMA')
1818

19+
assert _get_product_name_and_type(
20+
'S1BC_20210807T053645_20250729T053630_VVP1452_INT80_G_weF_9C74_unw_phase_clip.tif'
21+
) == ('S1BC_20210807T053645_20250729T053630_VVP1452_INT80_G_weF_9C74', 'INSAR_GAMMA')
22+
23+
1924
# Old INSAR_ISCE_MULTI_BURST naming convention
2025
with pytest.raises(
2126
ValueError,

0 commit comments

Comments
 (0)