Skip to content

Commit

Permalink
fix: ers, jers, and radarsat-1 use FRAME_NUMBER
Browse files Browse the repository at this point in the history
  • Loading branch information
williamh890 committed Sep 28, 2023
1 parent 87f5f84 commit da3bb72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jsonlite_cache/*
venv/*
.DS_Store
.vscode

.env
18 changes: 12 additions & 6 deletions SearchAPI/CMR/Translate/parse_cmr_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,16 @@ def remove_field(f):
remove_field('platform')

if 'frameNumber' in req_fields:
asf_frame_platforms = ['Sentinel-1A', 'Sentinel-1B', 'ALOS', 'SENTINEL-1A', 'SENTINEL-1B']
result['frameNumber'] = get_val(attr_path('FRAME_NUMBER')) \
asf_frame_platforms = [
'Sentinel-1A', 'Sentinel-1B', 'ALOS', 'SENTINEL-1A', 'SENTINEL-1B',
'ERS-1', 'ERS-2', 'JERS-1', 'RADARSAT-1'
]

frame_type = 'FRAME_NUMBER' \
if result['platform'] in asf_frame_platforms \
else get_val(attr_path('CENTER_ESA_FRAME'))
else 'CENTER_ESA_FRAME'

result['frameNumber'] = get_val(attr_path(frame_type))
remove_field('frameNumber')

if 'browse' in req_fields:
Expand Down Expand Up @@ -126,13 +132,13 @@ def float_or_none(a):
if 'canInsar' in req_fields:
if result['platform'] in ['ALOS', 'RADARSAT-1', 'JERS-1', 'ERS-1', 'ERS-2']:
result['insarGrouping'] = get_val(field_paths['insarGrouping'])

insarBaseline = get_val(field_paths['insarBaseline'])
if insarBaseline is not None:
insarBaseline = float(insarBaseline)
result['baseline'] = {
'insarBaseline': insarBaseline
}
}
remove_field('insarGrouping')
if result['insarGrouping'] not in [None, 0, '0', 'NA', 'NULL']:
result['canInsar'] = True
Expand All @@ -148,7 +154,7 @@ def float_or_none(a):
result['canInsar'] = False
remove_field('canInsar')


# These fields are always None or NA and should be fully deprecated/removed in the future
deprecated_fields = [
'beamSwath',
Expand Down

0 comments on commit da3bb72

Please sign in to comment.