From 7ac19141ba95d46b9f6a6d13d0f89c17e26cdbda Mon Sep 17 00:00:00 2001 From: kim Date: Thu, 28 Sep 2023 16:26:06 -0800 Subject: [PATCH 1/3] Checks onlineAccessURLs and OnlineResources in umm response when building opera product additionalUrls field --- SearchAPI/CMR/Translate/parse_cmr_response.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SearchAPI/CMR/Translate/parse_cmr_response.py b/SearchAPI/CMR/Translate/parse_cmr_response.py index 0e78ba28..42a9fc23 100644 --- a/SearchAPI/CMR/Translate/parse_cmr_response.py +++ b/SearchAPI/CMR/Translate/parse_cmr_response.py @@ -199,7 +199,10 @@ def float_or_none(a): result['fileName'] = result['granuleName'] + '.' + urls[0].split('.')[-1] if result.get('product_file_id', '').startswith('OPERA'): - result['additionalUrls'] = [url for url in get_all_vals('./OnlineAccessURLs/OnlineAccessURL/URL') if not url.endswith('.md5') and not url.startswith('s3://')] + + accessUrls = [url for url in get_all_vals('./OnlineAccessURLs/OnlineAccessURL/URL') if not url.endswith('.md5') and not url.startswith('s3://') and not 's3credentials' in url and not url.endswith('.iso')] + OnlineResources = [url for url in get_all_vals('./OnlineResources/OnlineResource/URL') if not url.endswith('.md5') and not url.startswith('s3://') and not 's3credentials' in url and not url.endswith('.iso')] + result['additionalUrls'] = list(set([*accessUrls, *OnlineResources])) return result From 4a00ca378c5ff52683cdb2b4d7e2f5bdc92c271e Mon Sep 17 00:00:00 2001 From: kim Date: Fri, 6 Oct 2023 15:43:33 -0800 Subject: [PATCH 2/3] adds beam mode to Opera product, hardcodes beammode description, reveals .iso.xml files --- SearchAPI/CMR/Translate/parse_cmr_response.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SearchAPI/CMR/Translate/parse_cmr_response.py b/SearchAPI/CMR/Translate/parse_cmr_response.py index 42a9fc23..f9c659dd 100644 --- a/SearchAPI/CMR/Translate/parse_cmr_response.py +++ b/SearchAPI/CMR/Translate/parse_cmr_response.py @@ -199,10 +199,12 @@ def float_or_none(a): result['fileName'] = result['granuleName'] + '.' + urls[0].split('.')[-1] if result.get('product_file_id', '').startswith('OPERA'): - - accessUrls = [url for url in get_all_vals('./OnlineAccessURLs/OnlineAccessURL/URL') if not url.endswith('.md5') and not url.startswith('s3://') and not 's3credentials' in url and not url.endswith('.iso')] - OnlineResources = [url for url in get_all_vals('./OnlineResources/OnlineResource/URL') if not url.endswith('.md5') and not url.startswith('s3://') and not 's3credentials' in url and not url.endswith('.iso')] + result['beamMode'] = get_val(attr_path('BEAM_MODE')) + accessUrls = [url for url in get_all_vals('./OnlineAccessURLs/OnlineAccessURL/URL') if not url.endswith('.md5') and not url.startswith('s3://') and not 's3credentials' in url] + OnlineResources = [url for url in get_all_vals('./OnlineResources/OnlineResource/URL') if not url.endswith('.md5') and not url.startswith('s3://') and not 's3credentials' in url] result['additionalUrls'] = list(set([*accessUrls, *OnlineResources])) + 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." + return result From a11008dcf94d62bf637e18c8adfc443f66c2255a Mon Sep 17 00:00:00 2001 From: kim Date: Mon, 16 Oct 2023 10:16:22 -0800 Subject: [PATCH 3/3] fixes opera browse url mangling --- SearchAPI/CMR/Translate/parse_cmr_response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SearchAPI/CMR/Translate/parse_cmr_response.py b/SearchAPI/CMR/Translate/parse_cmr_response.py index d9c34edb..1a4ec8db 100644 --- a/SearchAPI/CMR/Translate/parse_cmr_response.py +++ b/SearchAPI/CMR/Translate/parse_cmr_response.py @@ -211,7 +211,7 @@ def float_or_none(a): OnlineResources = [url for url in get_all_vals('./OnlineResources/OnlineResource/URL') if not url.endswith('.md5') and not url.startswith('s3://') and not 's3credentials' in url] result['additionalUrls'] = list(set([*accessUrls, *OnlineResources])) 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." - + result['browse'] = [url for url in get_all_vals('./AssociatedBrowseImageUrls/ProviderBrowseUrl/URL') if not url.startswith('s3://')] return result