Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:27
    nukenine edited #2777
  • 00:26
    nukenine opened #2777
  • Jan 16 06:33
    cicyby starred obspy/obspy
  • Jan 15 22:24
    scottstanie starred obspy/obspy
  • Jan 13 04:41
  • Jan 13 00:03
    dsentinel commented #2761
  • Jan 11 21:08
    chad-iris edited #2776
  • Jan 11 21:06
    chad-iris commented #2761
  • Jan 11 20:32
    chad-iris commented #2761
  • Jan 11 17:18
    dsentinel commented #2761
  • Jan 11 13:15
  • Jan 11 13:15
    limitswen starred obspy/obspy
  • Jan 11 01:53
    chad-iris commented #2761
  • Jan 11 01:10
    chad-iris opened #2776
  • Jan 10 09:43
    malikos180 commented #2767
  • Jan 08 15:46
    lsawade starred obspy/obspy
  • Jan 08 00:04
    JakovGlavac starred obspy/obspy
  • Jan 06 03:18
    lynlyf opened #2775
  • Jan 06 02:29
  • Jan 06 01:10
    tkoyama010 starred obspy/obspy
Tobias Megies
@megies
we do not have a client for rtpd @ivmoma one thing you could do is set up a slim seiscomp instance (i would just go ultra old version 2.6) and connect that seiscomp with the rtpd plugin to fetch the reftek data stream and then make it available via seedlink. that seedlink stream you could listen to with obspy in realtime
@/all i see so many questions that might be interesting for more people. Everybody should really move to the discourse.obspy.org, we can answer all these questions over and over here because nobody will find the answers anymore after some time, or we could have it nicely searchable and well organized in the discourse
i might stop answering questions that should go into discourse and just state here "please ask this in discourse"
Ghost
@ghost~5e5ac431d73408ce4fdb29e3
Dear experts, I have a small query. I have collected the field data sets using the reftek format from 01-01-2018 to 01-01-2019. In each day there are 24 number of 1 hour files are saved per stations. additionally in between in some days there is data loss because of the power interruption. Now I want to pick the local P and S phases from these data sets insofar i need to merge all 1 hour file in order to make a 24hours single reftek file and wherever there is data loss i need to fill the gaps using zero so that in the days where data gaps is there the merged file would be of 24 hours.Can anybody suggest the proper solution for doing this work.Thanks.
Tobias Megies
@megies
That sounds rather convoluted. Maybe you should instead fix your picking routine to properly take timing information into account, rather than twist and bend your whole workflow to an inflexible picking tool
zeynepodabass
@zeynepodabass
Hi, I am creating event metadata file by using this tutorial https://krischer.github.io/seismo_live_build/html/ObsPy/05_Event_metadata_wrapper.html I also add picks. My aim is using this file with EQcorrscan. But when I read it on EQcorrscan, I see that it doesn't take all information. In my catalog creating notebook, I can see details of cat.events but my EQcorrscan notebooks doesn't have these details. It only includes resource id s . Could anybody suggest a solution for this problem?
Ghost
@ghost~5e5ac431d73408ce4fdb29e3
@megies donot think this is the proper reply as an expert.
Calum Chamberlain
@calum-chamberlain
@zeynepodabass I don't think we have enough information to help you there. Make sure that you write your updated catalog out (including picks), and read in from that file in your other notebook. If you need more help with EQcorrscan specific things then please ask in the EQcorrscan gitter room.
@geophysics91 you were filling gaps with zeros in a previous code you sent me - just do the same thing. However, you would be better off re-writing your picking code to cope with gaps in data as @megies (expertly) said. Ideally you would do as little mucking around with your data as possible to keep your raw data sacred.
sion kumar
@sionkumar_gitlab
Hii, I am trying to do travel time Tomographic inversion using linear algebra(Tobias Megies) using python.How can i obtain tutorial for the same.Could anybody suggest some solutions ??
Lion Krischer
@krischer
@sionkumar_gitlab This is really quite far outside the scope of ObsPy. ObsPy provides generic data parsing and processing methods but tends to shy away from full blown applications like tomography. A reasonable way forward for you might be to find some recent papers applying the method you are interested in and contacting the authors if they can give you some hints or share code with you.
geophysics91
@geophysics91
Thanks all of you for your suggestions....
However i have a problem on slicing the UTCDateTime, i just want to convert tr.stats.starttime i.e. RT.RET.00.BHE2018-01-01T01:00:00.005000Z to RT.RET.00.BHE20180101T010000Z .while slicing it gives error like UTCDateTime object is not subscriptable.My files are in miniseed format. can anybody suggest a solutions for the same ??
Calum Chamberlain
@calum-chamberlain
I'm not really sure what you are asking @geophysics91 - it looks like you want to format a UTCDateTime as a string? If so, look at the UTCDateTime.strftime method. Like most things in Obspy, UTCDateTime has pretty handy docs that you should read
Kevin2020US
@Kevin2020US
I am doing modeling work. I am wondering if ObsPy can generate both first arrival traveltimes and synthetic seismograms based on a velocity model?
I am pretty new for ObsPy. Thanks.
Chet Hopp
@cjhopp

