Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

trace_buf.h

Go to the documentation of this file.
00001 
00002 /*
00003  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE
00004  *   CHECKED IT OUT USING THE COMMAND CHECKOUT.
00005  *
00006  *    $Id: trace__buf_8h-source.html 2161 2006-05-19 16:55:03Z paulf $
00007  *
00008  *    Revision history:
00009  *     $Log$
00009  *     Revision 1.1  2006/05/19 16:55:02  paulf
00009  *     first inclusion
00009  *
00010  *     Revision 1.3  2002/03/20 20:14:52  lombard
00011  *     size of net string was specified as TRACE_CHAN_LEN and channel string
00012  *     as TRACE_NET_LEN. While these macros currently have the same value,
00013  *     they may not in the future. The string sizes have been corrected.
00014  *
00015  *     Revision 1.2  2001/03/15 01:22:44  dietz
00016  *     added TRACE_LOC_LEN definition
00017  *
00018  *     Revision 1.1  2000/02/14 20:05:54  lucky
00019  *     Initial revision
00020  *
00021  *
00022  */
00023 
00024 /*
00025  * Trace_buf.h
00026  *
00027  * Header file for Earthworm packets that allow demultiplexed data
00028  *  from various sources to be handled efficiently. Added to
00029  *  Earthworm system by
00030  * Kent Lindquist and Roger Hansen
00031  * Geophysical Institute
00032  * University of Alaska, Fairbanks
00033  *
00034  * February, 1996
00035  *
00036  * November 1996: KGL Added net and quality fields to accommodate
00037  *  needs expressed by Alex Bittenbinder and the Earthworm team
00038  * February 1997: KGL Added pad field as used by Earthworm team
00039  *
00040  * Replaced hardcoded string lengths for S-C-N with 
00041  * #defines so that they can be used elsewhere. LV 5/1999
00042  *
00043  *
00044  */
00045 
00046 #ifndef TRACE_BUF_H
00047 #define TRACE_BUF_H
00048 
00049 #define NETWORK_NULL_STRING "-"
00050 
00051 /* NOTE:
00052  * The principal time fields in the TRACE_HEADER are: 
00053  *    starttime, nsamp, and samprate.
00054  * The endtime field is included as a redundant convenience.
00055  */
00056 
00057 #define TRACE_STA_LEN   7
00058 #define TRACE_CHAN_LEN  9
00059 #define TRACE_NET_LEN   9
00060 #define TRACE_LOC_LEN   3
00061 
00062 typedef struct {
00063         int     pinno;          /* Pin number */
00064         int     nsamp;          /* Number of samples in packet */
00065         double  starttime;      /* time of first sample in epoch seconds
00066                                    (seconds since midnight 1/1/1970) */
00067         double  endtime;        /* Time of last sample in epoch seconds */
00068         double  samprate;       /* Sample rate; nominal */
00069         char    sta[TRACE_STA_LEN];         /* Site name */
00070         char    net[TRACE_NET_LEN];         /* Network name */
00071         char    chan[TRACE_CHAN_LEN];        /* Component/channel code */
00072         char    datatype[3];    /* Data format code */
00073         char    quality[2];     /* Data-quality field */
00074         char    pad[2];         /* padding */
00075 } TRACE_HEADER;
00076 
00077 #define MAX_TRACEBUF_SIZ 4096   /* define maximum size of trace message buffer */
00078 
00079 typedef union {
00080         char    msg[MAX_TRACEBUF_SIZ];
00081         TRACE_HEADER trh;
00082         int     i;
00083 } TracePacket;
00084 
00085 /* Byte 0 of data quality flags, as in SEED format
00086    ***********************************************/
00087 #define AMPLIFIER_SATURATED    0x01
00088 #define DIGITIZER_CLIPPED      0x02
00089 #define SPIKES_DETECTED        0x04
00090 #define GLITCHES_DETECTED      0x08
00091 #define MISSING_DATA_PRESENT   0x10
00092 #define TELEMETRY_SYNCH_ERROR  0x20
00093 #define FILTER_CHARGING        0x40
00094 #define TIME_TAG_QUESTIONABLE  0x80
00095 
00096 /* CSS datatype codes
00097    ******************/
00098 /*
00099         t4      SUN IEEE single precision real
00100         t8      SUN IEEE double precision real
00101         s4      SUN IEEE integer
00102         s2      SUN IEEE short integer
00103         f4      VAX/Intel IEEE single precision real
00104         f8      VAX/Intel IEEE double precision real
00105         i4      VAX/Intel IEEE integer
00106         i2      VAX/Intel IEEE short integer
00107         g2      NORESS gain-ranged
00108 */
00109 #endif

Generated on Tue May 6 09:16:11 2003 for Earthworm Libs by doxygen1.3-rc3