Skip to content

Commit

Permalink
Update sling_extract_asf.py
Browse files Browse the repository at this point in the history
Changes for md5sum due to issues with ASF API
  • Loading branch information
shitong01 authored Mar 4, 2022
1 parent adbd113 commit 6badfe3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frameMetadata/sling_extract_asf.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,16 @@ def get_slc_checksum_md5_asf(slc_id):
# {u'type': u'FeatureCollection', u'features': []} if SLC not found in ASF
raise RuntimeError("SLC_ID {} not found in ASF: no available md5 checksum for SLC".format(slc_id))

md5_hash = geojson["features"][0]["properties"]["md5sum"] # md5 checksum is lower case
md5_hash = ''
for thisDict in geojson["features"]:
if thisDict["properties"]["processingLevel"] == "SLC":
md5_hash = thisDict["properties"]["md5sum"]
break

if not md5_hash:
raise RuntimeError("Unable to retreive md5sum hash from query: {}, \n {}".format(asf_geo_json_endpoint,req.text))

# md5_hash = geojson["features"][0]["properties"]["md5sum"] # md5 checksum is lower case
return md5_hash


Expand Down

0 comments on commit 6badfe3

Please sign in to comment.