I am pretty new here and just discover the obspy project. I did succeed in installation and read, filter some files.
I would like to know if there a way to split a mseed (or segy) file of 24 hours in minutes (so 1440 files). The file is at 100 Hz so i could also split the file in sample (each 6000 sample for instance).
I did try the cutout fonction but it seems to use only UTCTime so not a length or number of samples.
If someone can give me a tip, I will be very greatful.
from obspy import read
tr= read(“C:\Data*.mseed”)[0]
print(tr)
st = tr / 1440
print (st)
for tr in st:
tr.write(tr.id + “C:\Data\out.mseed”)
It seems to cut the stream in 1440 traces, what I want to do, but now I would like to save each trace as a separate file and my last command seems not good.
Thanks for your answers. You give me the right tip, it was not working because I am on windows and file with dot is not good but I manage to do it like this :
from obspy import read
tr= read(“C:\Data*.mseed”)[0]
print(tr)
st = tr / 1440
print (st)
for tr in st:
filename = tr.stats.starttime.strftime(‘%Y%m%d_%H.%M’)
tr.write(filename)
Thank you for your help.
Now I am trying to convert mseed in segy file, I will may open an other question.