I've got a SAC file that contains certain header values that are not reflected in the trace.stats.sac AttribDict after being read in by ObsPy. Specifically, I'm trying to get 'knetwk' or 'kstnm'. Is the trace.stats.sac dictionary only a subset of the actual SAC header?
some of the SAC header entries are used to fill the standard trace.stats entries and are not listed again in the trace.stats.sac dictionary. Here are the assignment rules:
Thanks for replying. I saw these conversions, but didn't realize the original header values were not kept. Is there also some cannibalizing of the nzyear, nzhour, etc... fields in order to make the Trace.stats.starttime entry? If so, I think there may be some information lost when these "nz..." fields are discarded (e.g. for event-based reference times). For me, the expected behavior for when I use "read" on a SAC file is that no header information is discarded. Would you be receptive if I submitted an "enhancement" ticket?
as Yannik said we parse some of the header values to gain a uniform
way to deal with different formats like MiniSeed, GSE2, Seisan ...
Therefor, we must actually convert some of the header info. However,
to my knowledge no header info is actually discarted (as I said, it
is just converted).
E.g. The nzhour, nzyear, ... forms the starttime. The event-base
reference time is stored as an offset of this time in trace.sac.b. We
have further a test-suite which assures that we actually can write the
same information as which we can read.
If you find a header entry which is not converted forward and backward
please report a bug --- this is actually valuable information. In
this bug report, please attach an example, so that we can reproduce
this issue and use this example as a basis for a new test.
Thanks for replying. I apologize if this is review for many people; I have to relearn this every time...
Is this pseudocode somewhat correct (at least for the event-based reftime)?