Hi @Kevin2020US , for travel times, check out the port of TauP here: https://docs.obspy.org/packages/obspy.taup.html

I have no experience using this, but you can query the IRIS Syngine database like detailed here: https://docs.obspy.org/packages/obspy.clients.syngine.html

I believe both of these are limited to various 1D reference models, so for 3D models you may have to look elsewhere. Hope those prove helpful!

Also, usage questions like this are moving to https://discourse.obspy.org/, where you can search for previously-answered questions (or feel free to ask one yourself). That way, others can find the answers down the road.

Kevin2020US
@Kevin2020US
Thanks @cjhopp. I will check it out.
filefolder
@filefolder
hi, does anyone have an opinion on which machine learning python package would be best to learn/adopt with obspy/general seismic processing? the obspy docs reference MLPY with CWT stuff but it hasn't been maintained since 2012 (along with the usual resulting install errors / dependency issues)
Tobias Megies
@megies
i personally dont do ML but i htink scikit learn is pretty popular
filefolder
@filefolder
thanks, yeah thats what im leaning towards, seems best integrated with sci/np but was wondering if obspy development may be leaning towards one or another in the future, particularly re: CWT e.g. https://docs.obspy.org/tutorial/code_snippets/continuous_wavelet_transform.html
Tobias Megies
@megies
that was really just somebody wanting a CWT done and we thought it might a nice thing to show in the code snippets. mlpy likely is dead like you already stated

if obspy development may be leaning towards one or another in the future

i dont think you have to worry about that, obspy might get used in ML applications, but i dont see it happening the other way around

Carlos Alberto Ospina Caicedo
@cospina1_gitlab

Im also trying to generate a script exe with PyInstaller, there was an answer to @yhtang1974?

I packaged a python script to exe with Pyinstaller, this script use obspy trace to write a SAC file, and can normally run in Pycharm ,but the exe file throws the following error...

sanjay kumar
@kpsanjay
I tried to run the example to generate the fault plane solution using obspy- isola. while executing the code class_isola.py , i found the syntax error. base) sanjay@SanjayNCS:~/misola/1_Efpalio_SAC_orig$ src/invert.py
Traceback (most recent call last):
File "src/invert.py", line 3, in <module>
from class_isola import
File "/home/sanjay/misola/1_Efpalio_SAC_orig/src/class_isola.py", line 31, in <module>
import obspy
ImportError: No module named obspy
(base) sanjay@SanjayNCS:~/misola/1_Efpalio_SAC_orig$ source activate obspy
(obspy) sanjay@SanjayNCS:~/misola/1_Efpalio_SAC_orig$ src/invert.py
Traceback (most recent call last):
File "src/invert.py", line 3, in <module>
from class_isola import

