Commit e5ec372d authored by Javier Quinteros's avatar Javier Quinteros

Bugfix: Wrong block executed when metadata was requested

parent c18556d4
......@@ -566,18 +566,19 @@ def main():
else:
tr0 += Trace(data=data[0], header=data[1])
else:
with open('%s.mseed' % (curstream), 'wb') as fout:
# Do not call the decimate method if it is not needed
# 1: no decimation
if args.decimate > 1:
tr0.decimate(args.decimate)
# Use the headers from the decimated Trace
tr1 = Trace(data=tr0.data.astype(td.datatype), header=tr0.stats)
st = Stream([tr1])
logs.info('Storing channel %s' % curstream)
st.write(fout, format='MSEED')
if not args.metadata:
with open('%s.mseed' % (curstream), 'wb') as fout:
# Do not call the decimate method if it is not needed
# 1: no decimation
if args.decimate > 1:
tr0.decimate(args.decimate)
# Use the headers from the decimated Trace
tr1 = Trace(data=tr0.data.astype(td.datatype), header=tr0.stats)
st = Stream([tr1])
logs.info('Storing channel %s' % curstream)
st.write(fout, format='MSEED')
if __name__ == '__main__':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment