waveform.py bug fixes

Hi,

This may be more appropriate for obspy.developers, but I'm not on that list so I thought I would mention it here.

I'm new to obspy, but we're finding it very capable and useful. One of the options we wanted to use is the dayplot plot type in obspy.imaging. Unfortunately, we could not make it work reliably out of the box. I ended up making a significant number of modifications to several functions (only those relevant to dayplot) and it now works quite well for us. I would be happy to share the results if they are of interest to others. I can send the revised file, a diff or whatever works best.

Thanks,

-Victor

Victor Kress
Pacific Northwest Seismic Laboratory
Seattle, Washington, U.S.A.
kress@u.washington.edu

Dear Victor,

This may be more appropriate for obspy.developers, but I'm not on
that list so I thought I would mention it here.

devs@obspy.org is more for internal communication within the developers
- - however you should be able at least to sent an email to the list

I'm new to obspy, but we're finding it very capable and useful. One
of the options we wanted to use is the dayplot plot type in
obspy.imaging. Unfortunately, we could not make it work reliably out
of the box. I ended up making a significant number of modifications
to several functions (only those relevant to dayplot) and it now
works quite well for us. I would be happy to share the results if
they are of interest to others. I can send the revised file, a diff
or whatever works best.

sounds good - either open up a ticket at www.obspy.org and attach the
files or sent it to me directly (diff should be fine)

Cheers,
Robert

- --

Dr. Robert Barsch

Ludwig-Maximilians-Universität München
Department of Earth and Environmental Sciences, Geophysics
Theresienstr. 41/IV
D-80333 Munich
Germany

Tel: +49 (0) 89 2180 4201
Fax: +49 (0) 89 2180 9942010
Mail: barsch@lmu.de

Hi,

After looking around, it looks like I don't have a local copy of the unmodified file, but the full file isn't very long:

waveform.py (36.2 KB)

Dear All,

I am a beginner with python and I am interested in using obspy.
I have tested several functions offered by obspy with success but I have some difficulties with the dayplot type in plot function. (obspy.core).
I tried the examples found on the wiki with out success.
I get this error message :

In [29]: st.plot(type='dayplot')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)

/data/LOGICIELS/scripts-python/test-psd-python/TestSite/DATA/FR/OGDI/<ipython > in <module>()

/usr/lib/python2.7/site-packages/obspy.core-0.4.8-py2.7.egg/obspy/core/stream.pyc in plot(self, *args, **kwargs)
    779 raise
    780 waveform = WaveformPlotting(stream=self, *args, **kwargs)
--> 781 return waveform.plotWaveform()
    782
    783 def spectrogram(self, *args, **kwargs):

/usr/lib/python2.7/site-packages/obspy.imaging-0.4.7-py2.7.egg/obspy/imaging/waveform.pyc in plotWaveform(self, *args, **kwargs)
    162 self.plot(*args, **kwargs)
    163 elif self.type == 'dayplot':
--> 164 self.plotDay(*args, **kwargs)
    165 self.fig.canvas.draw()
    166 # The following just serves as a unified way of saving and displaying

/usr/lib/python2.7/site-packages/obspy.imaging-0.4.7-py2.7.egg/obspy/imaging/waveform.pyc in plotDay(self, *args, **kwargs)
    319 % len(self.color)])
    320 # Set ranges.

--> 321 ax.xlim(0, self.width - 1)
    322 ax.ylim(-0.3 , self.steps + 0.3)
    323 self.axis = [ax]

AttributeError: 'AxesSubplot' object has no attribute 'xlim

Is anybody know how to solve this issue?

I found in the archive list some post about dayplot type bugs but can't find the solution to my problem.

Best regards
Mickael.

Hi Mickael,

this looks like a bug to me that was fixed in revision 2714
(http://obspy.org/changeset/2714/obspy). I think for the moment you
would have to use the developer version of obspy.imaging (e.g. doing
easy_install -U obspy.imaging==dev; see install instructions on the
homepage.).

best,
Tobias

Mickaël LANGLAIS wrote:

The dayplot function did not work for us out of the box either. I could be wrong, but it looked like it had not been completely finished (coder moved on to more pressing projects) as some of the mathplotlib function calls were similar to existing calls, but not quite correct. I did some fairly extensive rewrite and we have a working version. I submitted an earlier version, but we have made several enhancements since. I would be happy to share what we have.

-Victor

Hi Victor,

I think some work has been done on it off late and I am pretty sure that
the current developer version works.

You could try the developer version as mentioned before. If you still
think you have improvements compared to that version let us know. If you
encounter problems and start working on them please let everybody know
immediately (ticket or mailing list) to avoid bugs getting squashed
multiple times by different people.
You can either send us your patches (e.g. to the devs mailing list) or
we are happy to grant write access to the svn.

best,
Tobias

Kress V. wrote:

Hi all,

as Tobi pointed out some work has recently been done on the dayplot function. It
originally was only intended to handle full 24 h files.

Any ObsPy revision upwards of 2879 should have a fully functional dayplot method
with all the functionality documented here:

http://docs.obspy.org/packages/autogen/obspy.core.stream.Stream.plot.htm

If I remember correctly this version also runs a quite a bit faster than previous
versions so it might be worthwhile to check it out.

Please let us know if you have any enhancement/fixes!

Best wishes,

Lion

Hi all,

Thanks for the answers.

I have solved my problem by upgrading to the version O.5.0.

Regards.

Mickael.