Skip to content

Commit 44ce33a

Browse files
committed
Set default magnitude type to 'M' if it is 'nan' in CSV catalog
1 parent a24cbcb commit 44ce33a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

requake/catalog/read_catalog_from_csv.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ def read_catalog_from_csv(filename):
197197
ev.lat = float_or_none(row[fields['lat']])
198198
ev.depth = float_or_none(row[fields['depth']])
199199
ev.mag_type = row[fields['mag_type']]
200+
if ev.mag_type.lower() == 'nan':
201+
ev.mag_type = 'M'
200202
ev.mag = float_or_none(row[fields['mag']])
201203
cat.append(ev)
202204
print() # needed to add a newline after the last "reading row" message

0 commit comments

Comments
 (0)