@@ -68,10 +68,17 @@ def remove_field(f):
68
68
remove_field ('platform' )
69
69
70
70
if 'frameNumber' in req_fields :
71
- asf_frame_platforms = ['Sentinel-1A' , 'Sentinel-1B' , 'ALOS' , 'SENTINEL-1A' , 'SENTINEL-1B' ]
72
- result ['frameNumber' ] = get_val (attr_path ('FRAME_NUMBER' )) \
73
- if result ['platform' ] in asf_frame_platforms \
74
- else get_val (attr_path ('CENTER_ESA_FRAME' ))
71
+ asf_frame_platforms = [
72
+ 'Sentinel-1A' , 'Sentinel-1B' , 'ALOS' , 'SENTINEL-1A' , 'SENTINEL-1B' ,
73
+ 'ERS-1' , 'ERS-2' , 'JERS-1' , 'RADARSAT-1'
74
+ ]
75
+
76
+ if result ['platform' ] in asf_frame_platforms :
77
+ frame_type = 'FRAME_NUMBER'
78
+ else :
79
+ frame_type = 'CENTER_ESA_FRAME'
80
+
81
+ result ['frameNumber' ] = get_val (attr_path (frame_type ))
75
82
remove_field ('frameNumber' )
76
83
77
84
if 'browse' in req_fields :
@@ -126,13 +133,13 @@ def float_or_none(a):
126
133
if 'canInsar' in req_fields :
127
134
if result ['platform' ] in ['ALOS' , 'RADARSAT-1' , 'JERS-1' , 'ERS-1' , 'ERS-2' ]:
128
135
result ['insarGrouping' ] = get_val (field_paths ['insarGrouping' ])
129
-
136
+
130
137
insarBaseline = get_val (field_paths ['insarBaseline' ])
131
138
if insarBaseline is not None :
132
139
insarBaseline = float (insarBaseline )
133
140
result ['baseline' ] = {
134
141
'insarBaseline' : insarBaseline
135
- }
142
+ }
136
143
remove_field ('insarGrouping' )
137
144
if result ['insarGrouping' ] not in [None , 0 , '0' , 'NA' , 'NULL' ]:
138
145
result ['canInsar' ] = True
@@ -148,7 +155,7 @@ def float_or_none(a):
148
155
result ['canInsar' ] = False
149
156
remove_field ('canInsar' )
150
157
151
-
158
+
152
159
# These fields are always None or NA and should be fully deprecated/removed in the future
153
160
deprecated_fields = [
154
161
'beamSwath' ,
@@ -199,7 +206,12 @@ def float_or_none(a):
199
206
result ['fileName' ] = result ['granuleName' ] + '.' + urls [0 ].split ('.' )[- 1 ]
200
207
201
208
if result .get ('product_file_id' , '' ).startswith ('OPERA' ):
202
- result ['additionalUrls' ] = [url for url in get_all_vals ('./OnlineAccessURLs/OnlineAccessURL/URL' ) if not url .endswith ('.md5' ) and not url .startswith ('s3://' )]
209
+ result ['beamMode' ] = get_val (attr_path ('BEAM_MODE' ))
210
+ 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 ]
211
+ 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 ]
212
+ result ['additionalUrls' ] = list (set ([* accessUrls , * OnlineResources ]))
213
+ 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."
214
+ result ['browse' ] = [url for url in get_all_vals ('./AssociatedBrowseImageUrls/ProviderBrowseUrl/URL' ) if not url .startswith ('s3://' )]
203
215
return result
204
216
205
217
0 commit comments