source: trunk/include/sachead.h @ 5054

Revision 1625, 7.1 KB checked in by lombard, 14 years ago (diff)

Modified to support SCNL (includes SEED location code)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1
2/*
3 *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE
4 *   CHECKED IT OUT USING THE COMMAND CHECKOUT.
5 *
6 *    $Id$
7 *
8 *    Revision history:
9 *     $Log$
10 *     Revision 1.11  2004/07/16 20:30:33  lombard
11 *     Modified to support SCNL (includes SEED location code)
12 *
13 *     Revision 1.10  2002/02/19 18:23:40  lucky
14 *     Added blessed valus for IDEP variable
15 *
16 *     Revision 1.9  2001/11/26 22:27:50  lucky
17 *     Added SAC_IO #define to match what localmag/gmew are using
18 *
19 *     Revision 1.8  2001/04/12 03:03:08  lombard
20 *     reorgainized to put the format-specific header items in *head.h
21 *     and the putaway-specific items in *putaway.h, of which there
22 *     currently is only sacputaway.h
23 *     Function protoypes used by putaway.c moved to pa_subs.h
24 *
25 *     Revision 1.7  2000/12/04 20:11:23  lucky
26 *     Added cOnset to SAC_ArrivalStruct
27 *
28 *     Revision 1.6  2000/11/15 17:03:13  lucky
29 *     Added SACPABase_next_ev_review
30 *
31 *     Revision 1.5  2000/08/28 15:39:19  lucky
32 *     *** empty log message ***
33 *
34 *     Revision 1.4  2000/07/24 18:24:22  lucky
35 *     Removed MAX_PHS_PER_EQ -- it is set globally in earthworm.h
36 *
37 *     Revision 1.3  2000/04/26 20:34:09  lucky
38 *     Added comments to known fields in sac header
39 *
40 *     Revision 1.2  2000/03/09 21:58:09  davidk
41 *     removed some unneccessary #defines.
42 *      Added a lot of new #define constants, typedefs, and functions prototypes
43 *     for the SACPA_XXX routines and the SACPABase_XXX routines.
44 *
45 *     Revision 1.1  2000/02/14 20:05:54  lucky
46 *     Initial revision
47 *
48 *
49 */
50
51#ifndef SACHEAD_H
52#define SACHEAD_H
53
54/*
55 *      SAC Header Include File
56 *      This file contains structures and definitions for SAC file headers.
57 *      If you are looking for SAC putaway routines, look in sacputaway.h
58 *
59 *      This include file should be used when ever the SAC header
60 *      is accessed.
61 */
62
63/************************************/
64/** #define CONSTANTS              **/
65/************************************/
66
67#define SACHEADERSIZE   632     /* # of bytes in SAC header */
68
69#define SACVERSION      6       /* version number of SAC */
70#define SAC_I_D         2.0     /* SAC I.D. number */
71
72#define SACWORD         float   /* SAC data is an array of floats */
73#define SACUNDEF        -12345  /* undefined value */
74#define SACSTRUNDEF     "-12345  "      /* undefined value for strings */
75
76#define SACTEMP4        11
77
78#define SACTEMP6        3
79#define SACTEMP7        10
80
81#define KEVNMLEN        16      /* length of event name */
82#define K_LEN           8       /* length of all other string fields */
83
84/* header value  constants */
85#define SAC_IUNKN       5l
86#define SAC_IDISP       6l
87#define SAC_IVEL        7l
88#define SAC_IACC        8l
89#define SAC_IVOLTS      50l
90#define SAC_IBEGINTIME  9l
91#define SAC_ITIME       1l
92#define SAC_IO         11l
93
94
95#define NUM_FLOAT       70      /* number of floats in header */
96#define MAXINT          40      /* number of ints in header */
97#define MAXSTRING       24      /* number of strings in header */
98
99/************************************/
100/** TYPE DECLARATIONS              **/
101/************************************/
102
103/*      This is the actual data structure which is used to enter the header
104        variables. */
105
106struct SAChead {
107  /* floating point fields */
108  float delta;    /* nominal increment between evenly spaced data (sec) */
109  float depmin;   /* min value of trace data (dep var) */
110  float depmax;   /* max value of trace data (dep var) */
111  float scale;    /* scale factor - NOT USED */
112  float odelta;   /* Observed delta if different from delta */
113  float b;        /* beginning value of time (indep var)  */
114  float e;        /* ending value of time (indep var) */
115  float o;        /* event origin time, relative to reference time */
116  float a;        /* first arrival time, relative to reference time */
117  float internal1;
118  float t0;       /* user-defined times */
119  float t1;
120  float t2;
121  float t3;
122  float t4;
123  float t5;
124  float t6;
125  float t7;
126  float t8;
127  float t9;
128  float f;        /* End of event time, relative to reference time */
129  float resp0;
130  float resp1;
131  float resp2;
132  float resp3;
133  float resp4;
134  float resp5;
135  float resp6;
136  float resp7;
137  float resp8;
138  float resp9;
139  float stla;     /* station latitude (deg north) */
140  float stlo;     /* station longitude (deg east) */
141  float stel;     /* station elevation (meters) */
142  float stdp;
143  float evla;     /* event location, latitude (deg north) */
144  float evlo;     /* event location, longitude (deg east) */
145  float evel;
146  float evdp;     /* event depth (km) */
147  float blank1;
148  float user0;    /* user defined values */
149  float user1;   
150  float user2;   
151  float user3;   
152  float user4;
153  float user5;   
154  float user6;
155  float user7;
156  float user8;
157  float user9;
158  float dist;     /* event-station epicentral distance (km) */
159  float az;       /* event to station azimuth (deg) */
160  float baz;      /* event to station back-azimuth (deg) */
161  float gcarc;    /* event to station arc distance (deg) */
162  float internal2;
163  float internal3;
164  float depmen;
165  float cmpaz;    /* component azimuth (deg) */
166  float cmpinc;   /* component inclination (deg) */
167  float blank4[SACTEMP4];
168
169  /* integer fields */
170  long nzyear;    /* Reference time = Trace beginning time (year) */
171  long nzjday;    /*  (julian day) */
172  long nzhour;    /*  (hour) */
173  long nzmin;     /*  (minute) */
174  long nzsec;     /*  (second) */
175  long nzmsec;    /*  (millisecond) */
176  long internal4;
177  long internal5;
178  long internal6;
179  long npts;       /* number of points in trace */
180  long internal7;
181  long internal8;
182  long blank6[SACTEMP6];
183  long iftype;      /* Type of data:  1 for time series */
184  long idep;        /* Type of dependent data =UNKNOWN */
185  long iztype;      /* zero time equivalence  =1 for beginning */
186  long iblank6a;
187  long iinst;
188  long istreg;
189  long ievreg;
190  long ievtyp;      /* event type; IUNKN */
191  long iqual;
192  long isynth;
193  long blank7[SACTEMP7];
194  unsigned long leven;    /* =1 for evenly spaced data */
195  unsigned long lpspol;   /* =1 for correct polarity, 0 for reversed */
196  unsigned long lovrok;
197  unsigned long lcalda;
198  unsigned long lblank1;
199
200  /* character string fields */
201  char kstnm[K_LEN];      /* station name (blank padded) */
202  char kevnm[KEVNMLEN];   /* event name */
203  char khole[K_LEN];      /* for SEED location code, per Peter Goldstein */
204  char ko[K_LEN];         /* Origin time label */
205  char ka[K_LEN];         /* First arrival time label */
206  char kt0[K_LEN];        /* labels for user-defined times */
207  char kt1[K_LEN];
208  char kt2[K_LEN];
209  char kt3[K_LEN];
210  char kt4[K_LEN];
211  char kt5[K_LEN];
212  char kt6[K_LEN];
213  char kt7[K_LEN];
214  char kt8[K_LEN];
215  char kt9[K_LEN];
216  char kf[K_LEN];
217  char kuser0[K_LEN];     /* labels for user-defined quantities */
218  char kuser1[K_LEN];
219  char kuser2[K_LEN];
220  char kcmpnm[K_LEN];
221  char knetwk[K_LEN];
222  char kdatrd[K_LEN];
223  char kinst[K_LEN];
224};
225
226/* This is a structure of the same size as 'SAChead', but in a form
227   that is easier to initialize. */
228
229
230struct SAChead2 {
231  float SACfloat[NUM_FLOAT];
232  long SACint[MAXINT];
233  char SACstring[MAXSTRING][K_LEN];
234};
235
236/* eof sachead.h */
237
238#endif
Note: See TracBrowser for help on using the repository browser.