1414 get_summary_data_frame )
1515from libcomcat .logging import setup_logger
1616
17+ EVTYPES = ['earthquake' , 'explosion' , 'landslide' , 'volcanic eruption' ]
18+
1719
1820def get_parser ():
1921 desc = '''Download basic earthquake information in line format (csv, tab, etc.).
@@ -219,6 +221,11 @@ def get_parser():
219221 parser .add_argument ('-x' , '--count' , dest = 'getCount' ,
220222 action = 'store_true' ,
221223 help = helpstr )
224+ typehelp = '''Select event type other than "earthquake".'''
225+
226+ parser .add_argument ('--event-type' , default = 'earthquake' ,
227+ choices = EVTYPES ,
228+ help = typehelp )
222229 return parser
223230
224231
@@ -347,6 +354,7 @@ def main():
347354 maxsig = maxsig ,
348355 producttype = args .limitByProductType ,
349356 host = args .host ,
357+ eventtype = args .event_type ,
350358 alertlevel = args .alert_level )
351359 else :
352360 events = []
@@ -373,6 +381,7 @@ def main():
373381 maxsig = maxsig ,
374382 producttype = args .limitByProductType ,
375383 host = args .host ,
384+ eventtype = args .event_type ,
376385 alertlevel = args .alert_level )
377386 events += tevents
378387
@@ -401,7 +410,10 @@ def main():
401410 first_columns = list (events [0 ].toDict ().keys ())
402411 col_list = list (df .columns )
403412 for column in first_columns :
404- col_list .remove (column )
413+ try :
414+ col_list .remove (column )
415+ except Exception as e :
416+ x = 1
405417 df = df [first_columns + col_list ]
406418
407419 if args .country :
0 commit comments