Skip to content

Commit

Permalink
adds fallback version number for aria s1 gunw products older than v3
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed May 31, 2024
1 parent 23b292b commit 3cebea8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SearchAPI/CMR/Translate/parse_cmr_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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['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


Expand Down

0 comments on commit 3cebea8

Please sign in to comment.