Graphics Extensions #447
pavlis
started this conversation in
Design & Development
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Our current graphics module is functional but only makes static plots. Recall that was a design decision we discussed years ago as the first step for qc of jobs run as a large compute job on an hpc system. That is, interactive, event-driven graphics are completely at odds with the goal of a large processing job to handle millions of seismograms.
That said, for many real research applications some forms of graphical interaction with data are essential. Type examples are classic, manual phase picking and window selections that people often still do with SAC. In a package like Antelope that is a basic application run all day by seismic network analysts. Both examples provide solid solutions, but have their own individual issues that make them not appropriate as a component of MsPASS. Unless I miss something, I was somewhat surprised to learn that obspy has no event-driven graphics capability at all. All the pickers they implement are signal-processing based.
I did some digging and I am pretty sure I know why the authors of obspy never created any kind of picker. matplotlib has a somewhat elaborate event-driven system that they designed to be independent of the underlying window system. i.e. they tried to build a system that would work on window managers as different as MS Windows, gnome, or Qt. What they produced is remarkable, but (in my opinion anyway) extremely complicated and likely has a lot of dark alleys to walk into. It is clear there are some interesting extensions that could be made to our
SeismicPlotter
class with matplotlib's event-driven picking system. I'm in the process of producing a crude editor for finding data blemishes (mass recenters and the weird pings that broadband sensors are prone to throw) and zeroing them out. I'm doing this for a very long period spectral noise study were I'm chasing a hypothesis that sensor pings and residuals from an earlier method to remove mass-recenter transients are biasing the results. Anyway, I'm gaining some crude knowledge on this topic, but find it a real challenge.I decided to post this for discussion as it might be a good student topic. Over the years I've seen that a lot of CS students want to get experience in graphical programming. For that reason we might find someone enthusiastic about developing an appropriate extension to
SeismicPlotter
to do some basic picking. In any case, we should consider putting this our our longer-term development agenda.For the record, I think we need a picker that can do two generic things:
What our plotter needs is to define a generic handler to do something with the pick. That is, the user would need to supply a function to do what they want to do with the "pick". e.g. if one wanted to pick P wave arrival times, that is a "point" pick and the handler needs to translate the pick coordinates to some "arrival" class. Point picks are pretty trivial in matplotlib with the low-level function called
matplotlib.pyplot.ginput
, but there are some oddities in using that for a real user interface. A nice thing for ginput as a tool is it automatically shows you the point you picked with a little red point.Time interval picks are similar, but would need a fancier method to "pick" the interval. That is, it would need something like a dashed line draw box to pick and drag to mark the time interval. As with a point pick I think one allow user-defined function that would "do something" with the interval pick.
Those are some very early ideas I wanted to put down here for the record. As I said earlier, I think this should not be high on our development agenda unless we find a student who would really like to get experience in event-driven programming in general and python in particular.
Beta Was this translation helpful? Give feedback.
All reactions