UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vsp_trace.h
1 /* vsp_trace.h $Revision: 1.29 $ $Date: 2008/10/06 12:35:22 $ */
2 
3 /*************************************************************
4  *
5  * Interlanguage definitions that correlated with trace, its
6  * header, and symbolic names etc.
7  *
8  *************************************************************/
9 
10 #ifndef __vsp_trace_h
11 
12 #define __vsp_trace_h
13 
14 #include <mix/Types.h>
15 #include <mix/General.h>
16 
17 #ifdef __cplusplus
18 extern "C"
19 {
20 #endif
21 
25 typedef AtomType SampleFormat;
26 
27 #define REAL4 REAL_4
28 #define INT4 INT_4
29 #define INT2 INT_2
30 
31 
36 typedef enum /* offset - remark, unit of measure (data type) */
37 {
38  TA_NMGL = 0,
39 #define TALogicalNo TA_NMGL
40 
41  TA_NTR,
42 #define TAChannelNo TA_NTR
43 
44  TA_SIZE,
45 #define TAHdrSize TA_SIZE
46 
47  TA_ACT,
48 #define TAActuality TA_ACT
49 
50  TA_NMGF,
51 #define TAFieldNo TA_NMGF
52 
53  TA_XSP,
54  TA_XDP,
55  TA_XOP,
56  TA_L,
58  TA_FTR,
59 #define TAFormat TA_FTR
60 
61  TA_TBC,
62  TA_TEC,
64  TA_TBA,
65 #define TAStartTime TA_TBA
66 
67  TA_TEA,
68 #define TAEndTime TA_TEA
69 
70  TA_DT,
71 #define TASamplingRate TA_DT
72 
73  TA_P,
74 #define TAWeight TA_P
75 
76  TA_VER,
77 #define TAVersion TA_VER
78 
79  TA_NCF,
80 #define TACoef TA_NCF
81 
82  TA_NSP,
84  TA_YSP,
85  TA_YDP,
86  TA_YOP,
88  TA_NXBN,
89  TA_NYBN,
91  TA_XMC,
92  TA_YMC,
94  TA_PNAME,
95  TA_PVAL,
97  TA_PPGM,
99  TA_TRFR,
100 #define TAFieldChannelNo TA_TRFR
101 
102  /* Coordinats for VSP-application, m */
103  TA_XSPV,
104  TA_YSPV,
105  TA_ZSPV,
106  TA_XOPV,
107  TA_YOPV,
108  TA_ZOPV,
109  TA_XDPV,
110  TA_YDPV,
111  TA_ZDPV,
113  TA_HCAB,
114 #define TAProbeDepth TA_HCAB
115 
116  TA_TYPE,
117 #define TADeviceType TA_TYPE
118 
119  TA_COMP,
120 #define TAComponent TA_COMP
121 
122  TA_WCODE,
123  TA_DHSP,
124  TA_DELAY,
126  TA_NDP,
127  TA_AZIMUTH,
128  TA_DIP,
129  TA_TFB,
130  TA_AMAX,
131  TA_AMIN,
132  TA_NSL,
133  TA_NSS,
134  TA_NRP,
135  TA_NRL,
136  TA_NRS,
137  TA_REZ,
139  TA_EXTRA_0
142 } TraceAttrId;
143 
146 #define TA_EXTRA(x) (TA_EXTRA_0 + (x))
147 
148 
149 /*************************************************************
150  * Service and general purpose functions
151  *************************************************************/
152 
154 unsigned HeaderSize (const sds_trace_header *pHeader);
155 
157 unsigned BodySize (const sds_trace_header *pHeader);
158 
160 Int4 GetInt4DT (Real4 dt);
161 Real4 GetReal4DT (Int4 dt);
162 
164 unsigned SizeOfSample (SampleFormat format);
165 
167 void CvtSample (void* dst, SampleFormat dst_format,
168  const void* src, SampleFormat src_format);
169 
171 void CvtArray (void* dst, SampleFormat dst_format,
172  const void* src, SampleFormat src_format,
173  unsigned scnt);
174 
175 /*************************************************************
176  * Field of header <--> Real4, Int4 attributes
177  * Returns OK or ERROR__BAD_TAID, ERROR__NULL,
178  * ERROR__SHORT_HEADER
179  *************************************************************/
180 ErrCode GetIntAttr (const sds_trace_header* pHdr,
181  TraceAttrId taid,
182  Int4* pValue);
183 ErrCode GetRealAttr (const sds_trace_header* pHdr,
184  TraceAttrId taid,
185  Real4* pValue);
186 ErrCode SetIntAttr (sds_trace_header* pHdr,
187  TraceAttrId taid,
188  Int4 value);
189 ErrCode SetRealAttr (sds_trace_header* pHdr,
190  TraceAttrId taid,
191  Real4 value);
192 
193 
194 /*************************************************************
195  * Some high-level operation on trace. When time is not in
196  * permitted range [Tb..Te] then 0.0 is returned.
197  *************************************************************/
198 
204 void ProcARU (int iCount,
205  const Real4* pSrc,
206  Real4* pDst,
207  int iGapWidth,
208  Real4 fStartThd,
209  Real4 fZeroThd,
210  Real4* pfAmaxSrc,
211  Real4* pfAmaxDst,
212  Real4* pfAavgmax
213  );
214 
215 
219 typedef AtomType TaidType;
220 #define taREAL_4 REAL_4
221 #define taINTEGER_4 INT_4
222 #define taCHAR_1 CHAR_1
223 
224 
228 typedef struct
229 {
230  char name[10];
231  TraceAttrId taid;
232  TaidType type;
234 } IndexMapItem;
235 
236 
240 typedef struct
241 {
242  char name[20];
243  TraceAttrId taid;
244  unsigned offset;
245  TaidType type;
246  unsigned dim;
248 } TaidMapItem;
249 
250 
257 int FindTaidName (const char* szName);
258 
259 
260 #ifndef __vsp_trace_vars
261 
262 extern TaidMapItem aTaid2Index[];
263 extern int nTaid2IndexVolume;
265 extern IndexMapItem aIndex2Taid[];
266 extern int nIndex2TaidVolume;
268 #endif /* __vsp_trace_vars */
269 
270 
271 #ifdef __cplusplus
272 };
273 #endif
274 
275 #endif /* vsp_trace.h */
TaidType type
Definition: vsp_trace.h:232
TraceAttrId taid
Definition: vsp_trace.h:231
Definition: trace_file.h:15
unsigned offset
Definition: vsp_trace.h:244
TraceAttrId taid
Definition: vsp_trace.h:243
Definition: vsp_trace.h:240
Definition: vsp_trace.h:228
unsigned dim
Definition: vsp_trace.h:246
TaidType type
Definition: vsp_trace.h:245