Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:32
    Lewis-Khan edited #2862
  • 10:32
    Lewis-Khan edited #2862
  • 10:27
    Lewis-Khan opened #2862
  • 00:43
    calum-chamberlain commented #2779
  • 00:43
    calum-chamberlain closed #2779
  • 00:10
    lileipku00 commented #2779
  • 00:06
    lileipku00 commented #2779
  • Aug 03 20:23
    calum-chamberlain commented #2779
  • Aug 03 19:58
    trichter commented #2820
  • Aug 03 13:51
    Lewis-Khan commented #2820
  • Aug 03 13:36
  • Aug 03 07:01
  • Aug 02 13:55
    Linvill commented #1846
  • Aug 02 13:54
    Linvill commented #1846
  • Aug 02 13:50
    Linvill commented #1846
  • Aug 02 12:43
    pavlosidelov starred obspy/obspy
  • Aug 02 00:39
    trichter commented #2820
  • Aug 01 09:48
  • Aug 01 02:47
    Yukimura-Liu starred obspy/obspy
  • Jul 31 16:46
    hairo1984 starred obspy/obspy
79seismo
@79seismo
@ThomasLecocq Thanks, just updated ObsPy and it fixed it. I remember I intentionally didn't update ObsPy because something didn't work, but can't remember what now. Thanks again!
1 reply
Ghost
@ghost~60ed85316da037398480f538
Hii, can anybody suggest where to get poles and zeros file for the Trillium 120p Nanometrics sensor??
Thomas Lecocq
@ThomasLecocq
using the NRL : http://ds.iris.edu/NRL/ or from osbpy NRL request tool
Ghost
@ghost~60ed85316da037398480f538
Thanks
ese-sm7917
@ese-sm7917
Hi everyone, has anyone else come across instances where the IRIS client returns a 'no data found' message when using get_events for fetching recent events? I get this for any search (any region, or magnitude limits) that involves getting events later than September 2015, even though the data clearly exists on the ISC mirror server the obspy client queries.
Thomas Lecocq
@ThomasLecocq
@chad-iris maybe ?
Thomas Lecocq
@ThomasLecocq
did you make A LOT of requests in a very short time ? could you retry once ?
you're using FDSN client, right ?
ese-sm7917
@ese-sm7917
Yes this was using the FDSN client - and even a single request, e.g. a single search for events in 2020-21 returns the same error
datseismo
@datseismo

Hii, i want to apply hilbert transform on the given .sac files and want to save these in same .sac format again.
My test data are here https://i.fluffy.cc/j9VNJdnqhGGNHczVX3MrzKmnpbFCSLj5.html
i tried the following code

from scipy.signal import hilbert
from obspy import read
import glob

