Good aftenoon !!!
I am trying to plot a waveform in this way:
from obspy.core import read
st=read(‘waveform.sac’)
st.plot()
but i am getting this error, I dont know why…
ValueError Traceback (most recent call last)
in ()
----> 1 st.plot()
/Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/core/stream.pyc in plot(self, *args, **kwargs)
997 from obspy.imaging.waveform import WaveformPlotting
998 waveform = WaveformPlotting(stream=self, *args, **kwargs)
–> 999 return waveform.plotWaveform(*args, **kwargs)
1000
1001 def spectrogram(self, *args, **kwargs):
/Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/imaging/waveform.pyc in plotWaveform(self, *args, **kwargs)
198 self.plotDay(*args, **kwargs)
199 else:
–> 200 self.plot(*args, **kwargs)
201 # Adjust the subplot so there is always a fixed margin on every side
202 if self.type != ‘dayplot’:
/Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/imaging/waveform.pyc in plot(self, *args, **kwargs)
300 ((self.endtime - self.starttime) * sampling_rate >
301 self.max_npts):
–> 302 self.__plotMinMax(stream_new[_i], ax, *args, **kwargs)
303 else:
304 self.__plotStraight(stream_new[_i], ax, *args, **kwargs)
/Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/imaging/waveform.pyc in __plotMinMax(self, trace, ax, *args, **kwargs)
653 min = data.min(axis=1) * tr.stats.calib
654 max = data.max(axis=1) * tr.stats.calib
–> 655 extreme_values[start: start + pixel_count, 0] = min
656 extreme_values[start: start + pixel_count, 1] = max
657 # First and last and last pixel need separate treatment.
/Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/numpy/ma/core.pyc in setitem(self, indx, value)
3025 _mask = ndarray.getattribute(self, ‘_mask’)
3026 # Set the data, then the mask
-> 3027 ndarray.setitem(_data, indx, dval)
3028 ndarray.setitem(_mask, indx, mval)
3029 elif hasattr(indx, ‘dtype’) and (indx.dtype == MaskType):
ValueError: operands could not be broadcast together with shapes (800) (801)
Thak you so much!!!