1 //*******************************************************************
2 //
3 // License:  See top level LICENSE.txt file.
4 //
5 // Author:  Oscar Kramer
6 //
7 // Description:
8 //
9 // Class for reading CEOS-formatted metadata.
10 //
11 //*******************************************************************
12 //  $Id:$
13 #ifndef ossimCeosData_HEADER
14 #define ossimCeosData_HEADER
15 
16 #include <cstdio>
17 #include <iostream>
18 
19 #include <ossim/base/ossimFilename.h>
20 #include <ossim/base/ossimReferenced.h>
21 
22 struct desc_rec                  // Record description
23 {
24    ossim_int32   rec_seq;               // Record sequence number (B4)
25    ossim_uint8   rec_sub1;              // First record sub-type code (B1)
26    ossim_uint8   rec_type;              // Record type code (B1)
27    ossim_uint8   rec_sub2;              // Second record sub-type code (B1)
28    ossim_uint8   rec_sub3;              // Third record sub-type code (B1)
29    ossim_int32   length;                // Length of this record, bytes (B4)
30 };
31 
32 
33 struct vol_desc_rec              // Volume descriptor record
34 {
35    struct desc_rec desc;         // Record description
36    char   ascii_flag[2];         // ASCII flag (A2)
37    char   spare1[2];             // Unused (A2)
38    char   format_doc[12];        // Format control documentation (A12)
39    char   format_ver[2];         // Format doc version (A2)
40    char   format_rev[2];         // Format doc revision (A2)
41    char   software_id[12];       // Software identifier (A12)
42    char   phyvol_id[16];         // Physical volume identifier (A16)
43    char   logvol_id[16];         // Logical volume identifier (A16)
44    char   volset_id[16];         // Volume set identifier (A16)
45    char   phyvol_cnt[2];         // Total physical volume count (I2)
46    char   first_phyvol[2];       // Physical vol of first tape (I2)
47    char   last_phyvol[2];        // Physical vol of last tape (I2)
48    char   curr_phyvol[2];        // Physical vol of current tape (I2)
49    char   first_file[4];         // First file number in phyvol (I4)
50    char   volset_log[4];         // Logical volume within set (I4)
51    char   phyvol_log[4];         // Logical volume within phyvol (I4)
52    char   logvol_date[8];        // Logvol creation date (A8)
53    char   logvol_time[8];        // Logvol creation time (A8)
54    char   logvol_country[12];    // Logvol generation country (A12)
55    char   logvol_agency[8];      // Logvol generation agency (A8)
56    char   logvol_facility[12];   // Logvol generation facility (A12)
57    char   n_filepoint[4];        // Number of file pointer records (I4)
58    char   n_voldir[4];           // Number of voldir records (I4)
59    char   spare2[92];            // Unused (A92)
60    char   product_id[8];         // Product identifier (A8)
61    char   spare3[92];            // Local use segment (A92)
62 };
63 
64 
65 struct file_pntr_rec             // File pointer record
66 {
67    struct desc_rec desc;         // Record description
68    char   ascii_flag[2];         // ASCII flag (A2)
69    char   spare1[2];             // Unused (A2)
70    char   file_num[4];           // Referenced file number (I4)
71    char   file_name[16];         // Referenced file name (A16)
72    char   file_class[28];        // Referenced file class (A28)
73    char   file_code[4];          // Referenced file class code (A4)
74    char   data_type[28];         // Referenced file data type (A28)
75    char   data_code[4];          // Referenced file data type code (A4)
76    char   nrec[8];               // Referenced file record count (I8)
77    char   first_len[8];          // First record length, bytes (I8)
78    char   max_len[8];            // Maximum record length, bytes (I8)
79    char   len_type[12];          // Record length type (A12)
80    char   len_code[4];           // Record length type code (A4)
81    char   first_phyvol[2];       // First physical volume (I2)
82    char   last_phyvol[2];        // Last physical volume (I2)
83    char   first_rec[8];          // First phyvol record (I8)
84    char   last_rec[8];           // Last phyvol record (I8)
85    char   spare2[100];           // Unused (A100)
86    char   spare3[100];           // Unused (A100)
87 };
88 
89 
90 struct text_rec                  // Text record
91 {
92    struct desc_rec desc;         // Record description
93    char   ascii_flag[2];         // ASCII flag (A2)
94    char   cont_flag[2];          // Continuation flag (A2)
95    char   product_type[40];      // Product type specifier (A40)
96    char   product_create[60];    // Product creation info (A60)
97    char   phyvol_id[40];         // Physical volume identifier (A40)
98    char   scene_id[40];          // Scene identifier (A40)
99    char   scene_loc[40];         // Scene location (A40)
100    char   copyright_info[20];    // Unused (A20)
101    char   spare2[104];           // Unused (A104)
102 };
103 
104 
105 struct sar_desc_rec              // SAR leader/trailer descriptor
106 {
107    struct desc_rec desc;         // Record description
108    char   ascii_flag[2];         // ASCII flag (A2)
109    char   spare1[2];             // Unused (A2)
110    char   format_doc[12];        // Format control document (A12)
111    char   format_rev[2];         // Format document revision (A2)
112    char   design_rev[2];         // File design revision (A2)
113    char   software_id[12];       // Software identifier (A12)
114    char   file_num[4];           // File number (I4)
115    char   file_name[16];         // File name (A16)
116    char   rec_seq[4];            // Record sequence/location flag (A4)
117    char   seq_loc[8];            // Sequence number location (I8)
118    char   seq_len[4];            // Sequence number length (I4)
119    char   rec_code[4];           // Record code/location flag (A4)
120    char   code_loc[8];           // Record code location (I8)
121    char   code_len[4];           // Record code length (I4)
122    char   rec_len[4];            // Record length/location flag (A4)
123    char   rlen_loc[8];           // Record length location (I8)
124    char   rlen_len[4];           // Record length, bytes (I4)
125    char   spare2;                // Reserved (A1)
126    char   spare3;                // Reserved (A1)
127    char   spare4;                // Reserved (A1)
128    char   spare5;                // Reserved (A1)
129    char   spare6[64];            // Reserved segment (A64)
130    char   n_dataset[6];          // Number of dataset summary records (I6)
131    char   l_dataset[6];          // Data set summary record length, bytes (I6)
132    char   n_map_proj[6];         // Number of map proj records (I6)
133    char   l_map_proj[6];         // Map proj record length, bytes (I6)
134    char   n_plat_pos[6];         // Number of plat pos records (I6)
135    char   l_plat_pos[6];         // Plat pos record length, bytes (I6)
136    char   n_att_data[6];         // Number of att data records (I6)
137    char   l_att_data[6];         // Att data record length, bytes (I6)
138    char   n_radi_data[6];        // Number of radiometric data records (I6)
139    char   l_radi_data[6];        // Radi data record length, bytes (I6)
140    char   n_radi_comp[6];        // Number of radiometric compensation records (I6)
141    char   l_radi_comp[6];        // Radiometric compensation record length, bytes (I6)
142    char   n_qual_sum[6];         // Number of data qual sum records (I6)
143    char   l_qual_sum[6];         // Dat qual sum record length,bytes (I6)
144    char   n_data_hist[6];        // Number of data histogram records (I6)
145    char   l_data_hist[6];        // Data hist record length, bytes (I6)
146    char   n_rang_spec[6];        // Number of range spectra records (I6)
147    char   l_rang_spec[6];        // Range spectra record length, bytes (I6)
148    char   n_dem_desc[6];         // Number of DEM descriptor records (I6)
149    char   l_dem_desc[6];         // DEM desc record length, bytes (I6)
150    char   n_radar_par[6];        // Number of RADAR par records (I6)
151    char   l_radar_par[6];        // RADAR par record length, bytes (I6)
152    char   n_anno_data[6];        // Number of annotation data records (I6)
153    char   l_anno_data[6];        // Annotation data record length, bytes (I6)
154    char   n_det_proc[6];         // Number of processing parameter records (I6)
155    char   l_det_proc[6];         // Processing parameter record length, bytes (I6)
156    char   n_cal[6];              // Number of calibration records (I6)
157    char   l_cal[6];              // Calibration record length, bytes (I6)
158    char   n_gcp[6];              // Number of GCP records (I6)
159    char   l_gcp[6];              // GCP record length, bytes (I6)
160    char   spare7[10][6];         // Unused (I6)
161    char   n_fac_data[6];         // Number of facility data records (I6)
162    char   l_fac_data[6];         // Fac data record length, bytes (I6)
163    char   spare8[288];           // Unused (A288)
164 };
165 
166 
167 struct dataset_sum_rec           // Data set summary record
168 {
169    struct desc_rec desc;         // Record description
170    char   seq_num[4];            // Sequence number (I4)
171    char   sar_chn[4];            // SAR channel indicator (I4)
172    char   scene_id[16];          // Scene identifier (A16)
173    char   scene_des[32];         // Scene designator (A32)
174    char   inp_sctim[32];         // Input scene centre time (A32)
175    char   asc_des[16];           // Ascending/descending (A16)
176    char   pro_lat[16];           // Processed scene centre latitude (F16.7)
177    char   pro_long[16];          // Processed scene centre longitude (F16.7)
178    char   pro_head[16];          // Processed scene centre headng (F16.7)
179    char   ellip_des[16];         // Ellipsoid designator (A16)
180    char   ellip_maj[16];         // Ellipsoid semi-major axis, km (F16.7)
181    char   ellip_min[16];         // Ellipsoid semi_minor axis, km (F16.7)
182    char   earth_mass[16];        // Earth's mass (E16.7)
183    char   grav_const[16];        // Gravitational constant (E16.7)
184    char   ellip_j[3][16];        // Ellipsoid J2-4 parameters (E16.7)
185    char   spare1[16];            // Unused (A16)
186    char   terrain_h[16];         // Average terrain height, km (F16.7)
187    char   sc_lin[8];             // Scene centre line number (I8)
188    char   sc_pix[8];             // Scene centre pixel number (I8)
189    char   scene_len[16];         // Scene length, km (F16.7)
190    char   scene_wid[16];         // Scene width, km (F16.7)
191    char   spare2[16];            // Unused (A16)
192    char   nchn[4];               // Number of SAR channels (I4)
193    char   spare3[4];             // Unused (A4)
194    char   mission_id[16];        // Mission identifier (A16)
195    char   sensor_id[32];         // Sensor identifier (A32)
196    char   orbit_num[8];          // Orbit number (A8)
197    char   plat_lat[8];           // Platform geodetic latitude (F8.3)
198    char   plat_long[8];          // Platform geodetic longitude (F8.3)
199    char   plat_head[8];          // Platform heading (F8.3)
200    char   clock_ang[8];          // Sensor clock angle (F8.3)
201    char   incident_ang[8];       // Incidence angle (F8.3)
202    char   spare4[8];             // Unused (A8)
203    char   wave_length[16];       // Radar wave length (F16.7)
204    char   motion_comp[2];        // Motion compensation indicator (A2)
205    char   pulse_code[16];        // Range pulse code specifier (A16)
206    char   ampl_coef[5][16];      // Range chirp coefficients (E16.7)
207    char   phas_coef[5][16];      // Range phase coefficients (E16.7)
208    char   chirp_ext_ind[8];      // Chirp extraction index (I8)
209    char   spare5[8];             // Unused (A8)
210    char   fr[16];                // Range sampling rate (F16.7)
211    char   rng_gate[16];          // Range gate start time (F16.7)
212    char   rng_length[16];        // Range pulse length (F16.7)
213    char   baseband_f[4];         // Baseband conversion flag (A4)
214    char   rngcmp_f[4];           // Range compressed flag (A4)
215    char   gn_polar[16];          // Like polarized gain (F16.7)
216    char   gn_cross[16];          // Cross polarized gain (F16.7)
217    char   chn_bits[8];           // Number of bits per channel (I8)
218    char   quant_desc[12];        // Quantization descriptor (A12)
219    char   i_bias[16];            // I channel DC bias (F16.7)
220    char   q_bias[16];            // Q channel DC bias (F16.7)
221    char   iq_ratio[16];          // I/Q channel ratio (F16.7)
222    char   spare6[16];            // Unused (F16.7)
223    char   spare7[16];            // Unused (F16.7)
224    char   ele_sight[16];         // Electronic boresight (F16.7)
225    char   mech_sight[16];        // Mechanical boresight (F16.7)
226    char   echo_track[4];         // Echo tracker on/off flag (A4)
227    char   fa[16];                // Nominal PRF, Hz (F16.7)
228    char   elev_beam[16];         // Elevation beamwidth (F16.7)
229    char   azim_beam[16];         // Azimuth beamwidth (F16.7)
230    char   sat_bintim[16];        // Satellite binary time (I16)
231    char   sat_clktim[32];        // Satellite clock time (I32)
232    char   sat_clkinc[8];         // Satellite clock increment (I8)
233    char   spare8[8];             // Unused (A8)
234    char   fac_id[16];            // Processing facility identifier (A16)
235    char   sys_id[8];             // Processing system identifier (A8)
236    char   ver_id[8];             // Processing version identifier (A8)
237    char   fac_code[16];          // Facility process code (A16)
238    char   lev_code[16];          // Product level code (A16)
239    char   prod_type[32];         // Product type specifier (A32)
240    char   algor_id[32];          // Processing algorithm identifier (A32)
241    char   n_azilok[16];          // Number of azimuth looks (F16.7)
242    char   n_rnglok[16];          // Number of range looks (F16.7)
243    char   bnd_azilok[16];        // Bandwidth per look in azimuth,Hz (F16.7)
244    char   bnd_rnglok[16];        // Bandwidth per look in range,Hz (F16.7)
245    char   bnd_azi[16];           // Total azimuth look bandwidth (F16.7)
246    char   bnd_rng[16];           // Total range look bandwidth (F16.7)
247    char   azi_weight[32];        // Azimuth weighting designator (A32)
248    char   rng_weight[32];        // Range weighting designator (A32)
249    char   data_inpsrc[16];       // Data input source (A16)
250    char   rng_res[16];           // Range resolution, meter (F16.7)
251    char   azi_res[16];           // Azimuth resolution, meter (F16.7)
252    char   radi_stretch[2][16];   // Radiometric stretch terms (F16.7)
253    char   alt_dopcen[3][16];     // Along track Doppler frequency terms (E16.7)
254    char   spare9[16];            // Unused (A16)
255    char   crt_dopcen[3][16];     // Cross track Doppler frequency terms (E16.7)
256    char   time_dir_pix[8];       // Pixel time direction indicator (A8)
257    char   time_dir_lin[8];       // Line time direction indicator (A8)
258    char   alt_rate[3][16];       // Along track Doppler rate term (E16.7)
259    char   spare10[16];           // Unused (A16)
260    char   crt_rate[3][16];       // Cross track Doppler rate term (E16.7)
261    char   spare11[16];           // Unused (A16)
262    char   line_cont[8];          // Line content indicator (A8)
263    char   clutter_lock[4];       // Clutter lock applied flag (A4)
264    char   auto_focus[4];         // Auto-focus applied flag (A4)
265    char   line_spacing[16];      // Line spacing, meters (F16.7)
266    char   pix_spacing[16];       // Pixel spacing, meters (F16.7)
267    char   rngcmp_desg[16];       // Range compression designator (A16)
268    char   spare12[2362];         // Unused (A2362)
269 };
270 
271 
272 struct rad_unc_rec               // Radiometric uncertainty record
273 {
274    char   db[16];                // Units of db (F16.7)
275    char   deg[16];               // Units of deg (F16.7)
276 };
277 
278 struct misreg_rec                // Misregistration record
279 {
280    char   alt_m[16];             // Nominal along track misregistration (F16.7)
281    char   crt_m[16];             // Nominal cross track misregistration (F16.7)
282 };
283 
284 struct qual_sum_rec              // Data quality summary record
285 {
286    struct desc_rec desc;         // Record description
287    char   rec_seq[4];            // Record sequence number (I4)
288    char   sar_chn[4];            // SAR channel indicator (A4)
289    char   cali_date[6];          // Calibration update date (A6)
290    char   nchn[4];               // Number of channels (I4)
291    char   islr[16];              // Nominal integrated side lobe ratio (F16.7)
292    char   pslr[16];              // Nominal peak side lobe ratio (F16.7)
293    char   azi_ambig[16];         // Nominal azimuth ambiguity (F16.7)
294    char   rng_ambig[16];         // Nominal range ambiguity (F16.7)
295    char   snr[16];               // Nominal signal to noise ratio (F16.7)
296    char   ber[16];               // Nominal bit error rate (F16.7)
297    char   rng_res[16];           // Nominal slant range resolution (F16.7)
298    char   azi_res[16];           // Nominal azimuth resolution,meter (F16.7)
299    char   rad_res[16];           // Nominal radiometric resolution,dB (F16.7)
300    char   dyn_rng[16];           // Instantaneous dynamic range (F16.7)
301    char   rad_unc_db[16];        // Nominal radiometric uncertainty,dB (F16.7)
302    char   rad_unc_deg[16];       // Nominal Radiometric uncertainty,deg (F16.7)
303    struct rad_unc_rec rad_unc[16];   // Radiometric data quality
304    char   alt_locerr[16];        // Nominal along track location error (F16.7)
305    char   crt_locerr[16];        // Nominal cross track location error (F16.7)
306    char   alt_scale[16];         // Nominal along track distortion scale (F16.7)
307    char   crt_scale[16];         // Nominal cross track distortion scale (F16.7)
308    char   dis_skew[16];          // Nominal distortion skew (F16.7)
309    char   ori_err[16];           // Nominal Scene orientation error (F16.7)
310    struct misreg_rec misreg[16]; // Misregistration error
311    char   nesz[16];              // Nominal noise equivalent sigma zero (F16.7)
312    char   enl[16];               // Nominal equivalent number of looks (F16.7)
313    char   tb_update[8];          // Default parameters table update date (A8)
314    char   spare[238];            // Unused (A238)
315 };
316 
317 
318 struct sdr_htab_rec              // Histogram table record
319 {
320    char   hist_desc[32];         // Histogram descriptor (A32)
321    char   nrec[4];               // Records per table (I4)
322    char   tab_seq[4];            // Table sequence number (I4)
323    char   nbin[8];               // Total number of table bins (I8)
324    char   ns_lin[8];             // Total number of lines (I8)
325    char   ns_pix[8];             // Total number of pixels per line (I8)
326    char   ngrp_lin[8];           // Group size along line axis (I8)
327    char   ngrp_pix[8];           // Group size along pixel axis (I8)
328    char   nsamp_lin[8];          // Number of samples used per group along line axis (I8)
329    char   nsamp_pix[8];          // Number of samples used per group along pixel (I8)
330    char   min_smp[16];           // Minimum first bin (E16.7)
331    char   max_smp[16];           // Maximum last bin (E16.7)
332    char   mean_smp[16];          // Mean sample value (E16.7)
333    char   std_smp[16];           // Sample standard deviation (E16.7)
334    char   smp_inc[16];           // Sample value increment (E16.7)
335    char   min_hist[16];          // Minimum histogram value (E16.7)
336    char   max_hist[16];          // Maximum histogram value (E16.7)
337    char   mean_hist[16];         // Histogram mean value (E16.7)
338    char   std_hist[16];          // Histogram standard deviation (E16.7)
339    char   nhist[8];              // Histogram table size (I8)
340    char   hist[256][8];          // 256 histogram table values of 16 bins
341    //   I x 16 bins Q (I8)
342 };
343 
344 struct sdr_hist_rec              // Data histogram record
345 {
346    struct desc_rec desc;         // Record description
347    char   rec_seq[4];            // Record sequence number (I4)
348    char   sar_chn[4];            // SAR channel number (I4)
349    char   ntab[8];               // Number of histogram table data sets in this record (I8)
350    char   ltab[8];               // Histogram table data set size (I8)
351    struct sdr_htab_rec htab;     // Histogram tables
352    char   spare[14588];          // Unused (A14588)
353 };
354 
355 
356 struct pdr16_htab_rec            // Histogram table record
357 {
358    char   hist_desc[32];         // Histogram descriptor (A32)
359    char   nrec[4];               // Records per table (I4)
360    char   tab_seq[4];            // Table sequence number (I4)
361    char   nbin[8];               // Total number of table bins (I8)
362    char   ns_lin[8];             // Total number of lines n (I8)
363    char   ns_pix[8];             // Total number of pixels per line (I8)
364    char   ngrp_lin[8];           // Group size along line axis (I8)
365    char   ngrp_pix[8];           // Group size along pixel axis (I8)
366    char   nsamp_lin[8];          // Number of samples used per group along line axis (I8)
367    char   nsamp_pix[8];          // Number of samples used per group along pixel (I8)
368    char   min_smp[16];           // Minimum first bin (E16.7)
369    char   max_smp[16];           // Maximum last bin (E16.7)
370    char   mean_smp[16];          // Mean sample value (E16.7)
371    char   std_smp[16];           // Sample standard deviation (E16.7)
372    char   smp_inc[16];           // Sample value increment (E16.7)
373    char   min_hist[16];          // Minimum histogram value (E16.7)
374    char   max_hist[16];          // Maximum histogram value (E16.7)
375    char   mean_hist[16];         // Histogram mean value (E16.7)
376    char   std_hist[16];          // Histogram standard deviation (E16.7)
377    char   nhist[8];              // Histogram table size (I8)
378    char   hist[1024][8];         // 1024 histogram table values for 1024 bins
379    // (I8)
380 };
381 
382 struct pdr16_hist_rec            // Data histogram record
383 {
384    struct desc_rec desc;         // Record description
385    char   rec_seq[4];            // Record sequence number (I4)
386    char   sar_chn[4];            // SAR channel number (I4)
387    char   ntab[8];               // Number of histogram table data sets in this record (I8)
388    char   ltab[8];               // Histogram table data set size (I8)
389    struct pdr16_htab_rec htab[2];// Histogram tables
390    char   spare[3];              // Unused (A3)
391 };
392 
393 
394 struct pix_count_rec             // Beam pixel count record
395 {
396    char   pix_update[21];        // Pixel count update date/time (A21)
397    char   n_pix[4][8];           // Count of image pixels in beams (4I8)
398 };
399 
400 struct beam_info_rec             // Beam information record
401 {
402    char   beam_type[3];          // Beam type (A3)
403    char   beam_look_src[9];      // Elevation beam look angle source (A9)
404    char   beam_look_ang[16];     // Applied elevation beam look angle (deg) (F16.7)
405    char   prf[16];               // Actual PRF (Hz) (F16.7)
406 };
407 
408 struct temp_rec                  // Temperature settings record
409 {
410    char   temp_set[4][4];        // Temperature settings (4I4)
411 };
412 
413 struct dopcen_est_rec
414 {
415    char   dopcen_conf[16];       // Doppler centroid confidence measure (F16.7)
416    char   dopcen_ref_tim[16];    // Doppler centroid reference time (sec) (F16.7)
417    char   dopcen_coef[4][16];    // Doppler centroid coefficients (4F16.7)
418 };
419 
420 struct srgr_coefset_rec
421 {
422    char   srgr_update[21];       // SRGR update date/time (A21)
423    char   srgr_coef[6][16];      // SRGR coefficients (6F16.7)
424 };
425 
426 struct proc_parm_rec             // Detailed processing parameters record
427 {
428    struct desc_rec desc;         // Record description
429    char   rec_seq[4];            // Record sequence number (I4)
430    char   spare1[4];             // Unused (A4)
431    char   inp_media[3];          // Input media (A3)
432    char   n_tape_id[4];          // Number of tape input ids (I4)
433    char   tape_id[10][8];        // Tape identifiers (10A8)
434    char   exp_ing_start[21];     // Expected ingest start time (A21)
435    char   exp_ing_stop[21];      // Expected ingest stop time (A21)
436    char   act_ing_start[21];     // Actual ingest start time (A21)
437    char   act_ing_stop[21];      // Actual ingest stop time (A21)
438    char   proc_start[21];        // Processing start time (A21)
439    char   proc_stop[21];         // Processing stop time (A21)
440    char   mn_sig_lev[10][16];    // Mean signal levels across range (10F16.7)
441    char   scr_data_ind[4];       // Source data quality indicator (I4)
442    char   miss_ln[8];            // Number of missing lines (I8)
443    char   rej_ln[8];             // Number of rejected lines (I8)
444    char   large_gap[8];          // Number of time inconsistencies (large gaps) (I8)
445    char   bit_err_rate[16];      // Measured bit error rate (E16.7)
446    char   fm_crc_err[16];        // Percent of frames with CRC errors (E16.7)
447    char   date_incons[8];        // Number of date inconsistencies (I8)
448    char   prf_changes[8];        // Number of unexpected PRF changes (I8)
449    char   delay_changes[8];      // Number of delay changes (I8)
450    char   skipd_frams[8];        // Number of skipped frames (I8)
451    char   rej_bf_start[8];       // Range lines rejected before start time (I8)
452    char   rej_few_fram[8];       // Range lines rejected due to too few frames   (I8)
453    char   rej_many_fram[8];      // Range lines rejected due to too many frames   (I8)
454    char   rej_mchn_err[8];       // Frames rejected due to master channel error (I8)
455    char   rej_vchn_err[8];       // Frames rejected due to virtual channel error (I8)
456    char   rej_rec_type[8];       // Frames rejected due to incorrect recording type (I8)
457    char   sens_config[10];       // Sensor configuration (A10)
458    char   sens_orient[9];        // Sensor orientation (A9)
459    char   sych_marker[8];        // Frame synch marker (I8)
460    char   rng_ref_src[12];       // Range reference function source (A12)
461    char   rng_amp_coef[4][16];   // Range reference amplitude coefficients (4E16.7)
462    char   rng_phas_coef[4][16];  // Range reference phase coefficients (4E16.7)
463    char   err_amp_coef[4][16];   // Error function amplitude coefficients (4E16.7)
464    char   err_phas_coef[4][16];  // Error function phase coefficients (4E16.7)
465    char   pulse_bandw[4];        // Pulse bandwidth code (I4)
466    char   adc_samp_rate[5];      // ADC sampling rate (I5)
467    char   rep_agc_attn[16];      // Replica AGC attenuation (F16.7)
468    char   gn_corctn_fctr[16];    // Gain correction factor (dB) (F16.7)
469    char   rep_energy_gn[16];     // Replica energy gain correction (F16.7)
470    char   orb_data_src[11];      // Orbit data source (A11)
471    char   pulse_cnt_1[4];        // Pulse count 1 (I4)
472    char   pulse_cnt_2[4];        // Pulse count 2 (I4)
473    char   beam_edge_rqd[3];      // Beam edge detection requested (A3)
474    char   beam_edge_conf[16];    // Beam edge confidence measure (F16.7)
475    char   pix_overlap[4];        // Number of pixels in beam overlap (I4)
476    char   n_beams[4];            // Number of beams (I4)
477    struct beam_info_rec beam_info[4]; // Beam info
478    char   n_pix_updates[4];      // Number of pixel count updates (I4)
479    struct pix_count_rec pix_count[20];   // Beam pixel counts
480    char   pwin_start[16];        // Processing window start time (sec) (F16.7)
481    char   pwin_end[16];          // Processing window end time (sec) (F16.7)
482    char   recd_type[9];          // Recording type (A9)
483    char   temp_set_inc[16];      // Time increment between temperature settings (sec) (F16.7)
484    char   n_temp_set[4];         // Number of temperature settings (I4)
485    struct temp_rec temp[20];     // Temperature settings
486    char   n_image_pix[8];        // Number of image pixels (I8)
487    char   prc_zero_pix[16];      // Percent zero pixels (F16.7)
488    char   prc_satur_pix[16];     // Percent saturated pixels (F16.7)
489    char   img_hist_mean[16];     // Image histogram mean intensity (F16.7)
490    char   img_cumu_dist[3][16];  // Image cumulative distribution (3F16.7)
491    char   pre_img_gn[16];        // Pre-image calibration gain factor (F16.7)
492    char   post_img_gn[16];       // Post-image calibration gain factor (F16.7)
493    char   dopcen_inc[16];        // Time increment between Dopcen estimates (sec) (F16.7)
494    char   n_dopcen[4];           // Number of Doppler centroid estimates (I4)
495    struct dopcen_est_rec dopcen_est[20]; // Doppler centroid estimates
496    char   dop_amb_err[4];        // Doppler ambiguity error (I4)
497    char   dopamb_conf[16];       // Doppler ambiguity confidence measure (F16.7)
498    char   eph_orb_data[7][16];   // Ephemeris orbit data (7E16.7)
499    char   appl_type[12];         // Application type (A12)
500    char   slow_time_coef[5][22]; // Slow time coefficients (5D22.15)
501    char   n_srgr[4];             // Number of SRGR coefficient sets (I4)
502    struct srgr_coefset_rec srgr_coefset[20]; // SRGR coefficient sets
503    char   pixel_spacing[16];     // SGF product pixel spacing (F16.7)
504    char   gics_reqd[3];          // GICS product required (A3)
505    char   wo_number[8];          // Work order identifier (A8)
506    char   wo_date[20];           // Work order entry date (A20)
507    char   satellite_id[10];      // Satellite identifier (A10)
508    char   user_id[20];           // User id (A20)
509    char   complete_msg[3];       // Completion message required flag (A3)
510    char   scene_id[15];          // SGF product scene identifier (A15)
511    char   density_in[4];         // Density of SGF product media (A4)
512    char   media_id[8];           // SGF product identifier (A8)
513    char   angle_first[16];       // Incidence angle of first pixel in SGF product line (F16.7)
514    char   angle_last[16];        // Incidence angle of last pixel in SGF product line (F16.7)
515    char   prod_type[3];          // GICS output product type (A3)
516    char   map_system[16];        // Map system identifier (A16)
517    char   centre_lat[22];        // GICS output product scene centre latitude (D22.15)
518    char   centre_long[22];       // GICS output product scene centre longitude (D22.15)
519    char   span_x[22];            // GICS output product size - map eastings (km) (D22.15)
520    char   span_y[22];            // GICS output product size - map northings (km) (D22.15)
521    char   apply_dtm[3];          // DTM correction to be applied flag (A3)
522    char   density_out[4];        // GICS output product density (A4)
523    char   state_time[21];        // Time of the first state vector (A21)
524    char   num_state_vectors[4];  // Number of state vectors (I4)
525    char   state_time_inc[16];    // Time increment between state vectors (F16.7)
526    char   spare2[206];           // Unused (A207)
527 };
528 
529 
530 struct map_proj_rec              // Map projection data record
531 {
532    struct desc_rec desc;         // Record description
533    char   spare1[16];            // Unused (A16)
534    char   map_desc[32];          // Map projection descriptor (A32)
535    char   n_pixel[16];           // Pixels per line (I16)
536    char   n_line[16];            // Lines per processed band (I16)
537    char   pixel_spacing[16];     // Inter-pixel distance (F16.7)
538    char   line_spacing[16];      // Inter-line distance (F16.7)
539    char   osc_orient[16];        // Output scene cntr orientation (F16.7)
540    char   orb_incl[16];          // Orbital inclination (F16.7)
541    char   asc_node[16];          // Ascending node (F16.7)
542    char   isc_dist[16];          // Input scene cntr plat dist (F16.7)
543    char   geo_alt[16];           // Geodedic platform altitude (F16.7)
544    char   isc_vel[16];           // Ground speed at input scene (F16.7)
545    char   plat_head[16];         // Platform heading (F16.7)
546    char   ref_ellip[32];         // Reference ellipsoid name (A32)
547    char   semi_major[16];        // Ellipsoid semi-major axis (F16.7)
548    char   semi_minor[16];        // Ellipsoid semi-minor axis (F16.7)
549    char   datum_shift[3][16];    // Datum shift parameters (F16.7)
550    char   aux_datum_shift[3][16];// Aux datum shift parameters (F16.7)
551    char   scal_ellip[16];        // Ellisoid scale factor (F16.7)
552    char   proj_desc[32];         // Map projection description (A32)
553    char   utm_desc[32];          // UTM descriptor (A32)
554    char   utm_zone_sig[4];       // UTM zone signature (A4)
555    char   utm_east_orig[16];     // Map origin, false easting (F16.7)
556    char   utm_north_orig[16];    // Map origin, false northing (F16.7)
557    char   utm_cent_long[16];     // Projection centre longitude (F16.7)
558    char   utm_cent_lat[16];      // Projection centre latitude (F16.7)
559    char   utm_stand_par[2][16];  // Standard parallels (F16.7)
560    char   utm_scale[16];         // Scale factor (F16.7)
561    char   ups_desc[32];          // UPS descriptor (A32)
562    char   ups_cent_long[16];     // Projection centre longitude (F16.7)
563    char   ups_cent_lat[16];      // Projection centre latitude (F16.7)
564    char   ups_scale[16];         // Scale factor (F16.7)
565    char   nsp_desc[32];          // NSP descriptor (A32)
566    char   nsp_east_orig[16];     // Map origin, false easting (F16.7)
567    char   nsp_north_orig[16];    // Map origin, false northing (F16.7)
568    char   nsp_cent_long[16];     // Projection centre longitude (F16.7)
569    char   nsp_cent_lat[16];      // Projection centre latitude (F16.7)
570    char   nsp_stand_par[4][16];  // Standard parallels (F16.7)
571    char   nsp_stand_mer[3][16];  // Standard meridians (F16.7)
572    char   nsp_spare[4][16];      // Project dependent (4A16)
573    char   corner_ne[8][16];      // Corner northing/easting (F16.7)
574    char   corner_ll[8][16];      // Corner latitude/longitude (F16.7)
575    char   terr_height[4][16];    // Corner terrain height (F16.7)
576    char   lp_conv_coef[8][20];   // Line/pixel coefficients (E20.10)
577    char   mp_conv_coef[8][20];   // Map proj coefficients (E20.10)
578    char   dem_type[4];           // DEM type (A4)
579    char   spare3[32];            // Unused (A32)
580 };
581 
582 
583 struct pos_vect_rec              // Position vector record
584 {
585    char   pos[3][22];            // Data point position (D22.15)
586    char   vel[3][22];            // Data point velocity (D22.15)
587 };
588 
589 struct pos_data_rec               // Platform position data record
590 {
591    struct desc_rec desc;         // Record description
592    char   orbit_ele_desg[32];    // Orbital elements designator (A32)
593    char   orbit_ele[6][16];      // Orbital elements (F16.7)
594    char   ndata[4];              // Number of data points (I4)
595    char   year[4];               // Year of data point (I4)
596    char   month[4];              // Month of data point (I4)
597    char   day[4];                // Day of data point (I4)
598    char   gmt_day[4];            // Day of year (I4)
599    char   gmt_sec[22];           // Seconds of day (D22.15)
600    char   data_int[22];          // Data sampling interval (D22.15)
601    char   ref_coord[64];         // Reference coordinate system (A64)
602    char   hr_angle[22];          // Greenwich mean hour angle (D22.15)
603    char   alt_poserr[16];        // Along track position error (F16.7)
604    char   crt_poserr[16];        // Cross track position error (F16.7)
605    char   rad_poserr[16];        // Radial position error (F16.7)
606    char   alt_velerr[16];        // Along track velocity error (F16.7)
607    char   crt_velerr[16];        // Cross track velocity error (F16.7)
608    char   rad_velerr[16];        // Radial velocity error (F16.7)
609    struct pos_vect_rec pos_vect[64]; // Data point position/velocity
610    char   spare[126];            // Unused (A126)
611 };
612 
613 
614 struct att_vect_rec              // Attitude point record
615 {
616    char   gmt_day[4];            // Day of the year, GMT (I4)
617    char   gmt_sec[8];            // Milliseconds of day, GMT (I8)
618    char   pitch_flag[4];         // Pitch data quality flag (I4)
619    char   roll_flag[4];          // Roll data quality flag (I4)
620    char   yaw_flag[4];           // Yaw data quality flag (I4)
621    char   pitch[14];             // Pitch error, degrees (E14.6)
622    char   roll[14];              // Roll error, degrees (E14.6)
623    char   yaw[14];               // Yaw error, degrees (E14.6)
624    char   pitch_rate_flag[4];    // Pitch rate data quality flag (I4)
625    char   roll_rate_flag[4];     // Roll rate data quality flag (I4)
626    char   yaw_rate_flag[4];      // Yaw rate data quality flag (I4)
627    char   pitch_rate[14];        // Pitch rate, degrees/sec (E14.6)
628    char   roll_rate[14];         // Roll rate, degrees/sec (E14.6)
629    char   yaw_rate[14];          // Yaw rate, degrees/sec (E14.6)
630 };
631 
632 struct att_data_rec              // Attitude data record
633 {
634    struct desc_rec desc;         // Record description
635    char   npoint[4];             // Number of data points (I4)
636    struct att_vect_rec att_vect[20]; // Data points
637    char   pitch_bias[14];        // Pitch bias (degrees) (E14.6)
638    char   roll_bias[14];         // Roll bias (degrees) (E14.6)
639    char   yaw_bias[14];          // Yaw bias (degrees) (E14.6)
640    char   spare[6502];           // Unused (A6502)
641 };
642 
643 
644 struct radi_dset_rec             // Radiometric data set record
645 {
646    char   chan_ind[4];           // SAR channel indicator (A4)
647    char   spare1[4];             // Unused (A4)
648    char   table_desig[24];       // Table designator (A24)
649    char   n_samp[8];             // Number of lookup table samples (I8)
650    char   samp_type[16];         // Sample type designator (A16)
651    char   samp_inc[4];           // Increment between table entries, range samples (I4)
652    char   lookup_tab[512][16];   // Output scaling gain table (E16.7)
653    char   spare2[4];             // Unused (A4)
654    char   noise_scale[16];       // Thermal noise reference level (F16.7)
655    char   spare3[16];            // Unused (A16)
656    char   offset[16];            // Scaling offset (E16.7)
657    char   calib_const[16];       // Calibration constant (E16.7)
658 };
659 
660 struct radi_data_rec             // Radiometric data record
661 {
662    struct desc_rec desc;         // Record description
663    char   seq_num[4];            // Record sequence number (I4)
664    char   n_data[4];             // Number of data fields (I4)
665    char   field_size[8];         // Field size in bytes (I8)
666    struct radi_dset_rec dset[1]; // Radiometric data set records
667    char   spare1[1512];          // Unused (A1512)
668 };
669 
670 
671 struct comp_dset_rec             // Compensation data set record
672 {
673    char   comp_desig[8];         // Compensation data designator (A8)
674    char   comp_descr[32];        // Compensation data descriptor (A32)
675    char   n_comp_rec[4];         // Number of compensation records (I4)
676    char   comp_seq_no[4];        // Compensation record sequence number (I4)
677    char   beam_tab_size[8];      // Number of beam table entries (I8)
678    char   beam_tab[256][16];     // Elevation gain beam profile (256F16.7)
679    char   beam_type[16];         // Beam type (A16)
680    char   look_angle[16];        // Look angle of beam table centre (F16.7)
681    char   beam_tab_inc[16];      // Increment between beam table entries (F16.7)
682 };
683 
684 struct radi_comp_rec             // Radiometric compensation data record
685 {
686    struct desc_rec desc;         // Record description
687    char   seq_num[4];            // Record sequence number (I4)
688    char   chan_ind[4];           // SAR channel indicator (A4)
689    char   n_dset[8];             // Number of data sets in record (I8)
690    char   dset_size[8];          // Compensation data set size (I8)
691    struct comp_dset_rec dset[4]; // Compensation data set records
692 };
693 
694 
695 struct imop_desc_rec             // Image options file descriptor
696 {
697    struct desc_rec desc;         // Record description
698    char   ascii_flag[2];         // ASCII flag (A2)
699    char   spare1[2];             // Unused (A2)
700    char   format_doc[12];        // Format control document (A12)
701    char   format_rev[2];         // Format document revision (A2)
702    char   design_rev[2];         // File design revision (A2)
703    char   software_id[12];       // Software identifier (A12)
704    char   file_num[4];           // File number (I4)
705    char   file_name[16];         // File name (A16)
706    char   rec_seq[4];            // Record sequence/location flag (A4)
707    char   seq_loc[8];            // Sequence number location (I8)
708    char   seq_len[4];            // Sequence number length (I4)
709    char   rec_code[4];           // Record code/location flag (A4)
710    char   code_loc[8];           // Record code location (I8)
711    char   code_len[4];           // Record code length (I4)
712    char   rec_len[4];            // Record length/location flag (A4)
713    char   rlen_loc[8];           // Record length location (I8)
714    char   rlen_len[4];           // Record length length (I4)
715    char   spare2[4];             // Reserved (4A1)
716    char   spare3[64];            // Reserved segment (A64)
717    char   n_dataset[6];          // Number of SAR data records (I6)
718    char   l_dataset[6];          // SAR data record length (I6)
719    char   spare4[24];            // Unused (A24)
720    char   nbit[4];               // Number of bits per sample (I4)
721    char   nsamp[4];              // Samples per data group (I4)
722    char   nbyte[4];              // Bytes per data group (I4)
723    char   justify[4];            // Sample justification and order (A4)
724    char   nchn[4];               // Number of SAR channels (I4)
725    char   nlin[8];               // Lines per data set (I8)
726    char   nleft[4];              // Left border pixels per line (I4)
727    char   ngrp[8];               // Groups per line per channel (I8)
728    char   nright[4];             // Right border pixels per line (I4)
729    char   ntop[4];               // Top border lines (I4)
730    char   nbott[4];              // Bottom border lines (I4)
731    char   intleav[4];            // Interleave indicator (A4)
732    char   nrec_lin[2];           // Number of physical records per line (I2)
733    char   nrec_chn[2];           // Number of physical records per multi-channel line in this file (I2)
734    char   n_prefix[4];           // Number of bytes of prefix data per record (I4)
735    char   n_sar[8];              // Number of bytes of SAR data (or pixel data) per record (I8)
736    char   n_suffix[4];           // Number of bytes of suffix data per record (I4)
737    char   spare5[4];             // Unused (A4)
738    char   lin_loc[8];            // Line number locator (A8)
739    char   chn_loc[8];            // Channel number locator (A8)
740    char   tim_loc[8];            // Time locator (A8)
741    char   left_loc[8];           // Left fill locator (A8)
742    char   right_loc[8];          // Right fill locator (A8)
743    char   pad_ind[4];            // Pad pixel indicator (A4)
744    char   spare6[28];            // Unused (A28)
745    char   qual_loc[8];           // Quality code locator (A8)
746    char   cali_loc[8];           // Calibration info locator (A8)
747    char   gain_loc[8];           // Gain value locator (A8)
748    char   bias_loc[8];           // Bias value locator (A8)
749    char   type_id[28];           // Data type identifier (A28)
750    char   type_code[4];          // Data type code (A4)
751    char   left_fill[4];          // Number of left fill bits (I4)
752    char   right_fill[4];         // Number of right fill bits (I4)
753    char   pix_rng[8];            // Maximum data range of pixel (I8)
754    char   spare7[15804];         // Unused (A15804)
755 };
756 
757 
758 struct acq_date_rec              // Acquisition date/time
759 {
760    ossim_int32  acq_year;              // Acquisition year (B4)
761    ossim_int32  acq_day;               // Acquisition day of year (B4)
762    ossim_int32  acq_msec;              // Acquisition msecs of day (B4)
763 };
764 
765 struct sdr_prefix_rec            // Signal data prefix data
766 {
767    ossim_int32  line_num;              // Image data line number (B4)
768    ossim_int32  rec_num;               // Image data record index (B4)
769    ossim_int32  n_left_pixel;          // Left fill pixel count (B4)
770    ossim_int32  n_data_pixel;          // Data pixel count (B4)
771    ossim_int32  n_right_pixel;         // Right fill pixel count. (B4)
772    ossim_int32  sensor_updf;           // Sensor parameter update flag (B4)
773    struct acq_date_rec acq_date; // Acquisition date
774    ossim_int16  sar_chan_ind;          // SAR channel indicator (B2)
775    ossim_int16  sar_chan_code;         // SAR channel code (B2)
776    ossim_int16  tran_polar;            // Transmitted polarization (B2)
777    ossim_int16  recv_polar;            // Received polarization (B2)
778    ossim_int32  prf;                   // Pulse repetition frequency, Hz (B4)
779    ossim_uint8   spare1[4];             // Unused (B4)
780    ossim_int16  obrc;                  // On-board range compressed flag (B2)
781    ossim_int16  pulse_type;            // Pulse type designator (B2)
782    ossim_int32  chp_len;               // Chirp length, ns (B4)
783    ossim_int32  chp_coef1;             // Chirp constant coefficient,Hz (B4)
784    ossim_int32  chp_coef2;             // Chirp linear coefficient,Hz/usec (B4)
785    ossim_int32  chp_coef3;             // Chirp quadratic coefficient,Hz/usec^2 (B4)
786    ossim_uint8   spare2[2][4];          // Spare (2B4)
787    ossim_int32  recv_gain;             // Receiver gain (B4)
788    ossim_int32  nt_line;               // Nought line flag (B4)
789    ossim_int32  ele_nadir;             // Elec. nadir angle, 10**-6 deg (B4)
790    ossim_int32  mec_nadir;             // Mech. nadir angle, 10**-6 deg (B4)
791    ossim_int32  ele_squint;            // Elec. squint angle, 10**-6 deg (B4)
792    ossim_int32  mec_squint;            // Mech. squint angle, 10**-6 deg (B4)
793    ossim_int32  sr_first;              // First sample slant range, m (B4)
794    ossim_int32  dr_window;             // Data record window time, ns (B4)
795    ossim_uint8   spare3[4];             // Spare (B4)
796    ossim_int32  plat_updf;             // Platform position update flag (B4)
797    ossim_int32  plat_lat;              // Platform latitude, 10**-6 deg (B4)
798    ossim_int32  plat_long;             // Platform longitude, 10**-6 deg (B4)
799    ossim_int32  plat_alt;              // Platform altitude, m (B4)
800    ossim_int32  plat_speed;            // Platform speed, cm/s (B4)
801    ossim_int32  plat_vel[3];           // Platform velocity, cm/s (3B4)
802    ossim_int32  plat_acc[3];           // Platform acceleration, cm/s (3B4)
803    ossim_int32  plat_track;            // Platform track, 10**-6 deg (B4)
804    ossim_int32  plat_head;             // Platform heading, 10**-6 deg (B4)
805    ossim_int32  plat_pitch;            // Platform pitch, 10**-6 deg (B4)
806    ossim_int32  plat_roll;             // Platform roll, 10**-6 deg (B4)
807    ossim_int32  plat_yaw;              // Platform yaw, 10**-6 deg (B4)
808 };
809 
810 struct sdr_data_rec              // Signal data record
811 {
812    struct desc_rec desc;         // Record description
813    struct sdr_prefix_rec prefix; // Prefix data
814    ossim_uint8   sdr_data;              // SAR signal data (jBk)
815 };
816 
817 
818 struct pdr_prefix_rec            // Processed data prefix data
819 {
820    ossim_int32  line_num;              // Image data line number (B4)
821    ossim_int32  rec_num;               // Image data record index (B4)
822    ossim_int32  n_left_pixel;          // Left fill pixel count (B4)
823    ossim_int32  n_data_pixel;          // Data pixel count (B4)
824    ossim_int32  n_right_pixel;         // Right fill pixel count (B4)
825    ossim_int32  sensor_updf;           // Sensor parameter update flag (B4)
826    struct acq_date_rec acq_date; // Acquisition date
827    ossim_int16  sar_chan_ind;          // SAR channel indicator (B2)
828    ossim_int16  sar_chan_code;         // SAR channel code (B2)
829    ossim_int16  tran_polar;            // Transmitted polarization (B2)
830    ossim_int16  recv_polar;            // Received polarization (B2)
831    ossim_int32  prf;                   // Pulse repetition frequency, Hz (B4)
832    ossim_uint8   spare1[4];             // Unused (B4)
833    ossim_int32  sr_first;              // Slant range to first pixel, m (B4)
834    ossim_int32  sr_mid;                // Slant range to mid-pixel, m (B4)
835    ossim_int32  sr_last;               // Slant range to last pixel, m (B4)
836    ossim_int32  fdc_first;             // First pixel Doppler centroid, Hz (B4)
837    ossim_int32  fdc_mid;               // Mid-pixel Doppler centroid, Hz (B4)
838    ossim_int32  fdc_last;              // Last pixel Doppler centroid, Hz (B4)
839    ossim_int32  ka_first;              // First pixel azimuth FM rate, Hz (B4)
840    ossim_int32  ka_mid;                // Mid-pixel azimuth FM rate, Hz (B4)
841    ossim_int32  ka_last;               // Last pixel azimuth  FM rate, Hz (B4)
842    ossim_int32  nadir_ang;             // Nadir look angle, 10**-6 deg (B4)
843    ossim_int32  squint_ang;            // Azimuth squint angle, 10**-6 deg (B4)
844    ossim_int32  null_f;                // Null line flag - 1 for NULL line, 0 for otherwise (B4)
845    ossim_uint8   spare2[4][4];          // Unused (4B4)
846    ossim_int32  geo_updf;              // Geographic parameter update flag (B4)
847    ossim_int32  lat_first;             // First pixel latitude, millionths of deg (B4)
848    ossim_int32  lat_mid;               // Mid-pixel latitude (B4)
849    ossim_int32  lat_last;              // Last pixel latitude (B4)
850    ossim_int32  long_first;            // First pixel longitude, millionths of deg (B4)
851    ossim_int32  long_mid;              // Mid pixel longitue (B4)
852    ossim_int32  long_last;             // Last pixel longitude (B4)
853    ossim_int32  north_first;           // Northing of first pixel, m (B4)
854    ossim_uint8   spare3[4];             // Unused (B4)
855    ossim_int32  north_last;            // Northing of last pixel, m (B4)
856    ossim_int32  east_first;            // Easting of first pixel, m (B4)
857    ossim_uint8   spare4[4];             // Spare (B4)
858    ossim_int32  east_last;             // Easting of last pixel, m (B4)
859    ossim_int32  heading;               // Line heading, millionths of deg (B4)
860    ossim_uint8   spare5[8];             // Unused (B8)
861 };
862 
863 struct pdr_data_rec              // Processed data record
864 {
865    struct desc_rec       desc;   // Record description
866    struct pdr_prefix_rec prefix; // Prefix data
867 };
868 
869 
870 struct pdr8_htab_rec             // Histogram table record
871 {
872    char   hist_desc[32];         // Histogram descriptor (A32)
873    char   nrec[4];               // Records per table (I4)
874    char   tab_seq[4];            // Table sequence number (I4)
875    char   nbin[8];               // Total number of table bins (I8)
876    char   ns_lin[8];             // Total number of pixels in line direction (I8)
877    char   ns_pix[8];             // Total number of lines (I8)
878    char   ngrp_lin[8];           // Group size along pixel axis (I8)
879    char   ngrp_pix[8];           // Group size along line axis (I8)
880    char   nsamp_lin[8];          // Number of samples used per group along pixel axis (I8)
881    char   nsamp_pix[8];          // Number of samples used per group along line (I8)
882    char   min_smp[16];           // Minimum first bin (E16.7)
883    char   max_smp[16];           // Maximum last bin (E16.7)
884    char   mean_smp[16];          // Mean sample value (E16.7)
885    char   std_smp[16];           // Sample standard deviation (E16.7)
886    char   smp_inc[16];           // Sample value increment (E16.7)
887    char   min_hist[16];          // Minimum histogram value (E16.7)
888    char   max_hist[16];          // Maximum histogram value (E16.7)
889    char   mean_hist[16];         // Histogram mean value (E16.7)
890    char   std_hist[16];          // Histogram standard deviation (E16.7)
891    char   nhist[8];              // Histogram table size (I8)
892    char   hist[256][8];          // 256 histogram table values for 256 bins (I8)
893 };
894 
895 struct pdr8_hist_rec             // Data histogram record
896 {
897    struct desc_rec desc;         // Record description
898    char   rec_seq[4];            // Record sequence number (I4)
899    char   sar_chn[4];            // SAR channel number (I4)
900    char   ntab[8];               // Num hist. table data sets in record (I8)
901    char   ltab[8];               // Histogram table data set size (I8)
902    struct pdr8_htab_rec htab;    // Histogram tables
903    char   spare[14588];          // Unused (A14588)
904 };
905 
906 
907 struct null_vol_rec              // Null volume descriptor record
908 {
909    struct desc_rec desc;         // Record description
910    char   ascii_flag[2];         // ASCII flag (A2)
911    char   spare1[2];             // Unused (A2)
912    char   format_doc[12];        // Format control doc (A12)
913    char   format_ver[2];         // Format doc version (A2)
914    char   format_rev[2];         // Format doc revision (A2)
915    char   software_id[12];       // Software identifier (A12)
916    char   tape_id[16];           // Physical tape id (A16)
917    char   logvol_id[16];         // Logical volume id (A16)
918    char   phyvol_id[16];         // Physical volume id (A16)
919    char   n_phyvol[2];           // Total physical volume count (I2)
920    char   first_phyvol[2];       // First physical volume (I2)
921    char   last_phyvol[2];        // Last physical volume (I2)
922    char   curr_phyvol[2];        // Current physical volume (I2)
923    char   first_file[4];         // First file in volume (I4)
924    char   volset_log[4];         // Logical volume within set (I4)
925    char   logvol_vol[4];         // Logical volume within phyvol (I4)
926    char   spare2[248];           // Unused (A248)
927 };
928 
929 struct VolumeDirectoryFile
930 {
931    vol_desc_rec      volDescRec;
932    file_pntr_rec     leaderFilePntrRec;
933    file_pntr_rec     imageOptionsFilePntrRec;
934    file_pntr_rec     trailerFilePntrRec;
935    text_rec          textRec;
936 };
937 
938 struct SarLeaderFile
939 {
940    sar_desc_rec      sarDescRec;
941    dataset_sum_rec   dataSetSumRec;
942    qual_sum_rec      qualSumRec;
943    sdr_hist_rec      sdrHistRec;
944    pdr16_hist_rec    pdr16HistRec;
945    proc_parm_rec     procParmRec;
946    map_proj_rec      mapProjRec;
947    pos_data_rec      posDataRec;
948    att_data_rec      attDataRec;
949    radi_data_rec     radiDataRec;
950    radi_comp_rec     radiCompRec;
951 };
952 
953 struct SarTrailerFile
954 {
955    sar_desc_rec      sarDescRec;
956    dataset_sum_rec   dataSetSumRec;
957    qual_sum_rec      qualSumRec;
958    sdr_hist_rec      sdrHistRec;
959    pdr8_hist_rec     pdr8HistRec;
960    proc_parm_rec     procParmRec;
961    att_data_rec      attDataRec;
962    radi_data_rec     radiDataRec;
963    radi_comp_rec     radiCompRec;
964 };
965 
966 class ossimCeosData : public ossimReferenced
967 {
968 public:
969 
970    enum ErrorStatus
971    {
972       OK = 0,
973       ERROR
974    };
975 
976    ossimCeosData(const ossimFilename& volDirFile,
977             const ossimFilename& leaderFile,
978             const ossimFilename& imageFile,
979             const ossimFilename& trailerFile);
980 
981    ossimCeosData(const ossimFilename& imageDir);
982 
errorStatus()983    bool errorStatus()   const { return theErrorStatus; }
984 
volDirFile()985    const ossimFilename& volDirFile()    const { return theVolDirFileName; }
leaderFile()986    const ossimFilename& leaderFile()    const { return theLeaderFileName; }
imageFile()987    const ossimFilename& imageFile()     const { return theImageFileName; }
trailerFile()988    const ossimFilename& trailerFile()   const { return theTrailerFileName; }
989 
volDescRec()990    const vol_desc_rec*    volDescRec()    const { return theVolDescRec; }
textRec()991    const text_rec*        textRec()       const { return theTextRec; }
imopDescRec()992    const imop_desc_rec*   imopDescRec()   const { return &theImopDescRec; }
dataSetSumRec()993    const dataset_sum_rec* dataSetSumRec() const { return theDataSetSumRec; }
qualSumRec()994    const qual_sum_rec*    qualSumRec()    const { return theQualSumRec; }
sdrHistRec()995    const sdr_hist_rec*    sdrHistRec()    const { return theSdrHistRec; }
pdr16HistRec()996    const pdr16_hist_rec*  pdr16HistRec()  const { return thePdr16HistRec; }
pdr8HistRec()997    const pdr8_hist_rec*   pdr8HistRec()   const { return thePdr8HistRec; }
procParmRec()998    const proc_parm_rec*   procParmRec()   const { return theProcParmRec; }
mapProjRec()999    const map_proj_rec*    mapProjRec()    const { return theMapProjRec; }
posDataRec()1000    const pos_data_rec*    posDataRec()    const { return thePosDataRec; }
attDataRec()1001    const att_data_rec*    attDataRec()    const { return theAttDataRec; }
radiDataRec()1002    const radi_data_rec*   radiDataRec()   const { return theRadiDataRec; }
radiCompRec()1003    const radi_comp_rec*   radiCompRec()   const { return theRadiCompRec; }
1004 
1005    void                   dump(std::ostream& strm = std::clog) const;
1006    void                   dumpVolDescRec   (std::ostream&) const;
1007    void                   dumpTextRec      (std::ostream&) const;
1008    void                   dumpImopDescRec  (std::ostream&) const;
1009    void                   dumpDataSetSumRec(std::ostream&) const;
1010    void                   dumpQualSumRec   (std::ostream&) const;
1011    void                   dumpSdrHistRec   (std::ostream&) const;
1012    void                   dumpPdr16HistRec (std::ostream&) const;
1013    void                   dumpPdr8HistRec  (std::ostream&) const;
1014    void                   dumpProcParmRec  (std::ostream&) const;
1015    void                   dumpMapProjRec   (std::ostream&) const;
1016    void                   dumpPosDataRec   (std::ostream&) const;
1017    void                   dumpAttDataRec   (std::ostream&) const;
1018    void                   dumpRadiDataRec  (std::ostream&) const;
1019    void                   dumpRadiCompRec  (std::ostream&) const;
1020 
1021 private:
1022    void                   loadCeosRecords();
1023    ossim_int32             sizeOfNextRec(FILE*);
1024 
1025    VolumeDirectoryFile    theVolumeDirectory;
1026    SarLeaderFile          theSarLeaderFile;
1027    imop_desc_rec          theImopDescRec;
1028    SarTrailerFile         theSarTrailerFile;
1029 
1030    ossimFilename          theVolDirFileName;
1031    ossimFilename          theLeaderFileName;
1032    ossimFilename          theImageFileName;
1033    ossimFilename          theTrailerFileName;
1034 
1035    bool                   theErrorStatus;
1036 
1037    vol_desc_rec*          theVolDescRec;
1038    text_rec*              theTextRec;
1039    dataset_sum_rec*       theDataSetSumRec;
1040    qual_sum_rec*          theQualSumRec;
1041    sdr_hist_rec*          theSdrHistRec;
1042    pdr16_hist_rec*        thePdr16HistRec;
1043    pdr8_hist_rec*         thePdr8HistRec;
1044    proc_parm_rec*         theProcParmRec;
1045    map_proj_rec*          theMapProjRec;
1046    pos_data_rec*          thePosDataRec;
1047    att_data_rec*          theAttDataRec;
1048    radi_data_rec*         theRadiDataRec;
1049    radi_comp_rec*         theRadiCompRec;
1050 };
1051 
1052 
1053 
1054 #endif
1055