📄 structures.h
字号:
/*===========================================================================*//* SEED reader | structures.h | header file *//*===========================================================================*//* Name: structures.h Purpose: contains structure definitions for rdseed programs Usage: #include "structures.h" Input: none Output: none Warnings: none Errors: none Called by: rdseed.h Calls to: none Algorithm: none Notes: Memory for most structures, strings, and so on is dynamically allocated at run time. Problems: none known References: Halbert et al, 1988; see main routine Language: C, hopefully ANSI standard Author: Dennis O'Neill Revisions: 07/15/88 Dennis O'Neill Initial preliminary release 0.9 11/04/88 Dennis O'Neill Added STRINGTERM definition 11/21/88 Dennis O'Neill Production release 1.0 05/01/90 Sue Schoch Production release 2.0 001 Included blockette 57 support 09/01/93 CL added modification for volume label 03/25/99 Stephane Zuzlewski Added Polynomial support*//* If this header is already included, don't include it again */#ifndef STRUCTURES_H#define STRUCTURES_H/* +=======================================+ *//*=================| Command-line option/argument structure|=================*//* +=======================================+ */#define OPTS 100#define STRLEN 100struct optstruct{ int number_options; /* # options found */ int next_arg; /* argv index to next arg */ char option[OPTS]; /* list of allowed options */ char option_present[OPTS]; /* TRUE if option present */ char argument[OPTS][STRLEN]; /* argument if present */};/* +=======================================+ *//*=================| Date-and-time structure |=================*//* +=======================================+ */struct time{ int year; int day; int hour; int minute; int second; int fracsec;};/* +=======================================+ *//*=================| Phase-Date-and-time structure |=================*//* +=======================================+ */struct phase{ char name[30]; int year; int day; int hour; int minute; int second; int fracsec;};/* +=======================================+ *//*=================| input data structures |=================*//* +=======================================+ */struct logical_record /* input logical record */{ long int recordnumber; /* input record number */ char type; /* type of record */ int continuation; /* continuation (T|F) */ char data[LRECL_DEF-8]; /* input data */};/* +=======================================+ *//*=================| volume header structures |=================*//* +=======================================+ */struct type10 /* volume identifier */{ double version; /* SEED version number */ int log2lrecl; /* log base 2 of lrecl */ char *bov; /* beginning of volume date */ char *eov; /* end of volume date */ char *volume_time; /* creation date of volume */ char *organization; /* originating organization */ char *volume_label; /* optional volume label */};struct type11sub /* used in struct type11 */{ char *station_id; /* station identifier */ long int sequence_number; /* sequence number */};struct type11 /* vol. station header index */{ int number_stations; /* number of stations */ struct type11sub *station; /* substructure */};struct type12sub /* used in struct type12 */{ char *bos; /* beginning of span */ char *eos; /* end of span */ long int sequence_number; /* sequence number */};struct type12 /* vol. timespan index */{ int number_spans; /* number of spans */ struct type12sub *timespan; /* timespan */};/* +=======================================+ *//*=================| dictionary (table) structures |=================*//* +=======================================+ */struct type30 /* data format dictionary */{ char *name; /* short descriptive name */ int code; /* data format id code */ int family; /* data decoder family type */ int number_keys; /* number of decoder keys */ char **decoder_key; /* decoder keys */ char **decoder_key_prim; /* decoder keys */ struct type30 *next; /* ptr to next type30 entry */};struct type31 /* comment description dctnry */{ int code; /* comment id code */ char *class; /* comment class code */ char *comment; /* comment text */ int units; /* units of comment */ struct type31 *next; /* ptr to next type31 entry */};struct type32 /* cited source dictionary */{ int code; /* source id code */ char *author; /* author/publication */ char *catalog; /* date, catalog info */ char *publisher; /* publisher name */ struct type32 *next; /* ptr to next type32 entry */};struct type33 /* generic abbrev dctnry */{ int code; /* abbreviation ident code */ char *abbreviation; /* abbrev. description */ struct type33 *next; /* ptr to next type33 entry */};struct type34 /* units abbreviation dctnry */{ int code; /* units ident code */ char *name; /* unit name */ char *description; /* unit description */ struct type34 *next; /* ptr to next type34 entry */};struct type35sub /* used in struct type35 */{ char *station; /* station ident */ char *location; /* location code */ char *channel; /* channel code */ int subchannel; /* subchannel for mux */ double weight; /* channel weight */};struct type35 /* beam configuration */{ int code; /* beam ident code */ int number_beams; /* number of beam cmpts */ struct type35sub *beam; /* substructure */ struct type35 *next; /* ptr to next type35 entry */};/* +=======================================+ *//*=================| station header structures |=================*//* +=======================================+ */struct type41 /* symmetrical coefficients response */{ int response_code; /* response lookup key */ char *name; /* transfer function name */ char symmetry_code; /* response symmetry code */ int input_units_code; /* response in units lookup */ int output_units_code; /* response out units lookup */ int number_numerators; /* number of FIR factors */ double *numerator; /* pointer to numerator list*/ struct type41 *next; /* ptr to next type44 entry */};struct type42sub /* coefficient (type42) */{ double coefficient; /* coefficient value */ double error; /* error value */};struct type42 /* polynomial response */{ int response_code; /* response lookup key */ char *name; /* transfer function name */ char transfer_fct_type; /* transfer function type */ int input_units_code; /* response in units lookup */ int output_units_code; /* response out units lookup */ char poly_approx_type; /* polynomial approximation type */ char valid_freq_units; /* valid frequency units */ double lower_valid_freq; /* lower valid frequency bound */ double upper_valid_freq; /* upper valid frequency bound */ double lower_bound_approx; /* lower bound of approximation */ double upper_bound_approx; /* upper bound of approximation */ double max_abs_error; /* maximum absolute error */ int number_coefficients; /* number of poly. coefficients */ struct type42sub *coefficient; /* pointer to coefficient list */ struct type42 *next; /* ptr to next type42 entry */};struct type43sub /* pole, zero (type43) */{ double real; /* real part */ double imag; /* imaginary part */ double real_error; /* real error */ double imag_error; /* imaginary error */}; struct type43 /* poles and zeroes response */{ int response_code; /* response lookup key */ char *name; /* transfer function name */ char response_type; /* Laplace,analog,digital */ int input_units_code; /* response in units lookup */ int output_units_code; /* response out units lookup */ double ao_norm; /* AO normalization factor */ double norm_freq; /* normalization frequency */ int number_zeroes; /* number of complex zeroes */ struct type43sub *zero;/* struct for a complex zero */ int number_poles; /* number of complex poles */ struct type43sub *pole;/* struct for a complex pole */ struct type43 *next; /* ptr to next type43 entry */};struct type44sub /* coefficient (type44) */{ double coefficient; /* coefficient value */ double error; /* error value */};struct type44 /* coefficients response */{ int response_code; /* response lookup key */ char *name; /* transfer function name */ char response_type; /* Laplace,analog,digital */ int input_units_code; /* response in units lookup */ int output_units_code; /* response out units lookup */ int number_numerators; /* number of numerators */ struct type44sub *numerator; /* struct of numerator */ int number_denominators; /* number of denominators */ struct type44sub *denominator; /* struct for denominator */ struct type44 *next; /* ptr to next type44 entry */};struct type45sub /* response list (type45) */{ double frequency; double amplitude; double amplitude_error; double phase; double phase_error;};struct type45 /* listed response */{ int response_code; /* response lookup key */ char *name; /* transfer function name */ int input_units_code; /* response in units lookup */ int output_units_code; /* response out units lookup */ int number_responses; /* number of responses */ struct type45sub *response; /* struct for response list */ struct type45 *next; /* ptr to next type45 entry */};struct type46sub /* generic response (type46) */{ double frequency; /* corner frequency */ double slope; /* slope, db/decade */};struct type46 /* "generic" response */{ /* aka corner freq/slope resp */ int response_code; /* response lookup key */ char *name; /* transfer function name */ int input_units_code; /* response in units lookup */ int output_units_code; /* response out units lookup */ int number_corners; /* number of corners */ struct type46sub *corner; /* struct of corner */ struct type46 *next; /* ptr to next type46 entry */};struct type47 /* decimation description */{ int response_code; /* response lookup key */ char *name; /* transfer function name */ double input_sample_rate; /* input sample rate */ int decimation_factor; /* decimation factor */ int decimation_offset; /* decimation offset */ double delay; /* estimated delay */ double correction; /* correction applied */ struct type47 *next; /* ptr to next type47 entry */};struct type48sub /* chnl sensitivity (type48) */{ double sensitivity; /* sensitivity */ double frequency; /* frequency of sensitivity */ char *time; /* time of calibration */};struct type48 /* channel sensitivity */{ int response_code; /* response lookup key */ char *name; /* transfer function name */ double sensitivity; /* sensitivity, cts/unit */ double frequency; /* frequency of sensitivity */ int number_calibrations; /* number of calibrations */ struct type48sub *calibration; /* struct of calibration */ struct type48 *next; /* ptr to next type48 entry */};/* +=======================================+ *//*=================| station header structures |=================*//* +=======================================+ */struct type50 /* station identifier */{ char *station; /* station call letters */ double latitude; /* station latitude, -South */ double longitude; /* station longitude, -West */ double elevation; /* station elevation, meters */ /*int number_channels;*/ /* number of channels */ /*int number_comments;*/ /* number of comment blkts */ int reserved1; /* reserved 4 byte field */ int reserved2; /* reserved 3 byte field */ char *name; /* site name */ int owner_code; /* lookup for owner name */ int longword_order; /* 4-byte word order */ int word_order; /* 2-byte word order */ char *start; /* start effective date */ char *end; /* end effective date */ char *update; /* update flag */ char *network_code; /* v2.3 network code */ struct type51 *type51_head; /* first station comment */ struct type51 *type51_tail; /* last station comment */ struct type52 *type52_head; /* first channel */ struct type52 *type52_tail; /* last channel */ struct type50 *station_update; /* station update */ struct type50 *next; /* ptr to next type50 entry */};struct type51 /* station comment */{ char *start; /* beginning effective time */ char *end; /* ending effective time */ int comment_code; /* lookup for comment */ long int level_code; /* lookup for level */ struct type51 *next; /* ptr to next type51 entry */};struct type52 /* channel identifier */{ char *location; /* location id */ char *channel;/* channel id */ int subchannel; /* subchannel for mux */ int instrument_code; /* lookup for inst id */ char *inst_comment; /* instrument comment */ int signal_units_code; /* lookup for signal units */ int calib_units_code; /* lookup for calibration */ double latitude; /* inst latitude */ double longitude; /* inst longitude */ double elevation; /* inst elevation */ double local_depth; /* local depth */ double azimuth; /* inst azimuth rel to N */ double dip; /* inst dip down from horiz */ int format_code; /* lookup for format code */ int log2drecl; /* log2 of data record length */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -