-
Notifications
You must be signed in to change notification settings - Fork 222
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 integration #967
Comments
As a seismologist, I almost use import pygmt
from pygmt.clib import Session
fig = pygmt.Figure()
fig.basemap(region=[-50, 100, -1, 3],
projection="X10c/5c",
frame=['xa20f10+l"T (sec)"', 'ya1+l"NO."', "WSrt"])
with Session() as lib:
lib.call_module("sac", "{} -En -Tt1 -C -M1.0c -W0.5p".format("saclist"))
fig.show()
$ cat saclist
seis1.sac
seis2.sac
seis3.sac If
|
This is a good point. If ObsPy is made a [optional] dependency, then we could leverage its I/O to read in all sorts of files (as well as Trace and Stream objects). |
if @liamtoney Could this issue be completed in two or more PRs? For example,
|
@core-man yes, exactly! The PyGMT devs were thinking that two PRs would make sense. Agreed on your first one. For number 2, I'm not quite sure what you mean by:
I was assuming we'd just utilize the ObsPy I/O here. We could either read it to e.g. a NumPy array, or quietly change it to a SAC file and plot it that way (hacky, perhaps). |
The major difficulty is that other waveform formats (e.g., miniseed) don't have time markers like SAC does (e.g., |
@liamtoney The above difficulty is also what I am concerned, while the format transformation itself should be easy as your suggestion. We don't have SAC headers related to time picks if we only use miniseed and StationXML, unless we also send an additional input with time picks to pygmt. |
I'm not familiar with SAC data/files, but is it information that could be relatively easily transferred to/from a numpy array/pandas dataframe? I figure |
In principle everything from a SAC file could be transferred to a numpy array/pandas dataframe or any structure we need. However, some of these steps are already handled by ObsPy, thus using these resources potentialy could help us a lot. As Liam suggested, first we should discuss if:
|
ObsPy is the de facto standard tool for processing seismological data using Python. GMT is already heavily used by seismologists. It seems natural to make PyGMT integrate better with ObsPy. This issue can serve as a platform for broad discussion of how we might accomplish this.
On the seismology side in general, we already have
Figure.meca()
wrapped. Some GMT plotting commands (namely,sac
) could be wrapped by PyGMT and integrated with standard ObsPy data objects, such asTrace
andStream
objects. We could even configureFigure.plot()
to takeInventory
objects.For waveform plotting, imagine:
(Of course, perhaps we'd want to rename
Figure.sac()
for this example...)We'd want to make ObsPy an optional dependency if we went down this route. I think that most of the work would be related to I/O, type-checking, etc. — as well as surveying the seismology community on what'd be useful.
Do folks have other ideas? Pinging @megies and @krischer in case you have any thoughts on this (thanks).
The text was updated successfully, but these errors were encountered: