Hi,
I am now using FDSN web service from Obspy to download data from IRIS. Then I write all the traces to SAC files based on the trace id. See code below. However, when I check the header of the SAC files I got, it seems that the “CMPAZ” and “CMPINC” values for all traces are set to 0. Do you have any idea about how to get the right header information? Thanks.
from obspy.fdsn import Client
from obspy import UTCDateTime
client = Client()
t = UTCDateTime("2011-09-10T06:45:00.000")
st = client.get_waveform("XY", "PTTY", "*", "*", t, t + 60)
print st
for tr in st:
tmp = tr.id.split('.')
network = tmp[0]
sta = tmp[1]
channel = tmp[2]
comp = tmp[3]
fname = '.'.join([sta, comp, network, '--'])
tr.write(fname, format='SAC')
>>
3 Trace(s) in Stream:
XY.PTTY..EL1 | 2011-09-10T06:45:00.000000Z - 2011-09-10T06:46:00.000000Z | 200.0 Hz, 12001 samples
XY.PTTY..EL2 | 2011-09-10T06:45:00.000000Z - 2011-09-10T06:46:00.000000Z | 200.0 Hz, 12001 samples
XY.PTTY..ELZ | 2011-09-10T06:45:00.000000Z - 2011-09-10T06:46:00.000000Z | 200.0 Hz, 12001 samples
Best,
Qimin