From a4358d7c95b73d3df28a4b22915c776de5d5a9b2 Mon Sep 17 00:00:00 2001 From: tcchase Date: Mon, 24 Feb 2025 14:03:19 -0500 Subject: [PATCH] feat: add opera-disp dataset --- SearchAPI/CMR/Output/jsonlite.py | 3 +-- SearchAPI/CMR/Translate/datasets.py | 3 +++ SearchAPI/CMR/Translate/parse_cmr_response.py | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) 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/Translate/datasets.py b/SearchAPI/CMR/Translate/datasets.py index 00c76509..32cb6f8a 100644 --- a/SearchAPI/CMR/Translate/datasets.py +++ b/SearchAPI/CMR/Translate/datasets.py @@ -135,6 +135,9 @@ "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 1525995e..a321597a 100644 --- a/SearchAPI/CMR/Translate/parse_cmr_response.py +++ b/SearchAPI/CMR/Translate/parse_cmr_response.py @@ -227,7 +227,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 +240,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