From 4591b7b1d9731dbe1c1614e07800fbb16c62c0fd Mon Sep 17 00:00:00 2001 From: Sebastianw Wehling-Benatelli Date: Mon, 27 Jun 2016 10:59:50 +0200 Subject: [PATCH] [bugfix] changed the order of trying to read seismic data for reassessment --- pylot/core/io/phases.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/pylot/core/io/phases.py b/pylot/core/io/phases.py index dfa67b4a..e3c7e90a 100644 --- a/pylot/core/io/phases.py +++ b/pylot/core/io/phases.py @@ -292,23 +292,26 @@ def reassess_pilot_event(root_dir, db_dir, event_id, out_dir=None, fn_param=None for station in picks_dict.keys(): fn_pattern = os.path.join(search_base, '{0}*'.format(station)) try: - st = read(fn_pattern, format='GSE2') - except TypeError as e: - print(e.message) st = read(fn_pattern) - except ValueError as e: - if e.message == 'second must be in 0..59': - info = 'A known Error was raised. Please find the list of corrupted files and double-check these files.' - datacheck.append(fn_pattern + ' (time info)\n') - continue - else: - raise ValueError(e.message) - except Exception as e: - if 'No file matching file pattern:' in e.message: - if verbosity > 0: - warnings.warn('no waveform data found for station {station}'.format(station=station), RuntimeWarning) - datacheck.append(fn_pattern + ' (no data)\n') - continue + except TypeError as e: + if 'Unknown format for file' in e.message: + try: + st = read(fn_pattern, format='GSE2') + except ValueError as e: + if e.message == 'second must be in 0..59': + info = 'A known Error was raised. Please find the list of corrupted files and double-check these files.' + datacheck.append(fn_pattern + ' (time info)\n') + continue + else: + raise ValueError(e.message) + except Exception as e: + if 'No file matching file pattern:' in e.message: + if verbosity > 0: + warnings.warn('no waveform data found for station {station}'.format(station=station), RuntimeWarning) + datacheck.append(fn_pattern + ' (no data)\n') + continue + else: + raise e else: raise e for phase in picks_dict[station].keys():