Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 08 17:50
    amkearns-usgs commented #2592
  • Apr 08 14:28

    barsch on master

    add venv to .gitignore Merge pull request #2826 from H… (compare)

  • Apr 08 14:28
    barsch closed #2826
  • Apr 08 14:10
    HerrMuellerluedenscheid opened #2826
  • Apr 08 12:14
    lileipku00 commented #2823
  • Apr 08 11:26
    lynlyf synchronize #2775
  • Apr 07 06:36
    ThomasLecocq commented #2823
  • Apr 07 06:31
    ThomasLecocq labeled #2823
  • Apr 07 06:31
    ThomasLecocq labeled #2823
  • Apr 07 06:31
    ThomasLecocq commented #2823
  • Apr 07 04:30
    WJLV0425 starred obspy/obspy
  • Apr 06 22:53
    lileipku00 commented #2823
  • Apr 06 15:22
    barsch commented #2783
  • Apr 06 14:40
    d-chambers commented #2783
  • Apr 06 13:21
    myliangding starred obspy/obspy
  • Apr 06 10:51
  • Apr 06 10:51
    volkanozsarac starred obspy/obspy
  • Apr 06 08:02
    ThomasLecocq commented #2803
  • Apr 06 07:55
    flixha edited #2814
brioglade
@brioglade
What's the error that some CMT can't plot?
Elliott Sales de Andrade
@QuLogic
It starts with a dash and so is interpreted as an option
try obspy-mopad plot -- '-2,1,1,0,0,1'
Jonathan Schaeffer
@joschaeffer_gitlab
Hi there, can you tell how obspy is numba friendly ?
would it be easy to add @numba decorators and see a good perf gain ?
For instance for computing PPSD
Lion Krischer
@krischer
No numba would not do anything for PPSD computation. numba is a just in time compiler for functions that use numpy. So it can really only fully speed up functions that take numpy arrays and spit out numpy arrays and also does not call any other library inside the function. But it is pretty great for that.
Also the PPSD computation is (I assume) compute limited due to the required FFTs. numpy's and scipy's FFT implementations are decent but not the fastest around. There is a python wrapper around FFTW that can monkey patch numpy and scipy to use FFTW's FFT implementations.
But I never benchmarked the PPSD computations so that would have to be the first step to understand if and how it can be made faster.
Jonathan Schaeffer
@joschaeffer_gitlab
Thank you @krischer for your clear answer.
At Resif-DC we are actualy recomputing all PPSD for our archive in order to provide PDF figures to endusers. We could use this occasion to benchmark the process. If you think it's interesting, we could try your suggestion of using FFTW. Can you help us out to implement this (maybe by using version of Obspy that we would patch ?)
Lion Krischer
@krischer
The PPSD code currently uses matplotlib.mlab.psd() for the actual spectral estimations. pyfftw can monkey patch the numpy ffts: https://pyfftw.readthedocs.io/en/latest/source/tutorial.html#integration-with-3rd-party-libraries - make sure to turn on the cache here as I think it should help a lot. Thus no change to ObsPy is needed. A great solution might also be to replace matplotlib.mlab.psd() by scipy.signal.welch() which uses scipy's fft which is faster and has better way to change the backend - but that would be a more involved change.
Daniel G
@dbgraybeal
Is this the right place to ask for advice/clarification about contributing to Obspy? I'm maybe overly nervous about it since I haven't contributed to an open-source project before.
6 replies
DJMO3
@DJMO3
Hello everyone. I was told that I can store a recorded event at all stations from a certain network (i.e. all the waveform data from all the stations for a given time period) in a single file. I was also told that obspy can do that. Automatically did my search but was unable to find anything like that.
Does such a file type exist? And how do I use obspy to download and use it in my program?
6 replies
Thea92
@Thea92

