[obspy-users] Read waveform data

Christian Joseph M Clarito christian.clarito at phivolcs.dost.gov.ph
Mon Oct 10 10:49:20 CEST 2016


Hello All, 

I'm CJ from PHIVOLCS (Philippine Institute of Volcanology and Seismology). I've learned Python and Obspy through the series of IRIS Webinars. Our Volcano Monitoring Group is now starting to use Obspy because of its great features, most especially the flexibility of reading different seismic file formats. 

I have a simple question about reading waveform data. The code below runs successfully (cut and converts volcanic earthquake event into SAC): 


from obspy import read 
from obspy import UTCDateTime 

t1 = UTCDateTime("2015-12-22T03:37:30") 
t2 = t1 + 300 

wav_f = read("*2015.356*", starttime=t1, endtime=t2) ####reads mseed, three components of 7 stations 
wav_f.plot() 
for waves in wav_f: 
waves.write(waves.id + "_" + str(t1.date) + "T" + str(t1.time) + ".sac", format="sac") 


And now I'm processing ~5000 events (cut and converts volcanic earthquake event into SAC). When I tried to declare the corresponding Julian date as a variable, it could not read when passed as wildcard. In the end, my ultimate goal in mind is to 
process the events in one swoop by reading a text file which only contains the starttime of the events: 

from obspy import read 
from obspy import UTCDateTime 

t1 = UTCDateTime("2015-12-22T03:37:30") 
t2 = t1 + 300 
jul = t1.julday 

wav_f = read("*.jul*", starttime=t1, endtime=t2) 
wav_f.plot() 
for waves in wav_f: 
waves.write(waves.id + "_" + str(t1.date) + "T" + str(t1.time) + ".sac", format="sac") 

The error says: raise Exception("No file matching file pattern: %s" % pathname) 
Exception: No file matching file pattern: *.jul* 


Cheers, 

CJ 


-- 
"Sa taong may hiya, salita'y panunumpa" 
-Emilio Jacinto (Mga Aral ng Katipunan sa Kartilya) 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.swapbytes.de/pipermail/obspy-users/attachments/20161010/84cc3f74/attachment.html>


More information about the obspy-users mailing list