Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:57
  • Jan 22 17:46
    leitmori starred obspy/obspy
  • Jan 21 17:13
    crotwell opened #2779
  • Jan 21 16:53
  • Jan 20 10:09
    claudiodsf labeled #2778
  • Jan 20 10:09
    claudiodsf opened #2778
  • Jan 19 00:27
    nukenine edited #2777
  • Jan 19 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
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()
sion kumar
@sionkumar_gitlab
@ThomasLecocq simply i just need to cut the trace first 20 seconds then 20 seconds ....so on up to completing the 1hr continuous file(180 no of 20 secs traces should produce)
sion kumar
@sionkumar_gitlab
@ThomasLecocq solved my pblm by adopting Stream.slide()...Thanks
Tom Eulenfeld
@trichter
Hi devs, could anybody have a look at the following PR: obspy/obspy#2708. I think it could fix the failing tests on the master branch.
Tobias Megies
@megies
done
Kay089
@Kay089
Hi! I'm trying to create a dayplot from a miniseed. In doing so, I get the following value error, "Too few samples to use dayplot with the given arguments. Adjust your arguments or use a different plotting method." Does anyone know the minimum number of samples required for dayplot? Thanks in advance!
Tobias Megies
@megies
how many samples you have in your data? try to read the file and print the stream and check samples :)
Thomas Lecocq
@ThomasLecocq
looks like it was close to 0 samples :)
Kay089
@Kay089
Thanks for the reply:) It was close to 2000 samples, 1 sample per minute.
Calum Chamberlain
@calum-chamberlain

@Kay089 it looks like this error is raised by this line which suggests that you should reduce the width of your dayplot to get around this.

1 sample-per minite is quite a low sampling-rate, so I doubt this plotting routine is designed with this in mind, hence the slightly opaque error message. Try passing the argument st.plot(..., size=(200, 600)) - in the size argument, width is the first part of the tuple. The default is 600, so reduce this until you get a plot!

Kay089
@Kay089
@calum-chamberlain It works! Thank you so much!!
Calum Chamberlain
@calum-chamberlain
No worries - always a good idea to check out the source code if you run into unexpected errors!
Tobias Megies
@megies
uky-jps
@uky-jps
Hi all. I was wondering if anyone knew of a way to make a plot of 3 ppsd subplots, one for each component of a seismometer in a single "summary" type plot for the station. I know you can mute the output of the ppsd.plot(show=False) to then manipulate the active ppsd.plot. Any guidance on this would be extremely helpful!
3 replies
Glenn Nelson
@dr-glenn
I have very large mseed files (12 GB) and am using buffered read as suggested in issue #1419. That works well, but I was surprised to find that if I decreased chunksize from 100K to 10K, I actually had MORE traces returned in each buffer. I expected fewer. I don't know how miniSeed files are organized. I suspect a guru can easily explain this strange observation to me.
DJMO3
@DJMO3
I'm very very new to obspy and can't seem to get the data I need correctly. Anybody willing to help out?
Tobias Megies
@megies
@dr-glenn hmm.. in general this should not influence what you get out of the read operations, although miniseed reading is merging together chunks with sub-sampling rate gaps and if you read smaller parts at once you might not get them merged together automatically if your chunk is right at such a subsample gap
@DJMO3 uhm.. need more details?