Hello everyone, I hope this is the right place for questions considering the obspy codes.
My question is about the remove_response code in obspy:
I'd like to remove the instrument response from the recordings of a hydrophone. The raw units are counts which are proportional to Pascal. With remove_response, I can choose between ACC, VEL and DISP output. Now I wonder which output unit to choose for the hydrophone....from velocity one needs to integrate or differentiate to ACC and DISP. Is the code recognizing the unit of the input. Would it recognize, that the counts of the hydrophone are proportional to Pascal and if I tell to restitute to ACC, it is not additionally integrating? Or is the code treating the Hydophone traces like 'normal' seismometer traces where the counts are proportional to Velocity and I should restitute the data to 'VEL', since then the hydrophone data still keeps proportional to Pascal and thus somehow the ACC.
I have seen the special handling hydrophone, but I don't know how to use it and also, if the output can be ACC, since there it's written: Do not differentiate when `special_handling="hydrophone"

I'd appreciate any help! Thanks a lot!

Thea92
@Thea92
From the plots=true plots, I assume that for the hydrophones I need to choose 'VEL' as output, since then the instrument response seems to be correct (neither differentiated or integrated), but I'd like to ensure myself, that I'm interpreting the instrument response removal correctly....
edemqs
@edemqs
Good morning to everybody. I have a question. Is it possible to change the axes of the spectrogram from time - frequency to time - period using Obspy? Thank you very much in advance.
Claudio Satriano
@claudiodsf
Hi @Thea92 , that’s right: for hydrophones you have to use output=VEL, which does not introduce additional differentiation or integration. This is not really intuitive and I’m about to propose a new option output=DEF (default) which hopefully will be part of ObsPy 2.0 :wink:
Claudio Satriano
@claudiodsf
Just made a pull request! See obspy/obspy#2806
Thea92
@Thea92
Hi @claudiodsf thanks for your reply! An output=DEF option would be a nice tool in future! :-) Thanks a lot
filefolder
@filefolder
Q for the devs, possible to get our FDSN server into the list of URL_MAPPINGS?
Claudio Satriano
@claudiodsf
@filefolder sure! Please make a pull request 😉
Jonathan Schaeffer
@joschaeffer_gitlab

Hello ! Our team made some progress in generating PPSD graphs with obspy. I'd like the comments of the community (scientists and obspy devs).

  1. We have a reference plot produced by our old PQLX server (fig 1.)
  2. A plot generated by computing the frequence's response using the inventory metadata (fig2)
  3. A plot generated by computing the frequence's response using a PAZ dictionary (fig3)

Method 3 is about 3 time faster to produce the NPZ stat file than method 2.
Jérôme Touvier (our developper who produced this result) is not connected in the chat yet but will certainly join us.

What do you think about the figures ? About the compute time difference ? Which strategy (inventory (2) or PAZ (3) ) seems best to you ?
Fig. 1
image.png
Fig. 2
image.png
Fig. 3
image.png
DJMO3
@DJMO3

Hello everyone, I am getting a warning message when using the stream.trim() method

UserWarning: AutoDateLocator was unable to pick an appropriate interval for this date range. It may be necessary to add an interval value to the AutoDateLocator's intervald dictionary. Defaulting to 30. plt.setp(ax.get_xticklabels(), fontsize='small')

The warning appears when I try to plot the graph. So far, I don't see any major shift in my date range. Can anyone advise me on this?

My implementation is as follows:

st.trim(starttime=stat.starttime + trim_time, endtime=stat.endtime)

Claudio Satriano
@claudiodsf
Hi @joschaeffer_gitlab : not sure why method 3 is faster. Pinging @ThomasLecocq who certainly knows more than me on this subject. It's weird to see that method 2 and 3 plots are identical except for periods below 0.03 sec 🤔
David Naranjo
@davidn182
Hello everyone. I am working with seismic interferometry, and I am using several cross-correlation files. Is there a way to change the start-time of the trace to be zero in the middle? To have negative and positive times.
Thomas Lecocq
@ThomasLecocq
I think method 2 uses evalresp for creating the response information, while when PAZ are provided it's skipped, thus faster; There were discussions/notes about this in the past, can't remember when. @krischer is evalresp-expert here :) indeed 2 & 3 look different for freqs close to Nyquist
Jonathan Schaeffer
@joschaeffer_gitlab
Thank you for your feedback @ThomasLecocq
Lion Krischer
@krischer

@ThomasLecocq @joschaeffer_gitlab - yea this is pretty much the reason. If the full inventory is present evalresp will evaluate all stages of the response which just takes a lot longer. If there are only PAZ, the response will be fully computed from it. If the PAZ alone are good enough is situation dependent: In most cases it will likely work just fine in the passband of the instrument. A colleague of mine once estimated that like 10% of stations have responses that are not sufficiently approximated by PAZ. If you are familiar with the stations you are using you can probably make decision based on that. Otherwise you could also just test if the reponse with PAZ vs full response is similar enough once for each station epoch and then decide case by case.

If someone really wants to dig down: I suspect the whole thing could be made quite a bit faster by doing some smart caching of the response. Right now the response is computed for each data segment but it really only would need to be computed for each station epoch. Some work would be required to figure out when to use the cached value and when not but it should not be too hard to do: https://github.com/obspy/obspy/blob/master/obspy/signal/spectral_estimation.py#L1252

brioglade
@brioglade
hi,I use HybridMT package to do seismic source CMT inversion.Then,I use obspy-mopad to plot the beachball which is not matched with the result of HybridMT beachball plot from the same moment tensor.What's wrong?I think the parameter like system-basis or projection etc. are setted no problem.
brioglade
@brioglade
hi,could you please make sure about it if you are fimilar with HybridMT package?
Mike Hearne
@mhearne-usgs
Is anyone else having trouble conda installing obspy right now? I’ve tried a number of different python/obspy combinations today, and I keep getting the error described here: obspy/obspy#2824
79seismo
@79seismo
@brioglade are you sure you're using the same coordinate system as that in HybridMT? i.e. Harvard convention, AKi convention, Lower hemisphere, Upper hemisphere etc. etc.
brioglade
@brioglade
@79seismo Thank you very much for the replies!Yes,CMT system-basis and lower hemisphere.Could you please have a try ?I really want to know what's wrong with it?Thanks again!
79seismo
@79seismo
@brioglade send me the Hybrid MT MT?
brioglade
@brioglade
@79seismo here,only email needed. https://www.induced.pl/software/hybridmt
@79seismo Thank you very much.
79seismo
@79seismo
@brioglade just send me one of your MT results and I'll check in mopad ..
brioglade
@brioglade
2.80208e+012 7.90807e+011 3.57044e+012 5.11117e+011 4.14803e+012 1.11938e+011
focimt -i ./examples/example1.txt -t pdf -p SL -z 300 -o test00 -s DFT -d C
brioglade
@brioglade
hi,everyone,I need you help.I use HybridMT package to do seismic source CMT inversion.Then,I use obspy-mopad to plot the beachball which is not matched with the result of HybridMT beachball plot from the same moment tensor.What's wrong?I think the parameter like system-basis or projection etc. are setted no problem.
Thomas Lecocq
@ThomasLecocq
Dear @brioglade it's not necessary to repeat your question. I'm sorry it seems only @79seismo could help you here, as you see, we are not a lot present on this chat, and certainly very few knowing how to use Mopad, and/or HybridMT.
1 reply
DJMO3
@DJMO3
Greetings experts.
Are there any ObsPy applications that calculates the back azimuth at a given station using the Z-, N-, and E- seismograms? The idea here is to calculate the back azimuth at each station and use the S-P time difference to roughly estimate the epicentre of an earthquake. Could you please point me to any resources that might help me get more insight on how to implement something like this. I will be grateful!
79seismo
@79seismo
@brioglade just giving numbers isn't enough, you have to tell me what elements these are in the MT (Mrr, Mrt, Mrp etc.)