Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obspy.imaging.waveform: ValueError: zero-size array to ufunc.reduce without identity #8

Closed
trac2github opened this issue Sep 9, 2012 · 1 comment

Comments

@trac2github
Copy link

{{{

import obspy
from obspy.seishub.client import Client
c = Client("http://teide.geophysik.uni-muenchen.de:8080")
start = obspy.UTCDateTime(2008,1,1,12,00,00)
end = start + 10
st = c.waveform.getWaveform("BW", "MANZ", "", "_", start, end)
Enter username for SeisHub at teide.geophysik.uni-muenchen.de:8080: admin
Enter password for admin in SeisHub at teide.geophysik.uni-muenchen.de:8080:
st.plot()
Traceback (most recent call last):
File "", line 1, in
File "c:\users\robert\workspace\obspy\obspy.core\trunk\obspy\core\stream.py", line 306, in plot
waveform.plotWaveform(self, *_kwargs)
File "c:\users\robert\workspace\obspy\obspy.imaging\trunk\obspy\imaging\waveform.py", line 119, in plotWaveform
endtime=endtime)
File "c:\users\robert\workspace\obspy\obspy.imaging\trunk\obspy\imaging\waveform.py", line 379, in _getMinMaxList
maxlist.append(_i.data[int(start) : int(end)].max())
ValueError: zero-size array to ufunc.reduce without identity
}}}

@trac2github
Copy link
Author

[krischer](In [577]) - add method for Traces and therefore all depending methods like merge, ... now return a masked array if it contains NaNs. In addition it now set the stats.npts attribute to the number of samples in the Trace excluding NaNs. Please check whether it breaks anything.

  • This required some changes in Trace methods (e.g. the len(Trace) now returns the number of not masked samples) and also some changes in the tests.
  • obspy.imaging.waveform now hopefully plots whatever you throw at it (closes Waveform plotting of short seismograms #5 and obspy.imaging.waveform: ValueError: zero-size array to ufunc.reduce without identity #8). I already did a lot of tests but it got pretty complicated so please help testing. Especially look at the scaling of the y-axis, the number of samples in the top right corner and whether all samples are plotted.
  • Removed waveform tests from the genereal obspy.core.testing because they now take too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant