DATRW++ library: seismic data I/O with multiple formats
suheaderstruct.h
Go to the documentation of this file.
1 /*! \file suheaderstruct.h
2  * \brief SU and SEG-Y trace header struct (prototypes)
3  *
4  * ----------------------------------------------------------------------------
5  *
6  * \author Thomas Forbriger
7  * \date 19/11/2010
8  *
9  * Copyright (C) 2007, Colorado School of Mines,
10  * All rights reserved.
11  *
12  * SEG-Y and SU trace header as taken from segy.h coming with SeismicUnix
13  * The SeismicUnix LEGAL_STATEMENT is appended at the end of this file.
14  *
15  * SU and SEG-Y trace header struct (prototypes)
16  *
17  * REVISIONS and CHANGES
18  * - 19/11/2010 V1.0 Thomas Forbriger
19  *
20  * ============================================================================
21  */
22 
23 // include guard
24 #ifndef DATRW_SUHEADERSTRUCT_H_VERSION
25 
26 #define DATRW_SUHEADERSTRUCT_H_VERSION \
27  "DATRW_SUHEADERSTRUCT_H V1.0"
28 
29 namespace datrw {
30 
31  namespace su {
32 
33  //SEG-Y and SU trace header as taken from segy.h coming with SeismicUnix
34 
35  /*! \brief SEG-Y and SU trace header as taken from segy.h coming with
36  * SeismicUnix
37  * \ingroup group_su
38  *
39  * segy - trace identification header
40  *
41  * Only brief descriptions are available in the list.
42  * Some fields are described in detail in the detailed section of the
43  * field.
44  *
45  * Copyright (C) 2007, Colorado School of Mines,
46  * All rights reserved.
47  *
48  * This struct is copied from segy.h in the SeismicUnix distribution.
49  * The author of the code is simply called john there.
50  * The code of SeismicUnix is copyright by the Colorado School of Mines.
51  * The legal statement coming along with SeismicUnix is reproduced at the
52  * end of the source file.
53  */
55 
56  int tracl; /**< Trace sequence number within line.
57 
58  Numbers continue to increase if the
59  same line continues across multiple
60  SEG Y files.
61  */
62 
63  int tracr; /**< Trace sequence number within SEG Y file.
64 
65  Each file starts with trace sequence one.
66  */
67 
68  int fldr; /**< Original field record number */
69 
70  int tracf; /**< Trace number within original field record. */
71 
72  int ep; /**< Energy source point number.
73  Used when more than one record occurs
74  at the same effective surface location.
75  */
76 
77  int cdp; /**< Ensemble number (i.e. CDP, CMP, CRP,...) */
78 
79  int cdpt; /**< Trace number within the ensemble.
80 
81  each ensemble starts with trace number one.
82  */
83 
84  short trid; /**< Trace identification code (see details).
85  Trace identification code:
86  - -1 = Other
87  - 0 = Unknown
88  - 1 = Seismic data
89  - 2 = Dead
90  - 3 = Dummy
91  - 4 = Time break
92  - 5 = Uphole
93  - 6 = Sweep
94  - 7 = Timing
95  - 8 = Water break
96  - 9 = Near-field gun signature
97  - 10 = Far-field gun signature
98  - 11 = Seismic pressure sensor
99  - 12 = Multicomponent seismic sensor,
100  Vertical component
101  - 13 = Multicomponent seismic sensor,
102  Cross-line component
103  - 14 = Multicomponent seismic sensor,
104  in-line component
105  - 15 = Rotated multicomponent seismic sensor,
106  Vertical component
107  - 16 = Rotated multicomponent seismic sensor,
108  Transverse component
109  - 17 = Rotated multicomponent seismic sensor,
110  Radial component
111  - 18 = Vibrator reaction mass
112  - 19 = Vibrator baseplate
113  - 20 = Vibrator estimated ground force
114  - 21 = Vibrator reference
115  - 22 = Time-velocity pairs
116  - 23 ... N = optional use, (maximum N = 32,767)
117 
118  Following are CWP id flags:
119 
120  - 109 = autocorrelation
121  - 110 = Fourier transformed - no packing
122  xr[0],xi[0], ..., xr[N-1],xi[N-1]
123  - 111 = Fourier transformed - unpacked Nyquist
124  xr[0],xi[0],...,xr[N/2],xi[N/2]
125  - 112 = Fourier transformed - packed Nyquist
126  - even N:
127  xr[0],xr[N/2],xr[1],xi[1], ...,
128  xr[N/2 -1],xi[N/2 -1]
129  (note the exceptional second entry)
130  - odd N:
131  xr[0],xr[(N-1)/2],xr[1],xi[1], ...,
132  xr[(N-1)/2 -1],xi[(N-1)/2 -1],xi[(N-1)/2]
133  (note the exceptional second & last entries)
134  - 113 = Complex signal in the time domain
135  xr[0],xi[0], ..., xr[N-1],xi[N-1]
136  - 114 = Fourier transformed - amplitude/phase
137  a[0],p[0], ..., a[N-1],p[N-1]
138  - 115 = Complex time signal - amplitude/phase
139  a[0],p[0], ..., a[N-1],p[N-1]
140  - 116 = Real part of complex trace from 0 to Nyquist
141  - 117 = Imag part of complex trace from 0 to Nyquist
142  - 118 = Amplitude of complex trace from 0 to Nyquist
143  - 119 = Phase of complex trace from 0 to Nyquist
144  - 121 = Wavenumber time domain (k-t)
145  - 122 = Wavenumber frequency (k-omega)
146  - 123 = Envelope of the complex time trace
147  - 124 = Phase of the complex time trace
148  - 125 = Frequency of the complex time trace
149  - 130 = Depth-Range (z-x) traces
150  - 201 = Seismic data packed to bytes (by supack1)
151  - 202 = Seismic data packed to 2 bytes (by supack2)
152  */
153 
154  short nvs; /**< Number of vertically summed traces yielding
155  this trace: 1 is one trace, 2 is two summed traces, etc.
156  */
157 
158  short nhs; /**< Number of horizontally summed traces yielding
159  this trace: 1 is one trace 2 is two summed traces, etc.
160  */
161 
162  short duse; /**< Data use: 1 = Production 2 = Test */
163 
164  int offset; /**< Distance from the center of the source point
165  to the center of the receiver group
166  (negative if opposite to direction in which
167  the line was shot).
168  */
169 
170  int gelev; /**< Receiver group elevation from sea level
171  (all elevations above the Vertical datum are
172  positive and below are negative).
173  */
174 
175  int selev; /**< Surface elevation at source. */
176 
177  int sdepth; /**< Source depth below surface (a positive number). */
178 
179  int gdel; /**< Datum elevation at receiver group. */
180 
181  int sdel; /**< Datum elevation at source. */
182 
183  int swdep; /**< Water depth at source. */
184 
185  int gwdep; /**< Water depth at receiver group. */
186 
187  short scalel; /**< Scalar to be applied to the previous 7 entries
188  to give the real value (see details).
189 
190  Scalar = 1, +10, +100, +1000, +10000.
191  If positive, scalar is used as a multiplier,
192  if negative, scalar is used as a divisor.
193  */
194 
195  short scalco; /**< Scalar to be applied to the next 4 entries
196  to give the real value (see details).
197 
198  Scalar = 1, +10, +100, +1000, +10000.
199  If positive, scalar is used as a multiplier,
200  if negative, scalar is used as a divisor.
201  */
202 
203  int sx; /**< Source coordinate - X */
204 
205  int sy; /**< Source coordinate - Y */
206 
207  int gx; /**< Group coordinate - X */
208 
209  int gy; /**< Group coordinate - Y */
210 
211  short counit; /**< Coordinate units (see details).
212 
213  Coordinate units: (for previous 4 entries and
214  for the 7 entries before scalel).
215 
216  - 1 = Length (meters or feet)
217  - 2 = Seconds of arc
218  - 3 = Decimal degrees
219  - 4 = Degrees, minutes, seconds (DMS)
220 
221  In case 2, the X values are longitude and the Y
222  values are latitude, a positive value designates
223  the number of seconds east of Greenwich
224  or north of the equator.
225 
226  In case 4,
227  - to encode +-DDDMMSS:
228  counit = +-DDD*10^4 + MM*10^2 + SS,
229  with scalco = 1.
230  - To encode +-DDDMMSS.ss:
231  counit = +-DDD*10^6 + MM*10^4 + SS*10^2
232  with scalco = -100.
233  */
234 
235  short wevel; /**< Weathering velocity. */
236 
237  short swevel; /**< Subweathering velocity. */
238 
239  short sut; /**< Uphole time at source in milliseconds. */
240 
241  short gut; /**< Uphole time at receiver group in milliseconds. */
242 
243  short sstat; /**< Source static correction in milliseconds. */
244 
245  short gstat; /**< Group static correction in milliseconds.*/
246 
247  short tstat; /**< Total static applied in milliseconds
248  (zero if no static has been applied).
249  */
250 
251  short laga; /**< Lag time A (see details).
252 
253  Time in ms between end of 240-byte trace
254  identification header and time
255  break, positive if time break occurs after
256  end of header, time break is defined as
257  the initiation pulse which maybe recorded
258  on an auxiliary trace or as otherwise
259  specified by the recording system
260  */
261 
262  short lagb; /**< Lag time B (see details).
263 
264  Time in ms between the time break
265  and the initiation time of the energy source,
266  may be positive or negative.
267  */
268 
269  short delrt; /**< Delay recording time (see details).
270 
271  Time in ms between
272  initiation time of energy source and time
273  when recording of data samples begins
274  (for deep water work if recording does not
275  start at zero time)
276  */
277 
278  short muts; /**< mute time--start */
279 
280  short mute; /**< mute time--end */
281 
282  unsigned short ns; /**< number of samples in this trace */
283 
284  unsigned short dt; /**< sample interval; in micro-seconds */
285 
286  short gain; /**< Gain type of field instruments code (see dateils).
287 
288  - 1 = fixed
289  - 2 = binary
290  - 3 = floating point
291  - 4 ---- N = optional use
292  */
293 
294  short igc; /**< instrument gain constant */
295 
296  short igi; /**< instrument early or initial gain */
297 
298  short corr; /**< correlated: 1 = no, 2 = yes */
299 
300  short sfs; /**< sweep frequency at start */
301 
302  short sfe; /**< sweep frequency at end */
303 
304  short slen; /**< sweep length in ms */
305 
306  short styp; /**< sweep type code:
307  1 = linear,
308  2 = cos-squared,
309  3 = other */
310 
311  short stas; /**< sweep trace length at start in ms */
312 
313  short stae; /**< sweep trace length at end in ms */
314 
315  short tatyp; /**< taper type: 1=linear, 2=cos^2, 3=other */
316 
317  short afilf; /**< alias filter frequency if used */
318 
319  short afils; /**< alias filter slope */
320 
321  short nofilf; /**< notch filter frequency if used */
322 
323  short nofils; /**< notch filter slope */
324 
325  short lcf; /**< low cut frequency if used */
326 
327  short hcf; /**< high cut frequncy if used */
328 
329  short lcs; /**< low cut slope */
330 
331  short hcs; /**< high cut slope */
332 
333  short year; /**< year data recorded */
334 
335  short day; /**< day of year */
336 
337  short hour; /**< hour of day (24 hour clock) */
338 
339  short minute; /**< minute of hour */
340 
341  short sec; /**< second of minute */
342 
343  short timbas; /**< time basis code:
344  1 = local,
345  2 = GMT,
346  3 = other */
347 
348  short trwf; /**< trace weighting factor, defined as 1/2^N
349  volts for the least sigificant bit */
350 
351  short grnors; /**< geophone group number of roll switch
352  position one */
353 
354  short grnofr; /**< geophone group number of trace one within
355  original field record */
356 
357  short grnlof; /**< geophone group number of last trace within
358  original field record */
359 
360  short gaps; /**< gap size (total number of groups dropped) */
361 
362  short otrav; /**< overtravel taper code:
363  1 = down (or behind),
364  2 = up (or ahead) */
365 
366 
367  /* cwp local assignments */
368  float d1; /**< sample spacing for non-seismic data */
369 
370  float f1; /**< first sample location for non-seismic data */
371 
372  float d2; /**< sample spacing between traces */
373 
374  float f2; /**< first trace location */
375 
376  float ungpow; /**< negative of power used for dynamic
377  range compression */
378 
379  float unscale; /**< reciprocal of scaling factor to normalize
380  range */
381 
382  int ntr; /**< number of traces */
383 
384  short mark; /**< mark selected traces */
385 
386  short shortpad; /**< alignment padding */
387 
388 
389  short unass[14]; /**< unassigned (see details).
390 
391  \note last entry causes
392  a break in the word alignment, if we REALLY
393  want to maintain 240 bytes, the following
394  entry should be an odd number of short/UINT2
395  OR do the insertion above the "mark" keyword
396  entry
397  */
398 
399  }; // struct TraceHeaderStruct
400 
401  } // namespace su
402 
403 } // namespace datrw
404 
405 /*
406  * copy of LEGAL_STATEMENT coming along with SeismicUnix source code
407  * -----------------------------------------------------------------
408  *
409  * This file is property of the Colorado School of Mines.
410  *
411  * Copyright (C) 2007, Colorado School of Mines,
412  * All rights reserved.
413  *
414  *
415  * Redistribution and use in source and binary forms, with or
416  * without modification, are permitted provided that the following
417  * conditions are met:
418  *
419  * * Redistributions of source code must retain the above copyright
420  * notice, this list of conditions and the following disclaimer.
421  * * Redistributions in binary form must reproduce the above
422  * copyright notice, this list of conditions and the following
423  * disclaimer in the documentation and/or other materials provided
424  * with the distribution.
425  * * Neither the name of the Colorado School of Mines nor the names of
426  * its contributors may be used to endorse or promote products
427  * derived from this software without specific prior written permission.
428  *
429  * Warranty Disclaimer:
430  * THIS SOFTWARE IS PROVIDED BY THE COLORADO SCHOOL OF MINES AND CONTRIBUTORS
431  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
432  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
433  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
434  * COLORADO SCHOOL OF MINES OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
435  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
436  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
437  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
438  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
439  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
440  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
441  * POSSIBILITY OF SUCH DAMAGE.
442  *
443  *
444  * Export Restriction Disclaimer:
445  * We believe that CWP/SU: Seismic Un*x is a low technology product that does
446  * not appear on the Department of Commerce CCL list of restricted exports.
447  * Accordingly, we believe that our product meets the qualifications of
448  * an ECCN (export control classification number) of EAR99 and we believe
449  * it fits the qualifications of NRR (no restrictions required), and
450  * is thus not subject to export restrictions of any variety.
451  *
452  * Approved Reference Format:
453  * In publications, please refer to SU as per the following example:
454  * Cohen, J. K. and Stockwell, Jr. J. W., (200_), CWP/SU: Seismic Un*x
455  * Release No. __: an open source software package for seismic
456  * research and processing,
457  * Center for Wave Phenomena, Colorado School of Mines.
458  *
459  * Articles about SU in peer-reviewed journals:
460  * Saeki, T., (1999), A guide to Seismic Un*x (SU)(2)---examples of data processing (part 1), data input and preparation of headers, Butsuri-Tansa (Geophysical Exploration), vol. 52, no. 5, 465-477.
461  * Stockwell, Jr. J. W. (1999), The CWP/SU: Seismic Un*x Package, Computers and Geosciences, May 1999.
462  * Stockwell, Jr. J. W. (1997), Free Software in Education: A case study of CWP/SU: Seismic Un*x, The Leading Edge, July 1997.
463  * Templeton, M. E., Gough, C.A., (1998), Web Seismic Un*x: Making seismic reflection processing more accessible, Computers and Geosciences.
464  *
465  * Acknowledgements:
466  * SU stands for CWP/SU:Seismic Un*x, a processing line developed at Colorado
467  * School of Mines, partially based on Stanford Exploration Project (SEP)
468  * software.
469  */
470 
471 #endif // DATRW_SUHEADERSTRUCT_H_VERSION (includeguard)
472 
473 /* ----- END OF suheaderstruct.h ----- */
int gy
Group coordinate - Y.
short muts
mute time–start
int sy
Source coordinate - Y.
short sec
second of minute
float d1
sample spacing for non-seismic data
short scalel
Scalar to be applied to the previous 7 entries to give the real value (see details).
short nofils
notch filter slope
int tracl
Trace sequence number within line.
short gain
Gain type of field instruments code (see dateils).
int sx
Source coordinate - X.
int ep
Energy source point number.
short gut
Uphole time at receiver group in milliseconds.
int gdel
Datum elevation at receiver group.
short hcs
high cut slope
short minute
minute of hour
short sfe
sweep frequency at end
short hcf
high cut frequncy if used
short year
year data recorded
short slen
sweep length in ms
int fldr
Original field record number.
short igi
instrument early or initial gain
SEG-Y and SU trace header as taken from segy.h coming with SeismicUnixsegy - trace identification hea...
short hour
hour of day (24 hour clock)
short gaps
gap size (total number of groups dropped)
short afils
alias filter slope
short sut
Uphole time at source in milliseconds.
int ntr
number of traces
short otrav
overtravel taper code: 1 = down (or behind), 2 = up (or ahead)
short corr
correlated: 1 = no, 2 = yes
int gelev
Receiver group elevation from sea level (all elevations above the Vertical datum are positive and bel...
short mark
mark selected traces
int tracr
Trace sequence number within SEG Y file.
short styp
sweep type code: 1 = linear, 2 = cos-squared, 3 = other
int selev
Surface elevation at source.
short lcf
low cut frequency if used
int cdp
Ensemble number (i.e.
short lagb
Lag time B (see details).
float f1
first sample location for non-seismic data
short grnofr
geophone group number of trace one within original field record
short grnors
geophone group number of roll switch position one
short igc
instrument gain constant
short stae
sweep trace length at end in ms
short timbas
time basis code: 1 = local, 2 = GMT, 3 = other
short trid
Trace identification code (see details).
short nvs
Number of vertically summed traces yielding this trace: 1 is one trace, 2 is two summed traces...
unsigned short dt
sample interval; in micro-seconds
int sdepth
Source depth below surface (a positive number).
unsigned short ns
number of samples in this trace
float d2
sample spacing between traces
Root namespace of library.
Definition: aalibdatrwxx.cc:16
short sfs
sweep frequency at start
short scalco
Scalar to be applied to the next 4 entries to give the real value (see details).
short afilf
alias filter frequency if used
int gwdep
Water depth at receiver group.
short delrt
Delay recording time (see details).
float f2
first trace location
short swevel
Subweathering velocity.
float unscale
reciprocal of scaling factor to normalize range
short trwf
trace weighting factor, defined as 1/2^N volts for the least sigificant bit
short laga
Lag time A (see details).
int gx
Group coordinate - X.
int swdep
Water depth at source.
short stas
sweep trace length at start in ms
short gstat
Group static correction in milliseconds.
short unass[14]
unassigned (see details).
int tracf
Trace number within original field record.
int cdpt
Trace number within the ensemble.
float ungpow
negative of power used for dynamic range compression
int sdel
Datum elevation at source.
short tstat
Total static applied in milliseconds (zero if no static has been applied).
short mute
mute time–end
short duse
Data use: 1 = Production 2 = Test.
short nhs
Number of horizontally summed traces yielding this trace: 1 is one trace 2 is two summed traces...
short sstat
Source static correction in milliseconds.
short grnlof
geophone group number of last trace within original field record
int offset
Distance from the center of the source point to the center of the receiver group (negative if opposit...
short counit
Coordinate units (see details).
short tatyp
taper type: 1=linear, 2=cos^2, 3=other
short nofilf
notch filter frequency if used
short wevel
Weathering velocity.
short shortpad
alignment padding