diff --git a/CHANGELOG.md b/CHANGELOG.md index be9e784f..1a92ae4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.2] +### Fixed +* `No annotation xml file` error in `insar_tops_burst` when processing HH pairs. Fixes [#168](https://github.com/ASFHyP3/hyp3-isce2/issues/168). +### Added +* a warning that processing products over the Anti-Meridian is not currently supported. + ## [0.9.1] ### Fixed * Water Masking now pulls the global shapefile and clips it, rather than pulling a partitioned parque, due to issues around the partition boundaries. diff --git a/src/hyp3_isce2/burst.py b/src/hyp3_isce2/burst.py index 7ab4ef9d..fbfeda14 100644 --- a/src/hyp3_isce2/burst.py +++ b/src/hyp3_isce2/burst.py @@ -236,6 +236,7 @@ def get_isce2_burst_bbox(params: BurstParams, base_dir: Optional[Path] = None) - s1_obj = Sentinel1() s1_obj.configure() + s1_obj.polarization = params.polarization.lower() s1_obj.safe = [str(base_dir / f'{params.granule}.SAFE')] s1_obj.swathNumber = int(params.swath[-1]) s1_obj.parse() diff --git a/src/hyp3_isce2/insar_tops.py b/src/hyp3_isce2/insar_tops.py index 3c15df4a..85124486 100644 --- a/src/hyp3_isce2/insar_tops.py +++ b/src/hyp3_isce2/insar_tops.py @@ -68,6 +68,7 @@ def insar_tops( config = topsapp.TopsappBurstConfig( reference_safe=f'{reference_scene}.SAFE', secondary_safe=f'{secondary_scene}.SAFE', + polarization=polarization, orbit_directory=str(orbit_dir), aux_cal_directory=str(aux_cal_dir), dem_filename=str(dem_path), @@ -95,7 +96,7 @@ def main(): parser.add_argument('--esa-password', default=None, help="Password for ESA\'s Copernicus Data Space Ecosystem") parser.add_argument('--reference-scene', type=str, required=True) parser.add_argument('--secondary-scene', type=str, required=True) - parser.add_argument('--polarization', type=str, default='VV') + parser.add_argument('--polarization', type=str, choices=['VV', 'HH'], default='VV') parser.add_argument( '--looks', choices=['20x4', '10x2', '5x1'], diff --git a/src/hyp3_isce2/insar_tops_burst.py b/src/hyp3_isce2/insar_tops_burst.py index ea9cd928..9beb31da 100644 --- a/src/hyp3_isce2/insar_tops_burst.py +++ b/src/hyp3_isce2/insar_tops_burst.py @@ -95,6 +95,10 @@ def insar_tops_burst( insar_roi = get_region_of_interest(ref_footprint, sec_footprint, is_ascending=is_ascending) dem_roi = ref_footprint.intersection(sec_footprint).bounds + + if abs(dem_roi[0] - dem_roi[2]) > 180.0 and dem_roi[0] * dem_roi[2] < 0.0: + raise ValueError('Products that cross the anti-meridian are not currently supported.') + log.info(f'InSAR ROI: {insar_roi}') log.info(f'DEM ROI: {dem_roi}') @@ -115,6 +119,7 @@ def insar_tops_burst( config = topsapp.TopsappBurstConfig( reference_safe=f'{ref_params.granule}.SAFE', secondary_safe=f'{sec_params.granule}.SAFE', + polarization=ref_params.polarization, orbit_directory=str(orbit_dir), aux_cal_directory=str(aux_cal_dir), roi=insar_roi, diff --git a/src/hyp3_isce2/templates/topsapp.xml b/src/hyp3_isce2/templates/topsapp.xml index 1546be43..189fff51 100644 --- a/src/hyp3_isce2/templates/topsapp.xml +++ b/src/hyp3_isce2/templates/topsapp.xml @@ -6,12 +6,14 @@ {{ aux_cal_directory }} reference {{ reference_safe }} + {{ polarization.lower() }} {{ orbit_directory }} {{ aux_cal_directory }} secondary {{ secondary_safe }} + {{ polarization.lower() }} {{ swaths }} {{ range_looks }} diff --git a/src/hyp3_isce2/topsapp.py b/src/hyp3_isce2/topsapp.py index d5b17407..c233c0b3 100644 --- a/src/hyp3_isce2/topsapp.py +++ b/src/hyp3_isce2/topsapp.py @@ -48,6 +48,7 @@ def __init__( self, reference_safe: str, secondary_safe: str, + polarization: str, orbit_directory: str, aux_cal_directory: str, dem_filename: str, @@ -60,6 +61,7 @@ def __init__( ): self.reference_safe = reference_safe self.secondary_safe = secondary_safe + self.polarization = polarization self.orbit_directory = orbit_directory self.aux_cal_directory = aux_cal_directory self.roi = [roi[1], roi[3], roi[0], roi[2]] diff --git a/tests/test_topsapp.py b/tests/test_topsapp.py index c069c07f..272c0af8 100644 --- a/tests/test_topsapp.py +++ b/tests/test_topsapp.py @@ -7,6 +7,7 @@ def test_topsapp_burst_config(tmp_path): config = TopsappBurstConfig( reference_safe='S1A_IW_SLC__1SDV_20200604T022251_20200604T022318_032861_03CE65_7C85.SAFE', secondary_safe='S1A_IW_SLC__1SDV_20200616T022252_20200616T022319_033036_03D3A3_5D11.SAFE', + polarization='VV', orbit_directory='orbits', aux_cal_directory='aux_cal', roi=[-118.0, 37.0, -117.0, 38.0], @@ -53,6 +54,7 @@ def test_run_topsapp_burst(tmp_path, monkeypatch): config = TopsappBurstConfig( reference_safe='', secondary_safe='', + polarization='', orbit_directory='', aux_cal_directory='', roi=[0, 1, 2, 3],