Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:02
    qitiandashengsunwukong starred obspy/obspy
  • 10:50
    zacherle synchronize #2736
  • Nov 28 18:50
  • Nov 28 10:38
    ThomasLecocq commented #2758
  • Nov 28 06:41
    kamacpherson commented #2740
  • Nov 28 03:42
    msaezuchile opened #2760
  • Nov 28 01:00
    d-chambers commented #2743
  • Nov 27 16:23
    megies commented #2740
  • Nov 27 16:15
    heavelock commented #2722
  • Nov 27 16:14
    heavelock synchronize #2722
  • Nov 27 15:56
    megies edited #2759
  • Nov 27 15:56
    megies edited #2759
  • Nov 27 15:55
    megies synchronize #2759
  • Nov 27 15:55

    megies on read_inventory_level

    changelog add test for "level" in reading… (compare)

  • Nov 27 15:52
    megies commented #2757
  • Nov 27 15:45
    megies labeled #2757
  • Nov 27 14:39
    megies labeled #2756
  • Nov 27 14:39
    megies commented #2756
  • Nov 27 14:20
    megies edited #2759
  • Nov 27 14:20
    megies edited #2759
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?
DJMO3
@DJMO3
I have to capture the waveform data from all stations in a specific network for signal processing. I figured that I will need the mass_downloader module to do so. I have not understood how the CircularDomain or other Domain method work
Does it return all the stations in the domain or does it return the events that occurred during the specified time?
Thomas Lecocq
@ThomasLecocq
generic question related to "best practice": how far away from each other could you have two sensors sharing net+sta , but not loc ids ? I imagine on a field with up to 100m apart, logged on a single unit? or borehole strings with different sensors at different depths ?
Lula
@LulaLopezM_twitter
Hello! I need help, I try to run isola but I have got this problem:
runfile('/Users/lucianalopez/Sismologia/ISOLA/1_Efpalio_SAC_orig/src/class_isola.py', wdir='/Users/lucianalopez/Sismologia/ISOLA/1_Efpalio_SAC_orig/src')
File "/Users/lucianalopez/Sismologia/ISOLA/1_Efpalio_SAC_orig/src/class_isola.py", line 64
return dict(map(lambda (key, value): (prefix+str(key)+suffix, value), somedict.items()))
^
SyntaxError: invalid syntax
Elliott Sales de Andrade
@QuLogic
what does this have to do with ObsPy?
Your code is invalid Python