data=glob.glob(’./*.sac’)
print(data)

for file in data:
st=file[0]
print(st)
st.write(‘data’,format=‘SAC’)

However, i donot get suitable result.please suggest a better solution.Thanks.

Thomas Lecocq
@ThomasLecocq
you don't read the file....
and please take time to read the traceback error message you received when running this code
datseismo
@datseismo
In [4]: from scipy.signal import hilbert 
In [5]: from obspy import read                                                  

In [6]: data=read("minimal_example01.sac")                                      

In [7]: data1=hilbert(data)                                                     

In [8]: data1.write('sac_data',format='SAC')                                    
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-8-e2aad7b891f5> in <module>
----> 1 data1.write('sac_data',format='SAC')

AttributeError: 'numpy.ndarray' object has no attribute 'write'
@ThomasLecocq i did as above for single file...can you please suggest how to save it in .sac format again
Thomas Lecocq
@ThomasLecocq
the hilbert function returns a numpy array, and not a Stream or Trace object
so you need to re-assign it to the Trace's .data
datseismo
@datseismo
how sir...please ?
Thomas Lecocq
@ThomasLecocq
e.g:
data = read(...)
for trace in data:
    trace.data = hilbert(trace.data)
data.write('output.sac')
please take some time to read and understand those graphics: https://docs.obspy.org/packages/obspy.core.html
datseismo
@datseismo
@ThomasLecocq For a signal in the time domain, the Hilbert transform applies a –90-degree phase shift to positive frequencies of the corresponding Fourier components...but if you apply what you suggest doesnot do anything...same plots is coming out
Thomas Lecocq
@ThomasLecocq
What i wrote is what you asked for. I don't know the internals of the scipy' Hilbert
79seismo
@79seismo
@datseismo Hilbert transform usually advances the phase by 90˚ (i.e. a 90˚ rotation in the complex plane) and if you plot the real part of the Hilbert transform it will return the same input signal, which is what you might be doing. You've to consider the imaginery part as well. You can prove this to yourself by plotting both the real and imaginery parts and then plotting the absolute of the Hilbert transform, which will return the envelope.
Thomas Lecocq
@ThomasLecocq
So what @79seismo means is that , most probably, writing the result to SAC eliminates the imaginary part, only saving the real part, i.e. the input signal ?
I know no standard format allowing to write real+complex numbers
79seismo
@79seismo
@datseismo @ThomasLecocq you can do this in SAC with WRITESP
datseismo
@datseismo
i did something like data = read(...) for trace in data: trace.data = hilbert(trace.data) trace.data = trace.data.imag data.write('output.sac')
Thanks @79seismo & @ThomasLecocq for your support
sadalsuud
@sadalsuud
hi somebody know the way to make seg-y to seg-2?
Thomas Lecocq
@ThomasLecocq
not with obspy - try segyio for reading at least
sadalsuud
@sadalsuud
Why Is dificult looking for a script Python that it writes seg-2 format ? :(
Thomas Lecocq
@ThomasLecocq
Well, ask the companies who make seg2, to help us with a python binding...
sadalsuud
@sadalsuud
that seg-2 format not used much, all is seg-y ...
Thomas Lecocq
@ThomasLecocq
So why do you need it?
sadalsuud
@sadalsuud
For use it as input for a program that read only seg-2. But I found that geopsy can convert formats
Atikul Haque Farazi
@ahfarazi-kU
Hi, is it possible to convert win file to sac file using obspy? If so, how? Thanks in advance!
Thomas Lecocq
@ThomasLecocq
if you're talking about the old win format (from e.g. datamark dataloggers) then you can simply read them using obspy (if you read multiple files: merge the traces into one (if your data is continuous)) and write to SAC - if you talk about win32, then no, we never finished the I/O reader for win32 because we never were officially allowed to use a win32 file for our automatic testing
Thomas Lecocq
@ThomasLecocq
and if you really need win32, there is a few-year-old pull request that you could check out and use for reading, but that's a bit not easy
Atikul Haque Farazi
@ahfarazi-kU
Dear Thomas, than k you so much for replying me.
zersorger
@zersorger
Hey, is it somehow possible to plot traces by e.g. distance from a location, but with matplotlib?
Calum Chamberlain
@calum-chamberlain
Do you mean something like this?
zersorger
@zersorger
Exactly, but with matplotlib, because I have to play a bit with the plots more. I want the first subplot to be the complete mainshock waveform from p arrival until after the surface waves, and for the other subplots I want only the surface waves waveforms from all stations in my radius but sorted after distances to the mainshock, if that is possible.
zersorger
@zersorger
or can I assign the st.plot(section) to my subplots ?
Elliott Sales de Andrade
@QuLogic
you can just grab the data and plot them directly then?
zersorger
@zersorger
In the end I just don't know how to sort my inventory with my stations by distance to the mainshock and not alphabetically (default?).
zersorger
@zersorger

or can I assign the st.plot(section) to my subplots ?

Ah...it hink that's it.

Calum Chamberlain
@calum-chamberlain
If you need more coffee help for that you might want to look at the source code for the section plot to see how it is done in ObsPy then adapt to your needs: https://github.com/obspy/obspy/blob/c414a952d87ad7f4c0a44720303d9a0a189ca315/obspy/imaging/waveform.py#L1070
@QuLogic can we merge the mac OS arm update: conda-forge/obspy-feedstock#45 I don't have admin rights over on the feedstock repo. I also don't have an arm mac to test it.
Elliott Sales de Andrade
@QuLogic
I don't have a mac either, so hopefully that works
Calum Chamberlain
@calum-chamberlain
Thanks - I will see if one of the people requesting the update can run some tests.
zersorger
@zersorger
@calum-chamberlain thanks a bunch!