• Antelope Release 5.10 Linux CentOS release 7.6.1810 (Core) 3.10.0 2020-05-12

 

NAME

pktchannel2wfdisc - put packets into a database

SYNOPSIS

#include "brttpkt.h"

int
pktchannel2wfdisc (PktChannel *pktchan, char *wfname_pattern,
                   int convert, double maximum_flagged_gap_duration,
                   Dbptr dbout)

DESCRIPTION

pktchannel2wfdisc will take as input a single PktChannel structure in pktchan and write it out as one or more rows in the Datascope wfdisc table along with the associated waveform files. This subroutines DOES NOT do any buffering, nor does it check for overlaps with existing waveforms, nor does it attempt to accumulate waveforms onto existing wfdisc rows. Every call to this subroutine will always produce at least one wfdisc row and maybe more depending on the maximum_flagged_gap_duration argument.

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.

RETURN VALUES

pktchannel2wfdisc returns 0 if OK or -1 if there is an error. If there is an error, then messages are left on the error register.

LIBRARY

-lbrttpkt $(ORBLIBS)

AUTHOR

Danny Harvey
Printer icon