diff --git a/SearchAPI/CMR/Input.py b/SearchAPI/CMR/Input.py index 926bc338..2300f5bd 100644 --- a/SearchAPI/CMR/Input.py +++ b/SearchAPI/CMR/Input.py @@ -139,6 +139,9 @@ def parse_coord_string(v): raise ValueError(f'Invalid coordinate: {c}') from e if len(v) % 2 != 0: raise ValueError(f'Invalid coordinate list, odd number of values provided: {v}') + for i in range(len(v)): + if float(v[i]) < 1.0 and float(v[i]) > 0.0 : + v[i] = '0' + v[i] return ','.join(v) # Parse and validate a bbox coordinate string diff --git a/SearchAPI/CMR/Translate/parse_cmr_response.py b/SearchAPI/CMR/Translate/parse_cmr_response.py index 83c93e31..194fbb59 100644 --- a/SearchAPI/CMR/Translate/parse_cmr_response.py +++ b/SearchAPI/CMR/Translate/parse_cmr_response.py @@ -2,7 +2,7 @@ from defusedxml.lxml import fromstring import datetime from .fields import get_field_paths, attr_path - +import re def parse_cmr_response(r, req_fields): """ @@ -237,9 +237,14 @@ def get_s3_urls(): if 'STATIC' in result['processingLevel']: result['validityStartDate'] = get_val('./Temporal/SingleDateTime') + 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('platform', '') == 'NISAR': result['additionalUrls'] = get_http_urls() result['s3Urls'] = get_s3_urls() + return result