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
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...
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
@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')
`
slice
method should be quite helpful in that case
@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')`
@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!