-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoga.h
346 lines (288 loc) · 10.2 KB
/
toga.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
/* Darwin data structures and parameters
*
* Dennis Flanigan, Jr.
* Applied Research Corp.
* NASA GSFC Code 910.1
*
*
* added tg_file_str structure 09 Jun 93 ...Mike
*
* updated with new tg_ray_data structure 5/6/93 ...Mike
* This structure is intended to supercede rp_ray
*
* updated for use with libtg 8/13/92
*
* updated 7/13/92
*
* 12/31/91
*
*
*/
#define TG_OK 0
#define TG_SYS_ERR -1
#define TG_END_RAY -2
#define TG_END_DATA -3
#define TG_REC_NOSEQ -4
#define TG_RAY_NOTYPE -5
#define TG_RAY_READ_ERR -6
#define TG_HDSIZE 1280
#define TG_RECSIZE 4096
#define TG_ANT_PPI 1
#define TG_ANT_RHI 2
#define TG_ANT_MAN 3
#define TG_ANT_FIL 4
/* field indices for tg_ray_data.da_inv */
#define TG_DM_IND 0 /* uncorrected reflectivity */
#define TG_DZ_IND 1 /* corrected reflectivity */
#define TG_VR_IND 2 /* radial velocity */
#define TG_SW_IND 3 /* spectral width */
/* missing data flag */
#define TG_NO_DATA 0x1000
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
/****** rp_ray is the old, outdated structure in which to
store (toga format-encoded) ray data. I have removed references
to it in the toga library libtg.a .
Use instead the tg_ray_data structure below, in which decoded
ray data is stored....Mike */
typedef struct
{
float elev;
float azm;
short bin[1800]; /* raw (encoded) ray data in toga format */
}
rp_ray;
typedef struct
{
float azm; /* azimuth angle */
float elev; /* elevation angle */
/* time */ /* time of some sort (not done yet) */
int da_inv[4]; /* data inventory */
short num_bins[4]; /* number of bins */
float start_km[4]; /* start range of data in km*/
float interval_km[4]; /* interval of range bins in km */
float data[4][1024]; /* real value data */
}
tg_ray_data;
typedef struct
{
short axrat; /* axial ratio in signed hundredths */
short ort_hor; /* orientation ccw of horizontal in degrees */
short pw_div_bits; /* power divider bits (A) in low 7 bits */
short delay_bits; /* delay bits (P) in low 7 bits */
}
tg_tran_pol_str;
typedef struct
{
/* storm id : word 1*/
short strm_year;
short strm_mon;
short strm_day;
short strm_num;
short map_num;
/* time of start of scan : word 6*/
short scan_year;
short scan_mon;
short scan_day;
short scan_hour;
short scan_min;
short scan_sec;
/* word 12 */
short data_set;
/* transmit polarization 1.1 : word 13*/
short tp1_ar;
short tp1_occw;
short tp1_dibit;
short tp1_debit;
/* transmit polarization 1.2 : word 17*/
short tp2_ar;
short tp2_occw;
short tp2_dibit;
short tp2_debit;
/* status bits : word 21*/
short status;
/* word 22 */
short strng; /* start range */
short numbin; /* number of data bins */
short rnginc; /* range increment between bins */
short rngjit; /* range jitter boollean */
short numcbin; /* number of range cal bins */
short strtcal1; /* start range of cal bins #1 */
short strtcal2; /* start range if cak bubs #2 */
short stepcal; /* step between cal bins 1 & 3 and 2 & 4 */
short azmleft; /* azimuth left, min azimuth */
short azmrght; /* azimuth right, max azimuth */
short elev_low; /* elevation low */
short elev_hgh; /* elevation high */
/* word 34 */
short at_angres; /* attempted angular res */
short numfix_ang; /* num fixed angles used */
short angfix[20]; /* angles used for fixed coordinate */
/* word 56 */
short rlparm; /* real time display parameters */
short signois; /* signal to noise threshold */
short sigcltr; /* signal to clutter threshold */
short thrsh_flg; /* threshold flags */
/* word 60 */
short numdsp; /* number of doppler signal processors working */
short numwrd; /* number of words which are difined in ray header */
/* word 62 */
short scanmod; /* scan mode */
char filename[16]; /* file name if scan mode is file (value 4)*/
/* word 71 */
short prf; /* prf */
short transiz; /* number of samp per proc interval (transform size) */
short spconf; /* signal processor configuration */
/* word 74 */
short sufchar; /* suffix character of data base directory */
/* word 75 */
short recsat1; /* receiver saturation or */
short recsat2; /* 0 if standard rang-dependent STC was used */
/*words 77 to 88 : bias levels set to zeor if not applicable */
/* word 77 */
short dsp1cor_log; /* co rec dsp 1, log rec noise level */
short dsp1cor_iad; /* co rec dsp 1, "I" a/d offset */
short dsp1cor_qad; /* co rec dsp 1, "Q" a/d offset */
/* word 80 */
short dsp1crr_log; /* cross rec dsp 1, log rec noise level */
short dsp1crr_iad; /* cross rec dsp 1, "I" a/d offset */
short dsp1crr_qad; /* cross rec dsp 1, "Q" a/d offset */
/* word 83 */
short dsp2cor_log; /* co rec dsp 2, log rec noise level */
short dsp2cor_iad; /* co rec dsp 2, "I" a/d offset */
short dsp2cor_qad; /* co rec dsp 2, "Q" a/d offset */
/* word 86 */
short dsp2crr_log; /* cross rec dsp 2, log rec noise level */
short dsp2crr_iad; /* cross rec dsp 2, "I" a/d offset */
short dsp2crr_qad; /* cross rec dsp 2, "Q" a/d offset */
/* word 89 */
short wavelen; /* wavelength in hundredths of cm */
short pulsewd; /* pulse width in hundredths of microsec. */
short hortran_pow; /* horizontal transmit power */
short vertran_pow; /* vertical transmit power */
/* word 93 */
short high_zero; /* height of zeroing in kilomiters */
short sitelat; /* latitude in .01 deg (if zero see words 108-111)*/
short sitelong; /* longitude in .01 deg (if zero see words 108-111)*/
short time_zone; /* time zone of rec time, minutes ahead of GMT */
/* word 97 */
short zm_dsp1_mas; /* Z slope, dsp 1, master board */
short zm_dsp1_slv; /* Z slope, dsp 1, slave board */
short zm_dsp2_mas; /* Z slope, dsp 2, master board */
short zm_dsp2_slv; /* Z slope, dsp 2, slave board */
/* word 101 */
short minz_dsp1_mas; /* minimum detectable Z, dsp 1, master */
short minz_dsp1_slv; /* minimum detectable Z, dsp 1, slave */
short minz_dsp2_mas; /* minimum detectable Z, dsp 2, master */
short minz_dsp2_slv; /* minimum detectable Z, dsp 2, slave */
/* word 105 */
short num_pol; /* number of polarization pairs used above 1 */
/* word 106 */
short exinfo_rayhd; /* extra information in ray header */
/* bit 0 : IFF data available */
/* bit 1 : roll available */
/* bit 2 : pitch available */
/* bit 3 : heading available */
/* word 107 */
short len_exhd; /* length of extended ray header ( 0 means 20 words) */
/* word 108 */
short lat_deg; /* latitude degrees */
short lat_hun_min; /* latitude in .01 minutes */
short lon_deg; /* longitude degrees */
short lon_hun_min; /* longitude in .01 minutes */
/* word 112 */
short alt_atn; /* altitude of antenna in meters above sea level*/
short alt_grn; /* altitude of ground at radar site in meters */
/* word 114 */
short vel_plat; /* speed of platform from senser in .01 meters/sec */
short vel_cor; /* velocity value loaded into dsp for vel correction */
short head_plat; /* heading of platform from sensor in .1 degrees */
short head_dsp; /* heading loaded into dsp */
/* word 118 */
short set_plat; /* set of platform (signed 1/10 degrees) */
short drift_plat; /* drift of platform (1/100 meters per sec */
short ok_plat; /* ok flags for words 108 to 120 */
/* bit 0: navigator input ok */
/* bit 1: navigator used for lat, long */
/* bit 2: navigator used for altitude */
/* bit 3: navigator used for speed and heading */
/* bit 4: mavigator used for set and drift */
/* word 121 */
short spare121[79];
/* word 200 */
tg_tran_pol_str tp21; /* transmit polarization 2.1 */
tg_tran_pol_str tp22; /* transmit polarization 2.2 */
/* word 208 */
tg_tran_pol_str tp31; /* transmit polarization 3.1 */
tg_tran_pol_str tp32; /* transmit polarization 3.2 */
/* word 216 */
tg_tran_pol_str tp41; /* transmit polarization 4.1 */
tg_tran_pol_str tp42; /* transmit polarization 4.2 */
/* word 224 */
tg_tran_pol_str tp51; /* transmit polarization 5.1 */
tg_tran_pol_str tp52; /* transmit polarization 5.2 */
/* word 232 */
tg_tran_pol_str tp61; /* transmit polarization 6.1 */
tg_tran_pol_str tp62; /* transmit polarization 6.2 */
/* word 240 */
tg_tran_pol_str tp71; /* transmit polarization 7.1 */
tg_tran_pol_str tp72; /* transmit polarization 7.2 */
/* word 248 */
tg_tran_pol_str tp81; /* transmit polarization 8.1 */
tg_tran_pol_str tp82; /* transmit polarization 8.2 */
/* word 255 */
short spare255[55];
/* word 301 */
char comments[680];
}
tg_map_head_str;
typedef struct
{
short first_ray;
short rec_num;
short rec_bol;
short res1;
short data[2044];
}
tg_data_rec_str;
typedef struct
{
short azm;
short elev;
short year;
short mon;
short day;
short hour;
short min;
short hunsec;
short tilt;
short step;
short type;
short strt_rng;
short srngkill;
short erngkill;
short spare[6];
}
tg_ray_head_str;
/* tg_file_str contains all info relevant to one open toga data file */
typedef struct
{
int fd;
int ray_num;
int swap_bytes;
short dec_buf[32768]; /*** Buffer and pointers for tg_read_map_bytes. */
int buf_ind;
int buf_end; /****************/
tg_data_rec_str recbuf; /*** buffer and indices for tg_read_rec_bytes. */
int first_rec;
int data_ind;
int recnum; /*************/
tg_map_head_str map_head;
tg_ray_head_str ray_head;
tg_ray_data ray;
}
tg_file_str;