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

# seihead.h

Go to the documentation of this file.

    00001 /* seihead.h - include file for SEIsan putaway routines */
    00002
    00003 #ifndef SEIHEAD_H
    00004 #define SEIHEAD_H
    00005
    00006
    00007 #include "earthworm_defs.h"
    00008 #include "trace_buf.h"
    00009
    00010 /* standard TRUE/FALSE definitions */
    00011 #ifndef TRUE
    00012 #define TRUE            1
    00013 #endif
    00014 #ifndef FALSE
    00015 #define FALSE           0
    00016 #endif
    00017
    00018 /* define the operating system specific directory delimiter */
    00019 #if defined (_WINNT)
    00020 #define DIR_DELIM       '\\'
    00021 #elif defined  (_SOLARIS)
    00022 #define DIR_DELIM       '/'
    00023 #else
    00024 #error "_WINNT or _SOLARIS must be set before compiling"
    00025 #endif
    00026
    00027 /* the value used to represent missing data in Seisan */
    00028 #define SEISAN_MISSING_DATA_FLAG                0
    00029
    00030 /* a structure used to define a seisan channel */
    00031 struct Sei_channel_details
    00032 {
    00033   char chan_name [50];          /* channel name */
    00034   char chan_type [50];          /* channel type code */
    00035   double start_time;            /* start time of the data on this channel */
    00036   long n_samples;               /* number of data samples */
    00037   long n_written;               /* number of samples written to the file */
    00038   double sample_rate;           /* the sample rate in Hz */
    00039
    00040   int channel_count;            /* unique index for this channel */
    00041   char filename [MAX_DIR_LEN];  /* name of the file holding data for this channel */
    00042 };
    00043
    00044 /* return codes for what was found by pa_find_data() */
    00045 #define FD_FOUND_REQUESTED      1               /* the requested data sample was found */
    00046 #define FD_FOUND_GAP            2               /* the sample was not found */
    00047 #define FD_NO_MORE_DATA         3               /* there is no more data in the request structure */
    00048 #define FD_BAD_DATATYPE         4               /* found an unreconisable data type code */
    00049 #define FD_CHANGED_SRATE        5               /* sample rate changes between snippets */
    00050
    00051 /* codes for data types in pa_find_data() */
    00052 #define FD_SHORT_INT            1
    00053 #define FD_LONG_INT                     2
    00054 #define FD_FLOAT                        3
    00055 #define FD_DOUBLE                       4
    00056
    00057 /* this structure holds information and pointers to data found by find_data() */
    00058 struct Found_data
    00059 {
    00060   long n_samples;                       /* number of samples found OR size of gap */
    00061   double sample_rate;           /* sample rate in Hz */
    00062   void *data;                           /* pointer to the data */
    00063   int data_type_code;           /* one of the codes above */
    00064   TRACE_HEADER *trace_hdr;      /* pointer to the trace header */
    00065 };
    00066
    00067
    00068 /* forward declarations for seiutils.c: */
    00069 int open_seisan_file (char *output_dir, char *network_name, double st,
    00070                       double dur, int onn);
    00071 int add_seisan_channel (char *chan_name, char *chan_type);
    00072 int start_seisan_channel (char *chan_name, char *chan_type,
    00073                           double start_time, double sample_rate,
    00074                           long n_samples);
    00075 void add_seisan_channel_data (long data_len, long *data);
    00076 int end_seisan_channel (void);
    00077 int close_seisan_file (void);
    00078
    00079 int pa_find_data (TRACE_REQ *trace_req, double sample_time,
    00080                                   struct Found_data *data);
    00081
    00082 /* forward declarations for seiputaway.c: */
    00083 int SEIPA_init (char *output_dir, char *output_format, int debug);
    00084 int SEIPA_next_ev (TRACE_REQ *trace_req, int n_reqs, char *output_dir,
    00085                    char *e_date, char *e_time, char *subnetName, int debug);
    00086 int SEIPA_next (TRACE_REQ *trace_req, double gap_thresh, int debug);
    00087 int SEIPA_end_ev (int debug);
    00088 int SEIPA_close (int debug);
    00089
    00090 #endif  /* SEIHEAD_H */
    00091