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

# sachead.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: sachead_8h-source.html,v 1.1 2006/05/19 16:55:02 paulf Exp $
    00007  *
    00008  *    Revision history:
    00009  *     $Log: sachead_8h-source.html,v $
    00009  *     Revision 1.1  2006/05/19 16:55:02  paulf
    00009  *     first inclusion
    00009  *
    00010  *     Revision 1.10  2002/02/19 18:23:40  lucky
    00011  *     Added blessed valus for IDEP variable
    00012  *
    00013  *     Revision 1.9  2001/11/26 22:27:50  lucky
    00014  *     Added SAC_IO #define to match what localmag/gmew are using
    00015  *
    00016  *     Revision 1.8  2001/04/12 03:03:08  lombard
    00017  *     reorgainized to put the format-specific header items in *head.h
    00018  *     and the putaway-specific items in *putaway.h, of which there
    00019  *     currently is only sacputaway.h
    00020  *     Function protoypes used by putaway.c moved to pa_subs.h
    00021  *
    00022  *     Revision 1.7  2000/12/04 20:11:23  lucky
    00023  *     Added cOnset to SAC_ArrivalStruct
    00024  *
    00025  *     Revision 1.6  2000/11/15 17:03:13  lucky
    00026  *     Added SACPABase_next_ev_review
    00027  *
    00028  *     Revision 1.5  2000/08/28 15:39:19  lucky
    00029  *     *** empty log message ***
    00030  *
    00031  *     Revision 1.4  2000/07/24 18:24:22  lucky
    00032  *     Removed MAX_PHS_PER_EQ -- it is set globally in earthworm.h
    00033  *
    00034  *     Revision 1.3  2000/04/26 20:34:09  lucky
    00035  *     Added comments to known fields in sac header
    00036  *
    00037  *     Revision 1.2  2000/03/09 21:58:09  davidk
    00038  *     removed some unneccessary #defines.
    00039  *      Added a lot of new #define constants, typedefs, and functions prototypes
    00040  *     for the SACPA_XXX routines and the SACPABase_XXX routines.
    00041  *
    00042  *     Revision 1.1  2000/02/14 20:05:54  lucky
    00043  *     Initial revision
    00044  *
    00045  *
    00046  */
    00047
    00048 #ifndef SACHEAD_H
    00049 #define SACHEAD_H
    00050
    00051 /*
    00052  *      SAC Header Include File
    00053  *      This file contains structures and definitions for SAC file headers.
    00054  *      If you are looking for SAC putaway routines, look in sacputaway.h
    00055  *
    00056  *      This include file should be used when ever the SAC header
    00057  *      is accessed.
    00058  */
    00059
    00060 /************************************/
    00062 /************************************/
    00063
    00064 #define SACHEADERSIZE   632     /* # of bytes in SAC header */
    00065
    00066 #define SACVERSION      6       /* version number of SAC */
    00067 #define SAC_I_D         2.0     /* SAC I.D. number */
    00068
    00069 #define SACWORD         float   /* SAC data is an array of floats */
    00070 #define SACUNDEF        -12345  /* undefined value */
    00071 #define SACSTRUNDEF     "-12345  "      /* undefined value for strings */
    00072
    00073 #define SACTEMP4        11
    00074
    00075 #define SACTEMP6        3
    00076 #define SACTEMP7        10
    00077
    00078 #define KEVNMLEN        16      /* length of event name */
    00079 #define K_LEN           8       /* length of all other string fields */
    00080
    00081 /* header value  constants */
    00082 #define SAC_IUNKN       5l
    00083 #define SAC_IDISP       6l
    00084 #define SAC_IVEL        7l
    00085 #define SAC_IACC        8l
    00086 #define SAC_IVOLTS      50l
    00087 #define SAC_IBEGINTIME  9l
    00088 #define SAC_ITIME       1l
    00089 #define SAC_IO         11l
    00090
    00091
    00092 #define NUM_FLOAT       70      /* number of floats in header */
    00093 #define MAXINT          40      /* number of ints in header */
    00094 #define MAXSTRING       24      /* number of strings in header */
    00095
    00096 /************************************/
    00098 /************************************/
    00099
    00100 /*      This is the actual data structure which is used to enter the header
    00101         variables. */
    00102
    00103 struct SAChead {
    00104   /* floating point fields */
    00105   float delta;    /* nominal increment between evenly spaced data (sec) */
    00106   float depmin;   /* min value of trace data (dep var) */
    00107   float depmax;   /* max value of trace data (dep var) */
    00108   float scale;    /* scale factor - NOT USED */
    00109   float odelta;   /* Observed delta if different from delta */
    00110   float b;        /* beginning value of time (indep var)  */
    00111   float e;        /* ending value of time (indep var) */
    00112   float o;        /* event origin time, relative to reference time */
    00113   float a;        /* first arrival time, relative to reference time */
    00114   float internal1;
    00115   float t0;       /* user-defined times */
    00116   float t1;
    00117   float t2;
    00118   float t3;
    00119   float t4;
    00120   float t5;
    00121   float t6;
    00122   float t7;
    00123   float t8;
    00124   float t9;
    00125   float f;        /* End of event time, relative to reference time */
    00126   float resp0;
    00127   float resp1;
    00128   float resp2;
    00129   float resp3;
    00130   float resp4;
    00131   float resp5;
    00132   float resp6;
    00133   float resp7;
    00134   float resp8;
    00135   float resp9;
    00136   float stla;     /* station latitude (deg north) */
    00137   float stlo;     /* station longitude (deg east) */
    00138   float stel;     /* station elevation (meters) */
    00139   float stdp;
    00140   float evla;     /* event location, latitude (deg north) */
    00141   float evlo;     /* event location, longitude (deg east) */
    00142   float evel;
    00143   float evdp;     /* event depth (km) */
    00144   float blank1;
    00145   float user0;    /* user defined values */
    00146   float user1;
    00147   float user2;
    00148   float user3;
    00149   float user4;
    00150   float user5;
    00151   float user6;
    00152   float user7;
    00153   float user8;
    00154   float user9;
    00155   float dist;     /* event-station epicentral distance (km) */
    00156   float az;       /* event to station azimuth (deg) */
    00157   float baz;      /* event to station back-azimuth (deg) */
    00158   float gcarc;    /* event to station arc distance (deg) */
    00159   float internal2;
    00160   float internal3;
    00161   float depmen;
    00162   float cmpaz;    /* component azimuth (deg) */
    00163   float cmpinc;   /* component inclination (deg) */
    00164   float blank4[SACTEMP4];
    00165
    00166   /* integer fields */
    00167   long nzyear;    /* Reference time = Trace beginning time (year) */
    00168   long nzjday;    /*  (julian day) */
    00169   long nzhour;    /*  (hour) */
    00170   long nzmin;     /*  (minute) */
    00171   long nzsec;     /*  (second) */
    00172   long nzmsec;    /*  (millisecond) */
    00173   long internal4;
    00174   long internal5;
    00175   long internal6;
    00176   long npts;       /* number of points in trace */
    00177   long internal7;
    00178   long internal8;
    00179   long blank6[SACTEMP6];
    00180   long iftype;      /* Type of data:  1 for time series */
    00181   long idep;        /* Type of dependent data =UNKNOWN */
    00182   long iztype;      /* zero time equivalence  =1 for beginning */
    00183   long iblank6a;
    00184   long iinst;
    00185   long istreg;
    00186   long ievreg;
    00187   long ievtyp;      /* event type; IUNKN */
    00188   long iqual;
    00189   long isynth;
    00190   long blank7[SACTEMP7];
    00191   unsigned long leven;    /* =1 for evenly spaced data */
    00192   unsigned long lpspol;   /* =1 for correct polarity, 0 for reversed */
    00193   unsigned long lovrok;
    00194   unsigned long lcalda;
    00195   unsigned long lblank1;
    00196
    00197   /* character string fields */
    00198   char kstnm[K_LEN];      /* station name (blank padded) */
    00199   char kevnm[KEVNMLEN];   /* event name */
    00200   char khole[K_LEN];
    00201   char ko[K_LEN];         /* Origin time label */
    00202   char ka[K_LEN];         /* First arrival time label */
    00203   char kt0[K_LEN];        /* labels for user-defined times */
    00204   char kt1[K_LEN];
    00205   char kt2[K_LEN];
    00206   char kt3[K_LEN];
    00207   char kt4[K_LEN];
    00208   char kt5[K_LEN];
    00209   char kt6[K_LEN];
    00210   char kt7[K_LEN];
    00211   char kt8[K_LEN];
    00212   char kt9[K_LEN];
    00213   char kf[K_LEN];
    00214   char kuser0[K_LEN];     /* labels for user-defined quantities */
    00215   char kuser1[K_LEN];
    00216   char kuser2[K_LEN];
    00217   char kcmpnm[K_LEN];
    00218   char knetwk[K_LEN];
    00219   char kdatrd[K_LEN];
    00220   char kinst[K_LEN];
    00221 };
    00222
    00223 /* This is a structure of the same size as 'SAChead', but in a form
    00224    that is easier to initialize. */
    00225
    00226
    00227 struct SAChead2 {
    00228   float SACfloat[NUM_FLOAT];
    00229   long SACint[MAXINT];
    00230   char SACstring[MAXSTRING][K_LEN];
    00231 };
    00232
    00233 /* eof sachead.h */
    00234
    00235 #endif