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