weixin_39747577 2020-11-20 19:47
浏览 0

Stream.merge(): shape mismatch: objects cannot be broadcast to a single shape

I suppose this relates back to ticket #48. I get this error when I try to merge several GSE2 files. However, the same script works for other sets of GSE2 files (and I get the files from the same source and dont manipulate them beforehand) so I don't see where I'm going wrong.

(What does this error message even mean?)

{{{ import os import glob from obspy.core import read, Stream, trace from matplotlib import pyplot import numpy as np

np.seterr(all='raise') st = Stream() tmp = Stream()

path = 'data/rawGSE/' filelist = glob.glob( os.path.join(path, 'CN20090419*.GSE2') ); filelist.sort() for infile in filelist: tmp = read(infile) st += tmp.select(station='FUSIO')

st.merge(method=1,fill_value='interpolate')

st.plot() st[0].plot() pyplot.plot(st[0].data); pyplot.show() }}}

I get the error both from st.plot() and from st[0].plot(), but when I plot the trace with pyplot they appear to be properly merged.

I'm using python 2.7 and I installed obspy last week, so I should have all the latest files there.

该提问来源于开源项目:obspy/obspy

  • 写回答

8条回答 默认 最新

  • weixin_39747577 2020-11-20 19:47
    关注

    [anonymous] Could you break down the problematic files to two or three which do not merge together and attach these files to this ticket using the "Attach file" buttom. This would be really helpfull in finding the problem.

    评论

报告相同问题?