[obspy-users] write SAC data to file

Ahu Komec Mutlu komec at boun.edu.tr
Thu Nov 8 15:16:21 CET 2012


Hello,

I read SAC data and did some changes on that data then I want to write 
it to a file, here my code:

from obspy.core import read
from obspy.core import UTCDateTime
st = read("20111023_1041/2011*", format="SAC")
print(st.__str__(extended=True))
st.resample(50.0)
EventOriginTime = UTCDateTime("2011-10-23T10:41:19")
st.trim(EventOriginTime, EventOriginTime+360)
st.write("van.sac", format="SAC")

it works but output file names are not include station name and 
component information, they are like :

van01.sac      van04.sac
van02.sac      van05.sac

How can I write the SAC data to new file with name like
AFSR.BHE.sac
AFSR.BHN.sac
AFSR.BHZ.sac

(stationname.component.sac)

Thanks & Regards

-------------------------

AHU KOMEC MUTLU
Bogazici University Kandilli Observatory & E.R.I.
Cengelkoy / ISTANBUL

Phone: +(90) 216 516 32 16

-------------------------






More information about the obspy-users mailing list