#include "brttpkt.h" int pktchannel2wfdisc (PktChannel *pktchan, char *wfname_pattern, int convert, double maximum_flagged_gap_duration, Dbptr dbout)
Names of the waveform files can be specified with wfname_pattern, as is described in trwfname(3). The convert argument causes conversions of the sample values between various formats. All conversions are done in place (i.e. the input pktchan->data array) and take into account flagged gap values. The convert values are as follows:
- CONVERT_WF_NONE
No conversion.- CONVERT_WF_IH
Convert to integers in local machine byte order.- CONVERT_WF_FH
Convert to floats in local machine byte order.- CONVERT_WF_S4
Convert to integers in motorola byte order.- CONVERT_WF_I4
Convert to integers in x86 byte order.- CONVERT_WF_T4
Convert to floats in motorola byte order.- CONVERT_WF_F4
Convert to floats in x86 byte order.
Internally flagged data gaps can be removed using the maximum_flagged_gap_duration argument. The data array is scanned until a gap time duration exceeds this argument which causes new wfdisc rows to be made so that the flagged gaps are removed from the data. If maximum_flagged_gap_duration is set less than zero, then all of the flagged gap values are left in the data array and only a single wfdisc row will be made. If maximum_flagged_gap_duration is set to 0, then all of the flagged gap values are removed from the data arrays and multiple wfdisc rows will be made to accomodate the data gaps.
The output database is referenced by the dbout database pointer.