You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

316 lines
16 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/* Copyright (c) Colorado School of Mines, 2003.*/
/* All rights reserved. */
/*-----------------------------------------------------------------------
* segd.h - include file for SEGD traces
* Version 2.1, 10/10/94, Marc Schaming
* Version 2.2, 17/08/95, Celine Girard et Marc Schaming
* Version 2.3, 04/1997, Marc Schaming
* Version 2.4, 02/1998, Stewart A. Levin (SEP)
* changed general_header_1.f to unsigned char[2]
* changed non-struct typedefs to struct typedefs
* to allow for uniform future expansion
* Version 2.5, 02/2001, Stewart A. Levin (SEP)
* Little endian fix up for channel_set_header.cs
* and dem_trace_header,tn
*
* declarations for: 版本1 版本2
* typedef struct {} segd_tape_label : 无 tape label
* typedef struct {} segd_general_header_1 : general header 与1相同
* typedef struct {} segd_general_header_2 : general header 与1相同
* typedef struct {} segd_general_header_n : general header 与1相同
* typedef struct {} segd_gen_head_sn358 : general header for sn358
* typedef struct {} segd_channel_set_header: channel set descriptor 与1相同29字节稍扩展
* typedef struct {} segd_sample_skew : sample skew block
* typedef struct {} segd_extended_header : extended header
* typedef struct {} segd_external_header : external header
* typedef struct {} segd_general_trailer : general trailer 与1相同
* typedef struct {} segd_demux_trace_header: Demux trace header 与1相同
* typedef struct {} segd_trace_header_ext : trace header extension 长度相同,做了扩展
* typedef struct {} segd_general_trailer : general trailer 与1相同
*
*
* Reference:
* SEG Subcommitee on Digital Tape Formats, "Digital field tape format standards - SEG-D"
*
* Digital field tape format standards - SEG-D, REVISION 1 (1994) Geophysics, vol. 59, p.668-684
*
* 版本2中在开始位置比版本1多记录了128字节的磁带标签信息指明了该磁带的一些记录参数和格式信息
* 其中5~9字节内容为“SD2.0”说明为SegD版本2格式。
*
*---------------------------------------------------------------------*/
namespace NSegD
{
//////////////////////////////////////////////////////////////////////
//版本2增加的磁带头定义在文件开始
/*---------------- Tape Label --------------------------------------*/
typedef struct stuSegDTapeLabel{
unsigned char susn[4]; /* 01-04 Storage unit sequence number */
unsigned char rev[5]; /* 05-09 SegD Revision 必须为SD2.0由此判断是否为2.0格式 */
unsigned char sus[6]; /* 10-15 Storage unit structure */
unsigned char ba[4]; /* 16-19 Binding addition */
unsigned char mbs[10]; /* 20-29 Maximum block size */
unsigned char acode[10];/* 30-39 API Producer organization code */
unsigned char cdate[11];/* 40-50 Creation date */
unsigned char sn[12]; /* 51-62 Serial number */
unsigned char res[6]; /* 63-68 Reserved */
//Storage set identifier 60个字节
unsigned char eln[12]; /* 69-80 External Label Name */
unsigned char ren[24]; /* 81-104 Recording Entity Name */
unsigned char ud[14]; /* 105-118 User defined */
unsigned char msr[10]; /* 119-128 Max shot records per field record */
} SEGD_TAPE_LABEL;
//头段块包括至少两个通用头段,一个或多个扫描类型头段以及可选的
// 扩展头段、外部头段其大小均为32字节
//
//
// -----------------------------------------------------------------------------------
// | | | | | | | |
// | 通用头1 | 通用头2 | 通用头 | 通道 | 通道 | 通道 | ... |
// | | | (可选) | 设置1 | 设置2 | 设置3 | |
// -----------------------------------------------------------------------------------
// | 32字节 | 32B | 32 | 32 | 32 | 32 | ... |
// 个数由头1
// 中定义
/*---------------- General header block #1 -------------------------*/
typedef struct stuSegDGeneralHeader1{
unsigned char f[2]; /* 01-02 File number (0-9999) 文件号,
如果超出9999范围由该处为FFFF个数记录在头段2的第1~3字节处 */
unsigned short fc; /* 03-04 Format code 格式代码 */
char k1_k2; /* 05 General constants */
char k3_k4; /* 06 General constants */
char k5_k6; /* 07 General constants */
char k7_k8; /* 08 General constants */
char k9_k10; /* 09 General constants */
char k11_k12; /* 10 General constants */
unsigned char year; /* 11 Year (0-99) */
unsigned char gh_day1;/* 12 Number blocks in general header 头段块的个数(高四位)*/
/* 12 - day of year (x--) */
unsigned char day; /* 13 Day of year (xx) */
unsigned char hour; /* 14 Hour of day */
unsigned char minute; /* 15 Minute of hour */
unsigned char second; /* 16 Second of minute */
unsigned char m[3]; /* 17 Manufacturer's code 生产商代码*/
/* 18-19 and serial number */
unsigned char b[3]; /* 20-22 Bytes per scan (multiplexed only) 每个扫描的字节数,仅时序时*/
unsigned char i; /* 23 Base scan interval 采样间隔*/
unsigned char p_sbx; /* 24 Polarity */
/* 24 - Number of scans per block */
unsigned char sb; /* 25 Number of scans per block */
unsigned char z_r1; /* 26 Record type */
/* 26 - Record length 记录长度还可定义在头段2中的15~17字节*/
unsigned char r; /* 27 Record length */
unsigned char str; /* 28 Scan types per record 扫描类型个数 */
unsigned char cs; /* 29 Channels sets per scan type 每个扫描类型中的道组数,
表示范围为0~99如果大于99时则记录在头段2的4、5字节上*/
unsigned char sk; /* 30 Sample Skew blocks 采样时偏头段个数为0时表示没有*/
unsigned char ec; /* 31 Extended header length 扩展头段个数,
表示范围为0~99如果扩展头个数超过99个时则该字节内容为FF
个数记录在头段2的第6、7字节上 */
unsigned char ex; /* 32 External header length 外部头个数,
表示范围0~99超过时记录在头段2的8、9字节上*/
} SEGD_GENERAL_HEADER_1;
/*---------------- General header block #2 -------------------------*/
typedef struct stuSegDGeneralHeader2{
unsigned char ef[3]; /* 01-03 Extended file number */
unsigned char en[2]; /* 04-05 Extended channel sets and scan types */
unsigned char ecx[2]; /* 06-07 Extended header blocks 扩展头个数仅当扩展头个数大于99时才使用*/
unsigned char eh[2]; /* 08-09 external header blocks 外部头个数 */
char x1; /* 10 undefined */
unsigned char rev[2]; /* 11-12 SEG-D revision number */
unsigned short gt; /* 13-14 General trailer number */
unsigned char erl[3]; /* 15-17 Extended record length 扩展记录长度 */
char x2; /* 18 undefined */
unsigned char bn; /* 19 General header block number 通用头段块个数*/
char x3[13]; /* 20-32 undefined */
} SEGD_GENERAL_HEADER_2;
/*---------------- General header block #n -------------------------*/
typedef struct stuSegDGeneralHeaderN{
char x1[3]; /* 01-03 undefined */
unsigned char sln[5]; /* 04-08 Source line number4-5为整数部分7-8为小数部分 */
unsigned char spn[5]; /* 09-13 Source point number9-11为整数部分12-13为小数部分 */
unsigned char spi; /* 14 Source point index */
unsigned char pc; /* 15 Phase control */
unsigned char v; /* 16 Type vibrator */
short pa; /* 17-18 Phase angle */
unsigned char bn; /* 19 General header block number */
unsigned char ss; /* 20 Source set number */
char x2[12]; /* 21-32 undefined */
} SEGD_GENERAL_HEADER_N;
/*---------------- General header extension (Sercel SN358) ---------*/
typedef struct stuSegDGeneralHeaderSN358{
unsigned char fc1; /* 01 first and last channel of seismic param 1 */
unsigned char lc1; /* 01-02 last channel of seismic param 1 */
unsigned char fc2; /* 03-04 first channel of seismic param 2 */
unsigned char f_lc2; /* 03-04 first and last channel of seismic param 2 */
unsigned char lc2; /* 04-05 last channel of seismic param 2 */
unsigned char fc3; /* 06-07 first channel of seismic param 3 */
unsigned char f_lc3; /* 07 fist and last channel of seismic param 3 */
unsigned char lc3; /* 07-08 last channel of seismic param 3 */
unsigned char fc4; /* 09-10 first channel of seismic param 4 */
unsigned char f_lc4; /* 10 first and last channel of seismic param 4 */
unsigned char lc4; /* 10-11 fist channel of seismic param 4 */
unsigned char f_lac1; /* 12 first and last aux channel of scan type 1 */
unsigned char fsc1; /* 13-14 first seismic channel of scan type 1 */
unsigned char f_lsc1; /* 14 first and last seismic channel of scan type 1 */
unsigned char lsc1; /* 14-15 last seismic channel of scan type 1 */
unsigned char sam_int1; /* 16 sample interval of scan type 1 */
unsigned char fac2; /* 17 first and last aux channel of scan type 2 */
unsigned char fsc2; /* 18-19 first seismic channel of scan type 2 */
unsigned char f_lsc2; /* 19 first and last seismic channel of scan type 2 */
unsigned char lsc2; /* 19-20 last seismic channel of scan type 2 */
unsigned char sam_int2; /* 21 sample interval of scan type 2 */
unsigned char bl_sig_le; /* 22 block signature length (n*0.1 s) */
unsigned char rec_length[2]; /* 23-24 record length n*0.1 s (00.0-99.9) s */
unsigned char dyn_swit_del[2]; /* 25-26 dynamically switching delay (00.0-99.9 s) */
unsigned char rec_del[2]; /* 27-28 recording delay (00.0-99.9s) */
unsigned char ty_a_cha12; /* 29 type of auxiliary channel 1, channel 2 */
unsigned char ty_a_cha34; /* 30 type of auxiliary channel 3, channel 4 */
unsigned char ty_a_cha56; /* 31 type of auxiliary channel 5, channel 6 */
unsigned char ty_a_cha78; /* 32 type of auxiliary channel 7, channel 8 */
unsigned char mode_num; /* 33 mode number */
unsigned char an_sys_co; /* 34 analog sys count (1-2), tape transport num */
unsigned char reel_num[2]; /* 35-36 reel number (0-9999) */
unsigned char file_num[2]; /* 37-38 file logical number */
unsigned char sp_num[2]; /* 39-40 shot point number */
unsigned char lc_nf; /* 41 lc=0 lowcut fi. out, nf=0 notch fi. out */
unsigned char fg_ic; /* 42 fg=1 fist fixed gain, ic=1 internal osc. */
unsigned char of1; /* 43-45 oscillator frequency (0-9999.9 Hz) */
unsigned char of2; /* 43-45 oscillator frequency (0-9999.9 Hz) */
unsigned char of3; /* 43-45 oscillator frequency (0-9999.9 Hz) */
unsigned char osc_att; /* 46 oscillator attenuator */
unsigned char t_sig_ph; /* 47 test signal phase (1:+,0:-) */
unsigned char m_gain; /* 48 main gain amplifier (0-15) 16: IFP */
unsigned char dum[16]; /* 49-64 additional information */
} SEGD_GEN_HEAD_SN358;
/*---------------- Scan type header (Channel set descriptor ) ------*/
typedef struct stdSegDChannelSetHeader{
unsigned char st; /* 01 Scan type 扫描类型*/
unsigned char cn; /* 02 Channel set number 道组号*/
unsigned short tf; /* 03-04 Channel set start time 开始时间*/
unsigned short te; /* 05-06 Channel set end time 结束时间*/
unsigned char mp[2]; /* 07-08 Descaling exponent 反换算因子*/
unsigned char cs[2]; /* 09-10 Channels in this channel set 本道组包含的道数*/
unsigned char c; /* 11 Channel type identification */
unsigned char sc_j; /* 12 Sample/channel gain 子样个数*/
/* 12 - Gain control method 增益控制方式*/
unsigned short af; /* 13-14 Alias filter frequency 去假频滤波器截止频率*/
unsigned short as; /* 15-16 Alias filter slope 去假频滤波器陡度*/
unsigned short lc; /* 17-18 Low cut filter frequency 低切滤波器截止频率*/
unsigned short ls; /* 19-20 Low cut filter slope 低切滤波器陡度*/
unsigned short nt[3]; /* 21-26 Notch filter frequency 陷波滤波器频率*/
unsigned short ecs; /* 27-28 Extended channel set number 扩展道组号*/
unsigned char efh; /* 29 Extended header flag 在版本2中有扩展*/
unsigned char vs; /* 30 Vertical stack */
unsigned char cab; /* 31 Streamer number */
unsigned char ary; /* 32 Array forming */
} SEGD_CHANNEL_SET_HEADER;
/*---------------- Sample skew 采样时偏-------------------------------------*/
//是指各道第一次采样时刻相对于第一次扫描开始时刻(即第一个计时字)的偏移
typedef struct stuSegDSampleSkew {
unsigned char skew[32];
} SEGD_SAMPLE_SKEW;
/*---------------- Extended header 扩展头---------------------------------*/
typedef struct stuSegDExtendedHeader {
unsigned char dummy[32];
} SEGD_EXTENDED_HEADER;
/*---------------- External header 外部头---------------------------------*/
typedef struct stuSegDExternalHeader {
unsigned char dummy[32];
} SEGD_EXTERNAL_HEADER;
//
// -----------------------------------------------------------------------------------
// | | | | | | | | |
// | 道头 | 道头 | 道头 | 道头 | 道头 | 道头 | ... | 数据道 |
// | | 扩展1 | 扩展2 | 扩展3 | 扩展4 | 扩展5 | | |
// -----------------------------------------------------------------------------------
// | 20字节 | 32B | 32 | 32 | 32 | 32 | ... | |
//
/*--------------- Demux trace header 道头------------------------------*/
typedef struct stuSegDDemuxTraceHeader {
unsigned char f[2]; /* 01-02 file number 文件号 */
unsigned char st; /* 03 scan type (1-2) 扫描类型 */
unsigned char cn; /* 04 channel set 道组数 */
unsigned char tn[2]; /* 05-06 trace number 道号 */
unsigned char t[3]; /* 07-09 timing word of the first sample if
the data were written in the multiplexed format */
unsigned char the; /* 10 trace header extensions 扩展道头的个数 */
unsigned char ss; /* 11 sample skew of the first sample
of the trace. It is a part of
the fractional part of the base scan interval.
Res :1/256 scan interval */
unsigned char tr; /* 12 trace edit */
unsigned char tw[3]; /* 13-15 time from time break to the end of
the internal time break window (binary
number, inc 1ms) */
unsigned char en[2]; /* 16-17 extended channel set number */
unsigned char efn[3]; /* 18-20 extended file number */
} SEGD_DEMUX_TRACE_HEADER;
/*---------------- Trace header extension 道头扩展--------------------------*/
typedef struct stuSegDTraceHeaderExtension {
unsigned char rln[3]; /* 01-03 Receiver line number 接收线号 */
unsigned char rpn[3]; /* 04-06 Receiver point number 接收点号 */
unsigned char rpi; /* 07 Receiver point index 接收点索引 */
unsigned char nbs[3]; /* 08-10 Number of samples per traces 每道采样点个数*/
//在Rev1中11-32没有定义
//char x[22]; /* 11-32 undefined */
//在Rev2中进行了扩展
unsigned char erln[5]; /* 11-15 Extended Receiver Line Number */
unsigned char erpn[5]; /* 16-20 Extended Receiver Point Number */
unsigned char sen; /* Sensor Type recorded on this trace */
char x[11]; /* 22-32 undefined */
} SEGD_TRACE_HEADER_EXT;
/*---------------- General trailer ---------------------------------*/
typedef struct stuSegDGeneralTrailer {
unsigned short gt; /* 01-02 General trailer number */
char x1[8]; /* 03-10 undefined */
unsigned char c; /* 11 Channel type identification */
char x2[21]; /* 12-32 undefined */
} SEGD_GENERAL_TRAILER;
}//namespace
using namespace NSegD;