problems plotting

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!!!

This looks like a bug for an edge case.. please open a ticket at github
and provide the data file for download somewhere.

best,
Tobias

I believe this is already fixed in the latest version. Can you upload the example file somewhere just in case so we can test it? Thanks.

Cheers!

Lion

Hi Lion and Tobias, here I am attaching a file wich I can not plot. I dont upload by github 'cause I am not sure about how does it work.

Thank you so much!!

2011.252.19.40.00.0…BRR…HHE.CM.SAC (2.29 MB)

Hi Juan,

works fine for me. An update to the latest ObsPy version should fix your issues.

Cheers!

Lion

Hi Lion and Tobias,

I have 0.1.5 version, is there a newest version? if there is a new version I have to uninstall it or I can just update my version?

Than you very much!!!