/* Structures for the Seismic Processing System * * History: * RWC 03/15/88 * -created * RWC 03/22/88 * -added muteinfo structure. * -added mutes to srcinfo. * -added traceinfo structure. * -added 'status' to trcinfo. * -combined lineinfo structures. * RWC 03/24/88 * -added 'components' to src rec usr and trc structs. * -added samplerate to rec structs. * -redid to headfilehead. * RWC 03/27/88 * -changed headfilehead and traceinfo. * -added defs for data_ops. * RWC 03/29/88 * -added trcinfo lists to lineinfo struct. * CBW 05/16/88 * -added SRC_ID and REC_ID, removed MID, and renumbered. * CBW 07/17/88 * -added REQUEST and def structures * CBW 07/25/88 * -began using sccs to control changes to source code--further comments * will be contained in the comments section of that system. */ /* %W% %G% */ #define VERSION 101 /* code version */ /* options for 'datarequest' type: */ #define SRC 1 /* get source gather */ #define REC 2 /* get receiver gather */ #define SRC_ID 3 /* get source gather for given sid */ #define REC_ID 4 /* get receiver gather for given rid */ #define HEADS 5 /* get all headers, trace order */ #define ALL 6 /* get all headers and data, trace order */ #define OFF 7 /* get constant offset section */ #define MIDLINE 8 /* get midpoints along a line */ #define STACK 9 /* not a datarequest option: stacked section id # */ /* options for 'datainit' mode: */ #define HEAD 0 /* partial initialization (with headers only) */ #define FULL 1 /* full initialization (with data) */ /* options for data ops: (unique bits) */ #define NONE 0x0000 /* no operations */ #define DOMUTE 0x0001 /* do mutes */ #define DOSTAT 0x0002 /* do time statics */ #define DOASTAT 0x0004 /* do amplitude statics */ #define DONMO 0x0008 /* do normal moveout */ /* error codes for routine "err" */ #define FATAL 1 #define WARN 0 /* status bits for info structures */ #define INIT 0x0000 /* initial condition of all status bits */ #define DEADTR 0x0001 /* dead trace (or shot or receiver) */ #define USE_GN 0x0100 /* apply gain in traceinfo to each sample of trace */ #define SH_FMT 0x1000 /* data format is short integers (default is float) */ /* velocity units used in nmo */ #define FPS 0 /* feet per second */ #define KFPS 1 /* thousand feet per second */ #define MPS 2 /* meters per second */ #define KMPS 3 /* thousand meters per second */ #define BIG 1.0e20 /* a very large number */ #define SQRT sqrt struct usrinfo /* header returned to user program, per trace */ { int sid, rid; /* source receiver indices (for markers) */ float xs, ys, zs; /* source location and elevation */ float xr, yr, zr; /* receiver location and elevation */ float xm, ym; /* midpoint location */ float offset; /* offset */ float dt; /* sample rate */ int nt; /* # of samples */ float t0; /* time at beginning of data */ int scomp,rcomp; /* source and receiver components */ int status; /* status bits */ float dtstatic; /* time static for trace */ float astatic; /* amplitude static for trace */ }; #define USIZE sizeof(struct usrinfo) #define NMUTE 4 /* maximum # of mutes per shot */ struct srcinfo /* per shot info */ { int flagnum; /* survey flag # */ float x, y, z; /* location and elevation */ int nrec; /* # of traces from this shot */ float dtstatic; /* source time static */ float ampstatic; /* source amplitude static */ int status; /* bit switches */ int comp; /* source component */ int nmute; /* # of mutes for this shot */ int mutes[NMUTE]; /* indices into muteinfo structure */ }; #define SSIZE sizeof( struct srcinfo ) struct recinfo /* per reciever info */ { int flagnum; /* survey flag # */ float x, y, z; /* location and elevation */ int nsrc; /* # of traces from this receivers */ float dtstatic; /* receiver time static */ float ampstatic; /* receiver amplitude static */ int status; /* bit switches */ int comp; /* receiver component */ float samplerate; /* receiver sample rate */ }; #define RSIZE sizeof( struct recinfo ) #define ushort unsigned short struct trcinfo /* per trace info (in core) */ { ushort sid, rid; /* srcinfo - recinfo indices */ ushort nt; /* # of time points */ ushort itbegin; /* sample of start of data */ ushort status; /* status bits for trace */ ushort comp; /* src and rec components */ int index; /* index into trace file */ }; #define TSIZE sizeof( struct trcinfo ) struct muteinfo /* one for each mute */ { /* data(off,t) nulled if: * tmin <= t <= tmax * offmin <= off <= offmax * upper edge <= t <= lower edge */ float offmin; /* minimum offset of window */ float offmax; /* maximum offset of window */ float tmin; /* minimum time of window */ float tmax; /* maximum time of window */ float a1,b1; /* upper edge t= a1*off + b1 */ float a2,b2; /* lower edge t= a2*off + b2 */ }; #define MSIZE sizeof( struct muteinfo ) #define HMAGIC1 1234567 #define HMAGIC2 2345678 struct headfilehead /* format of headfile leader */ { int hmagic1; /* for checking valid headfile */ int version; /* system version number */ int fmt; /* format of headfile */ int nsrc; /* # of srcinfo structures */ int nrec; /* # of recinfo structures */ int ntrc; /* # of trcinfo structures */ int nmute; /* # of mutes defined */ int imutemax; /* maximum index of mutes defined */ int nline; /* # of lines defined */ int ilinemax; /* maximum index of lines defined */ int ntmax; /* largest # of samples per trace */ int hmagic2; /* for checking valid headfile */ }; #define HSIZE sizeof(struct headfilehead) #define NUSER 4 struct traceinfo /* the on disk or tape trace header */ { float xs,ys,zs; /* source location */ float xr,yr,zr; /* receiver location */ float t0; /* time at start of data */ int nt; /* number of samples */ float samplerate; /* sample rate i.e. 4 mils = 0.004 */ int srcflagnum; /* source survey flag number */ int recflagnum; /* receiver survey flag number */ int status; /* status bits for trace */ float gain; /* gain of recorder */ float dtstatic; /* trace time static */ float ampstatic; /* trace amplitude static */ ushort recorder; /* recorder # */ ushort chan; /* recording channel */ ushort scomp; /* source comp. */ ushort rcomp; /* receiver comp. */ int user[NUSER]; /* user space */ }; #define TRSIZE sizeof(struct traceinfo) #define NLINE 10 /* (temp) maximum # of lines */ struct lineinfo /* one these per defined line */ { int nseg; /* # of segments in line */ float x0, y0; /* first point in line */ float x1, y1; /* last point in line */ float dx, dy; /* slope from first to last */ float length; /* total line length */ struct segment *seg; /* pointer to line segments is np > 2 */ float offtol; /* off-line tolerance */ int nlist; /* # in lists below */ int *list; /* list of trcinfo indices for this line */ float *qdist; /* list of distances along line */ }; #define LSIZE sizeof(struct lineinfo) struct segment { float x0, y0; /* first point in segment */ float x1, y1; /* 2nd point in segment */ float dx, dy; /* slope from 0 to 1 */ float len0; /* line length at point 0 */ float len1; /* line length at point 1 */ }; #define SEGSIZE sizeof(struct segment) struct srcpar { float xs; /* x-coordinate of nearest source */ float ys; /* y-coordinate of nearest source */ float tol; /* tolerance for SRC request */ }; struct sidpar { int sid; /* id of source */ }; struct recpar { float xr; /* x-coordinate of nearest receiver */ float yr; /* y-coordinate of nearest receiver */ float tol; /* tolerance for REC request */ }; struct ridpar { int rid; /* id of receiver */ }; struct midpar { float q; /* midpoint distance along line */ float dq; /* midpoint spacing along line */ float offmin; /* minimum offset for midpoint requests */ float offmax; /* maximum offset for midpoint requests */ }; struct offpar { float offmin; /* minimum offset for offset gather */ float offmax; /* maximum offset for offset gather */ }; typedef struct request_defaults /* generic structure handed to datarequest */ { int type; /* one of the datarequest options above */ int iline; /* line number for MIDLINE and OFF requests */ union { struct srcpar s; struct sidpar si; struct recpar r; struct ridpar ri; struct midpar m; struct offpar o; } params; } REQUEST; #define SRCPAR params.s #define SIDPAR params.si #define RECPAR params.r #define RIDPAR params.ri #define MIDPAR params.m #define OFFPAR params.o struct def /* defaults for getrequest call */ { float xs; /* SRC defaults */ float ys; float stol; int sid; /* SRC_ID defaults */ float xr; /* REC defaults */ float yr; float rtol; int rid; /* REC_ID defaults */ int miline; /* MIDLINE defaults */ float q; float dq; float moffmin; float moffmax; int oiline; /* OFF defaults */ float ooffmin; float ooffmax; };