00001
00002
00003 #ifndef SEIHEAD_H
00004 #define SEIHEAD_H
00005
00006
00007 #include "earthworm_defs.h"
00008 #include "trace_buf.h"
00009
00010
00011 #ifndef TRUE
00012 #define TRUE 1
00013 #endif
00014 #ifndef FALSE
00015 #define FALSE 0
00016 #endif
00017
00018
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
00028 #define SEISAN_MISSING_DATA_FLAG 0
00029
00030
00031 struct Sei_channel_details
00032 {
00033 char chan_name [50];
00034 char chan_type [50];
00035 double start_time;
00036 long n_samples;
00037 long n_written;
00038 double sample_rate;
00039
00040 int channel_count;
00041 char filename [MAX_DIR_LEN];
00042 };
00043
00044
00045 #define FD_FOUND_REQUESTED 1
00046 #define FD_FOUND_GAP 2
00047 #define FD_NO_MORE_DATA 3
00048 #define FD_BAD_DATATYPE 4
00049 #define FD_CHANGED_SRATE 5
00050
00051
00052 #define FD_SHORT_INT 1
00053 #define FD_LONG_INT 2
00054 #define FD_FLOAT 3
00055 #define FD_DOUBLE 4
00056
00057
00058 struct Found_data
00059 {
00060 long n_samples;
00061 double sample_rate;
00062 void *data;
00063 int data_type_code;
00064 TRACE_HEADER *trace_hdr;
00065 };
00066
00067
00068
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
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
00091