File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1156,15 +1156,18 @@ def _get_shakemap_info(product):
11561156 # get from stations
11571157 # - number instrumented stations
11581158 # - number dyfi
1159- stationbytes = product .getContentBytes ('stationlist.json' )[0 ]
1160- stationdict = json .loads (stationbytes .decode ('utf-8' ))
11611159 ninstrument = 0
11621160 ndyfi = 0
1163- for feature in stationdict ['features' ]:
1164- if feature ['properties' ]['source' ] == 'DYFI' :
1165- ndyfi += 1
1166- else :
1167- ninstrument += 1
1161+ if len (product .getContentsMatching ('stationlist' )):
1162+ stationbytes = product .getContentBytes ('stationlist.json' )[0 ]
1163+ stationdict = json .loads (stationbytes .decode ('utf-8' ))
1164+ ninstrument = 0
1165+ ndyfi = 0
1166+ for feature in stationdict ['features' ]:
1167+ if feature ['properties' ]['source' ] == 'DYFI' :
1168+ ndyfi += 1
1169+ else :
1170+ ninstrument += 1
11681171 elif len (product .getContentsMatching ('info.xml' )):
11691172 infobytes = product .getContentBytes ('info.xml' )[0 ]
11701173 root = minidom .parseString (infobytes .decode ('utf-8' ))
You can’t perform that action at this time.
0 commit comments