4 /* http://www.ncdc.noaa.gov/oa/radar/leveliidoc.html */
10 } __attribute__ ((packed)) level2_header_t;
14 * Channel Terminal Manager:
16 * Archive II (the data tape) is a copy of messages or data packets
17 * prepared for transmission from the RDA to the RPG. CTM information
18 * is attached to a message or data packet for checking data integrity
19 * during the transmission process and is of no importance to the base
20 * data (omit or read past these bytes).
22 short ctm[6]; // ignore
27 * This information is used to identify either base data or one of
28 * thirteen types of messages that may follow in bytes 28 - 2431. This
29 * header includes the information indicated below:
31 // Message size in halfwords measure from this halfword to the end of
36 // 0 = Non-Redundant Site
37 // 1 = Redundant Site Channel 1
38 // 2 = Redundant Site Channel 2
41 // Message type, where:
42 // 1 = DIGITAL RADAR DATA (This message may contain a combination of
43 // either reflectivity, aliased velocity, or spectrum width)
44 // 2 = RDA STATUS DATA.
45 // 3 = PERFORMANCE/MAINTENANCE DATA.
46 // 4 = CONSOLE MESSAGE - RDA TO RPG.
47 // 5 = MAINTENANCE LOG DATA.
48 // 6 = RDA CONTROL COMMANDS.
49 // 7 = VOLUME COVERAGE PATTERN.
50 // 8 = CLUTTER CENSOR ZONES.
51 // 9 = REQUEST FOR DATA.
52 // 10 = CONSOLE MESSAGE - RPG TO RDA.
53 // 11 = LOOP BACK TEST - RDA TO RPG.
54 // 12 = LOOP BACK TEST - RPG TO RDA.
55 // 13 = CLUTTER FILTER BYPASS MAP - RDA to RPG.
56 // 14 = EDITED CLUTTER FILTER BYPASS MAP - RPG to RDA.
59 // I.D. Sequence = 0 to 7FFF, then roll over back to 0.
62 // Modified Julian date starting from 1/1/70
63 unsigned short gen_date;
65 // Generation time of messages in milliseconds of day past midnight
66 // (UTC). This time may be different than time listed in halfwords
67 // 15-16 defined below.
68 unsigned int gen_time;
70 // Number of message segments. Messages larger than message size
71 // (halfword 7 defined above) are segmented and recorded in separate
73 unsigned short num_seg;
75 // Message segment number.
79 * Digital Radar Data Header:
81 * This information describes the date, time, azimuth, elevation, and
82 * type of base data included in the radial. This header includes the
83 * following information:
85 // Collection time for this radial in milliseconds of the day from
87 unsigned int coll_time;
89 // Modified Julian date referenced from 1/1/70.
90 unsigned short coll_date;
92 // Unambiguous range (scaled: Value/10. = KM).
95 // Azimuth angle (coded: [Value/8.]*[180./4096.] = DEG). An azimuth of
96 // "0 degrees" points to true north while "90 degrees" points east.
97 // Rotation is always clockwise as viewed from above the radar.
100 // Radial number within the elevation scan.
101 unsigned short radial;
103 // Radial status where:
104 // 0 = START OF NEW ELEVATION.
105 // 1 = INTERMEDIATE RADIAL.
106 // 2 = END OF ELEVATION.
107 // 3 = BEGINNING OF VOLUME SCAN.
108 // 4 = END OF VOLUME SCAN.
109 unsigned short rad_status;
111 // Elevation angle (coded:[Value/8.]*[180./4096.] = DEG). An elevation
112 // of "0 degree" is parallel to the pedestal base while "90 degrees" is
113 // perpendicular to the pedestal base.
114 unsigned short elev_angle;
116 // RDA elevation number within the volume scan.
117 unsigned short elev_num;
119 // Range to first gate of reflectivity data (METERS). Range may be
120 // negative to account for system delays in transmitter and/or receiver
124 // Range to first gate of Doppler data. Doppler data - velocity and
125 // spectrum width (METERS). Range may be negative to account for
126 // system delays in transmitter and/or receiver components.
129 // Reflectivity data gate size (METERS).
130 unsigned short refl_size;
132 // Doppler data gate size (METERS).
133 unsigned short dopp_size;
135 // Number of reflectivity gates.
136 unsigned short num_refl_gate;
138 // Number of velocity and/or spectrum width data gates.
139 unsigned short num_dopp_gate;
141 // Sector number within cut.
142 unsigned short sector;
144 // System gain calibration constant (dB biased).
147 // Reflectivity data pointer (byte # from the start of digital radar
148 // data message header). This pointer locates the beginning of
149 // reflectivity data.
150 unsigned short refl_ptr;
152 // Velocity data pointer (byte # from the start of digital radar data
153 // message header). This pointer locates beginning of velocity data.
154 unsigned short vel_ptr;
156 // Spectrum-width pointer (byte # from the start of digital radar data
157 // message header). This pointer locates beginning of spectrum-width
159 unsigned short spec_ptr;
161 // Doppler velocity resolution.
162 // Value of: 2 = 0.5 m/s
164 unsigned short dopp_res;
166 // Volume coverage pattern.
167 // Value of: 11 = 16 elev. scans/ 5 mins.
168 // 21 = 11 elev. scans/ 6 mins.
169 // 31 = 8 elev. scans/ 10 mins.
170 // 32 = 7 elev. scans/ 10 mins.
171 unsigned short pattern;
173 // Unused. Reserved for V&V Simulator.
176 // Reflectivity data pointer for Archive II playback. Archive II
177 // playback pointer used exclusively by RDA.
178 unsigned short refl_ptr_rda;
180 // Velocity data pointer for Archive II playback. Archive II playback
181 // pointer used exclusively by RDA.
182 unsigned short vel_ptr_rda;
184 // Spectrum-width data pointer for Archive II playback. Archive II
185 // playback pointer used exclusively by RDA.
186 unsigned short spec_ptr_rda;
188 // Nyquist velocity (scaled: Value/100. = M/S).
189 unsigned short nyquist;
191 // Atmospheric attenuation factor (scaled: [Value/1000. = dB/KM]).
192 unsigned short atten;
194 // Threshold parameter for minimum difference in echo power between two
195 // resolution volumes for them not to be labeled range ambiguous
196 // (i.e.,overlaid) [Value/10. = Watts].
205 * This information includes the three base data moments; reflectivity,
206 * velocity and spectrum width. Depending on the collection method, up
207 * to three base data moments may exist in this section of the packet.
208 * (For this example, only reflectivity is present.) Base data is coded
209 * and placed in a single byte and is archived in the following format:
211 // A bit confsued by these docs.
212 // Note: Need to check size field to get correct size.
213 unsigned char data[2300];
215 // Reflectivity data (0 - 460 gates) (coded: [((Value-2)/2.)-32. =
216 // dBZ], for Value of 0 or 1 see note below).
217 //unsigned char refl[460];
219 // Doppler velocity data (coded: for doppler velocity resolution of 0.5
220 // M/S, [((Value-2)/2.)-63.5 = M/S]; for doppler resolution of 1.0 M/S,
221 // [(Value-2)-127.] = M/S], for Value of 0 or 1 see note below), (0 -
222 // 92 gates). Starting data location depends on length of the
223 // reflectivity field, stop location depends on length of the velocity
224 // field. Velocity data is range unambiguous out to 230 KM.
225 //unsigned char vel[920];
227 // Doppler spectrum width (coded: [((Value - 2)/2.)-63.5 = M/S], for
228 // Value of 0 or 1 see note below), (0 - 920 gates). Starting data
229 // location depends on length of the reflectivity and velocity fields,
230 // stop location depends on length of the spectrum width field.
231 // Spectrum width is range unambiguous out to 230 KM.
232 //unsigned char spec[920];
234 // Four bytes of trailer characters referred to the Frame Check
235 // Sequence (FCS) follow the data. In cases where the three moments are
236 // not all present or the number of gates for each moment have been
237 // reduced, the record is padded out to a constant size of 1216
238 // halfwords (2432 bytes) following the trailer characters.
240 } __attribute__ ((packed)) level2_packet_t;