This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
su.h
170 lines (153 loc) · 2.99 KB
/
su.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/*
* Copyright 2014-2015 Ian Liu Rodrigues <[email protected]>
*
* This file is part of CMP.
*
* CMP is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* CMP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CMP. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SU_H__
#define SU_H__
#include <stdio.h>
#define SU_HEADER_SIZE ((unsigned long)&(((su_trace_t*)0)->data))
typedef struct su_trace su_trace_t;
struct su_trace {
int tracl;
int tracr;
int fldr;
int tracf;
int ep;
int cdp;
int cdpt;
short trid;
short nvs;
short nhs;
short duse;
int offset;
int gelev;
int selev;
int sdepth;
int gdel;
int sdel;
int swdep;
int gwdep;
short scalel;
short scalco;
int sx;
int sy;
int gx;
int gy;
short counit;
short wevel;
short swevel;
short sut;
short gut;
short sstat;
short gstat;
short tstat;
short laga;
short lagb;
short delrt;
short muts;
short mute;
unsigned short ns;
unsigned short dt;
short gain;
short igc;
short igi;
short corr;
short sfs;
short sfe;
short slen;
short styp;
short stas;
short stae;
short tatyp;
short afilf;
short afils;
short nofilf;
short nofils;
short lcf;
short hcf;
short lcs;
short hcs;
short year;
short day;
short hour;
short minute;
short sec;
short timbas;
short trwf;
short grnors;
short grnofr;
short grnlof;
short gaps;
short otrav;
float d1;
float f1;
float d2;
float f2;
float ungpow;
float unscale;
int ntr;
short mark;
short shortpad;
short unass[14];
float *data;
};
/*
* This function allocates `tr->data' array based on `tr.ns', so must be
* already set!
*/
void su_init(su_trace_t *tr);
/*
* Frees internal structure.
*/
void su_free(su_trace_t *tr);
/*
* Reads a trace header and its data from `file'.
*/
int su_fgettr(FILE *file, su_trace_t *tr);
/*
* Reads a trace header and its data from `stdin'.
*/
int su_gettr(su_trace_t *tr);
/*
* Writes a trace header and its data to `file'.
*/
int su_fputtr(FILE *file, su_trace_t *tr);
/*
* Writes a trace header and its data to `stdout'.
*/
int su_puttr(su_trace_t *tr);
/*
* Returns the CDP key of `tr'.
*/
int su_get_cdp(su_trace_t *tr);
/*
* Returns the source position of `tr'.
*/
void su_get_source(su_trace_t *tr, float *sx, float *sy);
/*
* Returns the receiver position of `tr'.
*/
void su_get_receiver(su_trace_t *tr, float *gx, float *gy);
/*
* Returns the midpoint of `tr'.
*/
void su_get_midpoint(su_trace_t *tr, float *mx, float *my);
/*
* Returns the half offset of `tr'.
*/
void su_get_halfoffset(su_trace_t *tr, float *hx, float *hy);
#endif