Skip to content

Commit

Permalink
Small bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
geojunky committed Jul 25, 2022
1 parent 1fc24b5 commit ff239b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion seismic/bulk_station_orientations.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ def main(src_h5_event_file, network, output_basename, station_list):
tempdir = None
if(rank == 0):
# retrieve all available hdf_keys
proc_hdfkeys = get_obspyh5_index(src_h5_event_file, seeds_only=True, root=rf_h5_root)
proc_hdfkeys = set(get_obspyh5_index(src_h5_event_file, seeds_only=True, root=rf_h5_root))
proc_hdfkeys = proc_hdfkeys.union(set(get_obspyh5_index(src_h5_event_file, seeds_only=True, root=sw_h5_root)))
proc_hdfkeys = list(proc_hdfkeys)

# trim stations to be processed based on the user-provided network- and station-list
proc_hdfkeys = rf_util.trim_hdf_keys(proc_hdfkeys, network, station_list)
Expand Down
8 changes: 7 additions & 1 deletion seismic/stream_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,14 @@ def read_h5_stream(src_file, network=None, station=None, loc='', root='/waveform
else:
group = root
# end if

stream = obspy.Stream()
try:
stream = obspy.read(src_file, format='h5', group=group)
except Exception as e:
print(str(e), ' Returning empty stream..')
# end try

stream = obspy.read(src_file, format='h5', group=group)
return stream
# end func

Expand Down

0 comments on commit ff239b5

Please sign in to comment.