diff --git a/.github/workflows/reusable-DeployStack-SearchAPI.yml b/.github/workflows/reusable-DeployStack-SearchAPI.yml index 9f2bd9a8..a5c914b5 100644 --- a/.github/workflows/reusable-DeployStack-SearchAPI.yml +++ b/.github/workflows/reusable-DeployStack-SearchAPI.yml @@ -96,6 +96,9 @@ jobs: # If it's writing to a branch, the pull request to that branch already # passed, OR it's a developing branch that doesn't need PR's. No need # to run suite either way. + - uses: actions/setup-python@v5 + with: + python-version: '3.9' - name: Install pytest requirements if: github.event_name == 'pull_request' run: | diff --git a/SearchAPI/CMR/Output/jsonlite.py b/SearchAPI/CMR/Output/jsonlite.py index 9183f8ac..3e893053 100644 --- a/SearchAPI/CMR/Output/jsonlite.py +++ b/SearchAPI/CMR/Output/jsonlite.py @@ -179,8 +179,7 @@ def getItem(self, p): burst['subswath'] = p['subswath'] result['burst'] = burst - - if p.get('operaBurstID') is not None or result['productID'].startswith('OPERA'): + if (p.get('operaBurstID') is not None or result['productID'].startswith('OPERA')) and not result['productID'].startswith('OPERA_L3_DISP'): result['opera'] = { 'operaBurstID': p.get('operaBurstID'), 'additionalUrls': p.get('additionalUrls'), diff --git a/SearchAPI/CMR/SubQuery.py b/SearchAPI/CMR/SubQuery.py index 00087a00..5f77553f 100644 --- a/SearchAPI/CMR/SubQuery.py +++ b/SearchAPI/CMR/SubQuery.py @@ -61,7 +61,7 @@ def combine_params(self, params, extra_params): def should_use_asf_frame(self): asf_frame_platforms = ['SENTINEL-1A', 'SENTINEL-1B', 'ALOS'] - asf_frame_datasets = ['SENTINEL-1', 'OPERA-S1', 'SLC-BURST', 'ALOS PALSAR', 'ALOS AVNIR-2'] + asf_frame_datasets = ['SENTINEL-1', 'OPERA-S1', 'SLC-BURST', 'ALOS PALSAR', 'ALOS AVNIR-2', 'ALOS-2'] asf_frame_collections = [] for dataset in asf_frame_datasets: diff --git a/SearchAPI/CMR/Translate/datasets.py b/SearchAPI/CMR/Translate/datasets.py index 7b9da157..32cb6f8a 100644 --- a/SearchAPI/CMR/Translate/datasets.py +++ b/SearchAPI/CMR/Translate/datasets.py @@ -132,6 +132,12 @@ "C2803501097-ASF", ], "SLC-BURST": ["C2709161906-ASF", "C1257024016-ASF"], + "ALOS-2": [ + "C3315903479-ASF" + ], + "OPERA-DISP" : [ + "C1271830354-ASF" + ], "ALOS PALSAR": [ "C1206487504-ASF", "C1206485940-ASF", diff --git a/SearchAPI/CMR/Translate/parse_cmr_response.py b/SearchAPI/CMR/Translate/parse_cmr_response.py index 194fbb59..57f7ccb4 100644 --- a/SearchAPI/CMR/Translate/parse_cmr_response.py +++ b/SearchAPI/CMR/Translate/parse_cmr_response.py @@ -66,11 +66,13 @@ def remove_field(f): platform = get_val('./Platforms/Platform/ShortName') result['platform'] = platform remove_field('platform') + if result['platform'] in ['ALOS-2']: + result['beamMode'] = get_val(attr_path('BEAM_MODE')) if 'frameNumber' in req_fields: asf_frame_platforms = [ 'Sentinel-1A', 'Sentinel-1B', 'ALOS', 'SENTINEL-1A', 'SENTINEL-1B', - 'ERS-1', 'ERS-2', 'JERS-1', 'RADARSAT-1' + 'ERS-1', 'ERS-2', 'JERS-1', 'RADARSAT-1', 'ALOS-2' ] if result['platform'] in asf_frame_platforms: @@ -90,7 +92,7 @@ def remove_field(f): result['fileName'] = file_name.split('/')[-1] if file_name else None remove_field('fileName') - if 'stateVectors' in req_fields or ('canInsar' in req_fields and result['platform'] not in ['ALOS', 'RADARSAT-1', 'JERS-1', 'ERS-1', 'ERS-2']): + if 'stateVectors' in req_fields or ('canInsar' in req_fields and result['platform'] not in ['ALOS', 'ALOS-2', 'RADARSAT-1', 'JERS-1', 'ERS-1', 'ERS-2']): def parse_sv(sv): def float_or_none(a): try: @@ -131,7 +133,7 @@ def float_or_none(a): remove_field('stateVectors') if 'canInsar' in req_fields: - if result['platform'] in ['ALOS', 'RADARSAT-1', 'JERS-1', 'ERS-1', 'ERS-2']: + if result['platform'] in ['ALOS', 'ALOS-2', 'RADARSAT-1', 'JERS-1', 'ERS-1', 'ERS-2']: result['insarGrouping'] = get_val(field_paths['insarGrouping']) insarBaseline = get_val(field_paths['insarBaseline']) @@ -206,7 +208,6 @@ def float_or_none(a): result['fileName'] = result['granuleName'] + '.' + urls[0].split('.')[-1] - def get_all_urls(): accessPath = './OnlineAccessURLs/OnlineAccessURL/URL' resourcesPath = './OnlineResources/OnlineResource/URL' @@ -227,7 +228,7 @@ def get_http_urls(): def get_s3_urls(): return [url for url in get_all_urls() if not url.endswith('.md5') and (url.startswith('s3://') or 's3credentials' in url)] - if result.get('product_file_id', '').startswith('OPERA'): + if result.get('product_file_id', '').startswith('OPERA') and not result.get('product_file_id', '').startswith('OPERA_L3_DISP'): result['beamMode'] = get_val(attr_path('BEAM_MODE')) result['additionalUrls'] = get_http_urls() result['configurationName'] = "Interferometric Wide. 250 km swath, 5 m x 20 m spatial resolution and burst synchronization for interferometry. IW is considered to be the standard mode over land masses." @@ -240,11 +241,13 @@ def get_s3_urls(): elif result.get('product_file_id', '').startswith('S1-GUNW') and result.get('ariaVersion') is None: version_unformatted = result.get('granuleName').split('v')[-1] result['ariaVersion'] = re.sub(r'[^0-9\.]', '', version_unformatted.replace("_", '.')) + if result.get('product_file_id', '').startswith('OPERA_L3_DISP'): + if (providerbrowseUrls := get_all_vals('./AssociatedBrowseImageUrls/ProviderBrowseUrl/URL')): + result['browse'] = [url for url in providerbrowseUrls if not url.startswith('s3://')] if result.get('platform', '') == 'NISAR': result['additionalUrls'] = get_http_urls() result['s3Urls'] = get_s3_urls() - return result