File "/home/sanjay/misola/1_Efpalio_SAC_orig/src/class_isola.py", line 64
return dict(map(lambda (key, value): (prefix+str(key)+suffix, value), somedict.items()))
^
Thomas Lecocq
@ThomasLecocq
This message was deleted
please provide the full traceback of the error , only for the (obspy) environment (of course it doesn't work when obspy is not installed)
AFAIK (as far as I know) ISOLA-Obspy is a package that uses obspy and the documentaiton hasn't been updated since 2016, so not sure if it is still under development. You should contact the author directly maybe
geophysics91
@geophysics91
hii experts, i want to cut all given waveforms of a directory to 9001 data points randomly..how can i do it.can anybody suggest a looping script for the same .original wave have the .npts 360000
Thomas Lecocq
@ThomasLecocq
I don't understand what you mean
geophysics91
@geophysics91
sir i have the original seismic waveform having the tr.stats.npts = 360000 which is of 1 hour length. Now i want to cut the waveforms randomly in such a way that tr.stats.npts would be 9001...same thing i want to do for many waveforms
Thomas Lecocq
@ThomasLecocq
sorry, you want random 90 seconds of data from a 100 Hz waveform, right ?
geophysics91
@geophysics91
yes
Thomas Lecocq
@ThomasLecocq
assuming your data is continuous, you could:
  • generate a random number between 0 and 3510
  • copy & trim the stream to st.stats.starttime + randomnumber, st.stats.starttime + randomnumber + 90
geophysics91
@geophysics91
thanks sir..i will try and let u know.
geophysics91
@geophysics91

@ThomasLecocq i wrote few lines of code it shows error like AttributeError: 'str' object has no attribute 'copy' plus i want to save each sliced traces in the sac format or text file...i donot know where i am doing wrong. my code is attached below: `import glob
from obspy import read
from numpy import random

x = random.randint(50)

files=glob.glob("/home/geo/test_data/*.sac")

trace_lenght = 90

for trace in files:
tr=trace.copy()
print(tr)
start = tr.stats.starttime + x
stop = tr.stats.starttime+x+trace_length
tr1=tr.slice(start,stop)
tr1.write('files'+str(stop),format='SAC')
`

Thomas Lecocq
@ThomasLecocq
you have to read the file first into a Stream object
geophysics91
@geophysics91
I want to export a seismogram in ascii file.Thus i used 'TSPAIR' that saves time series in time and amplitude column. If i want time column to be represent in round(seconds) only(donot need that much long 2018-01-01T00:25:57.045000),how should i do.
Thomas Lecocq
@ThomasLecocq
list(tr.times()) give you the timing of the samples in seconds
geophysics91
@geophysics91
@ThomasLecocq then how to set list(tr.times()) in tr.write('test_data.ascii,format='TSPAIR') so that i will get timing of the samples and amplitude in test_data.ascii....can u please suggest
Thomas Lecocq
@ThomasLecocq
you'll have to do it manually
geophysics91
@geophysics91
@ThomasLecocq can you please suggest how to do it..
sion kumar
@sionkumar_gitlab
Hii friends...i am trying to do slicing of a continuous data of 1 hour length. where slicing length is 20 seconds. That means i need 180 nos of sliced length to produce and wanna save it . Are there any readymade script to do it in obspy.
Thomas Lecocq
@ThomasLecocq
@geophysics91 please try yourself. You have to create a 2 lists, one with data, one with time and save to file.
@sionkumar_gitlab the documentation of the slice method should be quite helpful in that case
geophysics91
@geophysics91
Thanks @ThomasLecocq. you are great!!!
sion kumar
@sionkumar_gitlab

@ThomasLecocq I wrote a small code after following the manual of obspy for slicing.But my code only slice first 20 seconds of the given trace, but i need to slice whole 1 hr length continuous trace by shifting 20 seconds....can you please suggest whats wrong with my code ....my code is here `
from obspy import read

for wav in list:
st = read(wav)
tr=st.copy()
tr1=tr[0]
start = tr1.stats.starttime
stop = tr1.stats.starttime+20
tr2 = tr1.slice(start,stop)
print(tr2)
tr2.write('sample_data.SAC',format='SAC')`

Thomas Lecocq
@ThomasLecocq

this is not an obspy problem, it's a logic one...

start = whatever_value
stop = start + 3600

will give you an hour of data (if there is enough data in the stream)

sion kumar
@sionkumar_gitlab
@ThomasLecocq 1 hour data i already have ...need to slice that 1 hr data by shifting 20 sec...then 20 sec etc
Thomas Lecocq
@ThomasLecocq
check the documentation for Stream.slide()