OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFfRevc.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: MIT
4 //
5 // Author: Ken Melero (kmelero@imagelinks.com)
6 // Orginally written by Dave Burken (dburken@imagelinks.com)
7 // Description: This class parses an EOSAT Fast Format rev c header.
8 //
9 //********************************************************************
10 // $Id$
11 
14 #include <ossim/base/ossimNotify.h>
16 #include <ossim/base/ossimString.h>
17 #include <sstream>
18 #include <iomanip>
19 
20 const int LOCATION_OFFSET [4] = { 23,
21  183,
22  343,
23  503 };
24 
25 const int PATH_ROW_NUMBER_OFFSET [4] = { 34,
26  194,
27  354,
28  514 };
29 
30 const int DATE_OFFSET [4] = { 70,
31  230,
32  390,
33  550 };
34 
35 const int SAT_NAME_OFFSET [4] = { 91,
36  251,
37  411,
38  571 };
39 
40 const int SENSOR_NAME_OFFSET [4] = { 110,
41  270,
42  430,
43  590 };
44 
45 const int SENSOR_MODE_OFFSET [4] = { 134,
46  294,
47  454,
48  614 };
49 
50 const int OFF_NADIR_ANGLE_OFFSET [4] = { 153,
51  313,
52  473,
53  633 };
54 
55 
56 const int BIAS_OFFSET [8] = { 1616,
57  1696,
58  1776,
59  1856,
60  1936,
61  2016,
62  2096,
63  2176 };
64 
65 const int GAIN_OFFSET [8] = { 1641,
66  1721,
67  1801,
68  1881,
69  1961,
70  2041,
71  2121,
72  2201 };
73 
74 static const int PROJ_PARAM_OFFSET [15] = { 3181,
75  3206,
76  3232,
77  3257,
78  3282,
79  3312,
80  3337,
81  3362,
82  3392,
83  3417,
84  3442,
85  3472,
86  3497,
87  3522,
88  3552 };
89 
90 static const char BLANK_STRING[] = " ";
91 
92 //***************************************************************************
93 // CONSTRUCTOR
94 //***************************************************************************
96  :
97  theAdminRecord(),
98  theRadiomRecord(),
99  theGeoRecord(),
100  theErrorStatus(OSSIM_OK)
101 { }
102 
103 //***************************************************************************
104 // CONSTRUCTOR:
105 // ossimFfRevc::ossimFfRevc(const char* headerFile)
106 //
107 // Takes a filename representing an IRS-1C Fast Format rev C header.
108 //***************************************************************************
109 ossimFfRevc::ossimFfRevc(const char* headerFile)
110  :
111  theErrorStatus(OSSIM_OK)
112 {
113  std::shared_ptr<ossim::istream> is = ossim::StreamFactoryRegistry::instance()->
114  createIstream(ossimString(headerFile), std::ios_base::in);
115 
116  if (!is)
117  {
119 
120  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevc::ossimFfRevc(header): "
121  << "Cannot open: " << headerFile << "\n"
122  << "Returning from constructor." << std::endl;
123 
124  return;
125  }
126 
127  loadFromStream( *is );
128 }
129 
130 
131 //***************************************************************************
132 // PUBLIC METHOD:
133 // int ossimFfRevc::path(int sceneNbr) const
134 //
135 // Convenience method to parse the path from the path/row string. Returns
136 // zero if stream is not opened. Current loacation field is:
137 // path/row/fraction/subscene in ppp/rrrffss format.
138 //***************************************************************************
139 int ossimFfRevc::path(int sceneNbr) const
140 {
141  char tmpBuff[4];
142  int path = 0;
143 
145 
146  if (is)
147  {
148  is.get(tmpBuff, 4);
149  path = atoi(tmpBuff);
150  }
151 
152  return path;
153 }
154 
155 
156 //***************************************************************************
157 // PUBLIC METHOD:
158 // int ossimFfRevc::row(int sceneNbr) const
159 //
160 // Convenience method to parse the row from the path/row string. Returns
161 // zero if stream is not opened. Current loacation field is:
162 // path/row/fraction/subscene in ppp/rrrffss format.
163 //***************************************************************************
164 int ossimFfRevc::row(int sceneNbr) const
165 {
166  char tmpBuff[4];
167  int row = 0;
168 
170 
171  if (is)
172  {
173  is.seekg(4, std::ios_base::beg);
174  is.get(tmpBuff, 4);
175  row = atoi(tmpBuff);
176  }
177 
178  return row;
179 }
180 
181 
182 //***************************************************************************
183 // PUBLIC METHOD:
184 // int ossimFfRevc::fraction(int sceneNbr) const
185 //
186 // Convenience method to parse the fraction from the path/row string. Returns
187 // zero if stream is not opened. Current loacation field is:
188 // path/row/fraction/subscene in ppp/rrrffss format.
189 //***************************************************************************
190 int ossimFfRevc::fraction(int sceneNbr) const
191 {
192  char tmpBuff[3];
193  int fraction = 0;
194 
196 
197  if (is)
198  {
199  is.seekg(7, std::ios_base::beg);
200  is.get(tmpBuff, 3);
201  fraction = atoi(tmpBuff);
202  }
203 
204  return fraction;
205 }
206 
207 
208 //***************************************************************************
209 // PUBLIC METHOD:
210 // int ossimFfRevc::subScene(int sceneNbr) const
211 //
212 // Convenience method to parse the subScene from the path/row string. Returns
213 // zero if stream is not opened. Current loacation field is:
214 // path/row/fraction/subscene in ppp/rrrffss format.
215 //***************************************************************************
217 {
218  char tmpBuff[3];
220 
222 
223  if (is)
224  {
225  is.seekg(9, std::ios_base::beg);
226  is.get(tmpBuff, 3);
227  subScene = tmpBuff;
228  }
229 
230  return subScene;
231 }
232 
233 //***************************************************************************
234 // ossimFfRevc::pathRow(int sceneNbr)
235 //***************************************************************************
237 {
238  ossimString tmp = "p";
239 
240  tmp += theAdminRecord.thePathRowNumber[sceneNbr];
241 
242  tmp.gsub("/", "r");
243 
244  tmp.gsub(" ", "");
245 
246  return tmp;
247 }
248 
249 //***************************************************************************
250 // PUBLIC METHOD:
251 // void ossimFfRevc::print(ostream& os) const
252 //
253 // Prints data members.
254 //***************************************************************************
256 {
257  os << std::setiosflags(std::ios_base::left | std::ios_base::fixed)
258  << "Administrative Record:"
259  << std::setw(30) << "\ntheProductOrderNumber:"
261 
262  int i;
263  for (i = 0; i < NUMBER_OF_SCENES; i++)
264  {
265  os << "\nScene" << (i + 1) << std::setw(23) << " PathRowNumber:"
267  << "\nScene" << (i + 1) << std::setw(23) << " AcquisitionDate: "
269  << "\nScene" << (i + 1) << std::setw(23) << " SatelliteName: "
271  << "\nScene" << (i + 1) << std::setw(23) << " SensorName: "
273  << "\nScene" << (i + 1) << std::setw(23) << " SensorMode: "
275  << "\nScene" << (i + 1) << std::setw(23) << " OffNadirAngle: "
276  << std::setprecision(2) << theAdminRecord.theOffNadirAngle[i];
277  }
278 
279  os << std::setw(30) << "\nProductType:"
281  << std::setw(30) << "\nProductSize:"
283  << std::setw(30) << "\nProcessingType:"
285  << std::setw(30) << "\nResampAlgorithm:"
287  << std::setw(30) << "\nTapeVolumeNumber:"
289  << std::setw(30) << "\nNumberVolumesPerTape:"
291  << std::setw(30) << "\nPixelsPerLine:"
293  << std::setw(30) << "\nLinesPerImage:"
295  << std::setw(30) << "\n1stLineInVolume:"
297  << std::setw(30) << "\nTapeBlockingFactor:"
299  << std::setw(30) << "\nRecordSize:"
301  << std::setw(30) << "\nGsd:"
302  << std::setprecision(2) << theAdminRecord.theGsd
303  << std::setw(30) << "\nOutputBitsPerPixel:"
305  << std::setw(30) << "\nAcquiredBitsPerPixel:"
307  << std::setw(30) << "\nBandsPresentString:"
309  << std::setw(30) << "\nFormatVersion:"
311  << "\n"
312  << std::setw(30) << "Radiometric record:";
313 
314  os << std::setprecision(15);
315 
316  for (i = 0; i < NUMBER_OF_BANDS; i++)
317  {
318  os << "\nBand" << (i + 1) << std::setw(24) << " bias:"
320  << "\nBand" << (i + 1) << std::setw(24) << " gain:"
321  << theRadiomRecord.theGain[i];
322  }
323 
324  os << "\n"
325  << "Geometric Record:"
326  << std::setw(30) << "\nMapProjectionName:"
328  << std::setw(30) << "\nEllipsoid:"
330  << std::setw(30) << "\nDatum:"
332 
333  for (i = 0; i < 15; i++)
334  {
335  os << "\nProjectionParams[" << std::setw(2) << i << std::setw(10) << "]: "
337  }
338 
339  os << std::setprecision(3)
340  << std::setw(30) << "\nUlLon:"
342  << std::setw(30) << "\nUlLat:"
344  << std::setw(30) << "\nUlEasting:"
346  << std::setw(30) << "\nUlNorthing:"
348  << std::setw(30) << "\nUrLon:"
350  << std::setw(30) << "\nUrLat:"
352  << std::setw(30) << "\nUrEasting:"
354  << std::setw(30) << "\nUrNorthing:"
356  << std::setw(30) << "\nLrLon:"
358  << std::setw(30) << "\nLrLat:"
360  << std::setw(30) << "\nLrEasting:"
362  << std::setw(30) << "\nLrNorthing:"
364  << std::setw(30) << "\nLlLon:"
366  << std::setw(30) << "\nLlLat:"
368  << std::setw(30) << "\nLlEasting:"
370  << std::setw(30) << "\nLlNorthing:"
372  << std::setw(30) << "\nCenterLon:"
374  << std::setw(30) << "\nCenterLat:"
376  << std::setw(30) << "\nCenterEasting:"
378  << std::setw(30) << "\nCenterNorthing:"
380  << std::setw(30) << "\nCenterSample:"
382  << std::setw(30) << "\nCenterLine:"
384  << std::setw(30) << "\nHorizontalOffset:"
386  << std::setprecision(2) << std::setw(30) << "\nOrientationAngle:"
388  << std::setw(30) << "\nSunElevationAngle:"
389  << std::setprecision(1) << theGeoRecord.theSunElevationAngle
390  << std::setw(30) << "\nSunAzimuth:" << theGeoRecord.theSunAzimuth
391  << std::resetiosflags(std::ios_base::left)
392  << "\n\n";
393 
394 }
395 
396 //***************************************************************************
397 // PUBLIC METHOD:
398 // void ossimFfRevc::write(ostream& os) const
399 //
400 // Writes data members in EOSAT Fast Format Rev C format.
401 //***************************************************************************
403 {
404  const char PRODUCT_ID_DESC [PRODUCT_ORDER_NUMBER_DESC_SIZE + 1]
405  = "PRODUCT ID =";
406 
407  const char LOCATION_DESC [LOCATION_DESC_SIZE + 1]
408  = " LOCATION =";
409 
410  const char DATE_DESC [DATE_DESC_SIZE + 1]
411  = " ACQUISITION DATE =";
412 
413  const char SATELLITE_NAME_DESC [SAT_NAME_DESC_SIZE + 1]
414  = "SATELLITE =";
415 
416  const char SENSOR_NAME_DESC [SENSOR_NAME_DESC_SIZE + 1]
417  = " SENSOR =";
418 
419  const char SENSOR_MODE_DESC [SENSOR_MODE_DESC_SIZE + 1]
420  = " SENSOR MODE =";
421 
422  const char LOOK_ANGLE_DESC [LOOK_ANGLE_DESC_SIZE + 1]
423  = " LOOK ANGLE =";
424 
425  const char PRODUCT_TYPE_DESC [PRODUCT_TYPE_DESC_SIZE + 1]
426  = "PRODUCT TYPE =";
427 
428  const char PRODUCT_SIZE_DESC [PRODUCT_SIZE_DESC_SIZE + 1]
429  = " PRODUCT SIZE =";
430 
431  const char PROCESSING_TYPE_DESC [PROCESSING_TYPE_DESC_SIZE + 1]
432  = "TYPE OF PROCESSING =";
433 
434  const char RESAMPLING_ALGO_DESC [RESAMPLING_ALGO_DESC_SIZE + 1]
435  = " RESAMPLING =";
436 
437  const char TAPE_VOLUME_NUMBER_DESC [TAPE_VOLUME_NUMBER_DESC_SIZE + 1]
438  = "VOLUME #/# IN SET =";
439 
440  const char PIXELS_PER_LINE_DESC [PIXELS_PER_LINE_DESC_SIZE + 1]
441  = " PIXELS PER LINE =";
442 
443  const char LINES_PER_IMAGE_DESC [LINES_PER_IMAGE_DESC_SIZE + 1]
444  = " LINES PER BAND =";
445 
446  const char FIRST_LINE_DESC [FIRST_LINE_DESC_SIZE + 1]
447  = "START LINE # =";
448 
449  const char BLOCKING_FACTOR_DESC [BLOCKING_FACTOR_DESC_SIZE + 1]
450  = " BLOCKING FACTOR =";
451 
452  const char RECORD_LENGTH_DESC [RECORD_LENGTH_DESC_SIZE + 1]
453  = " RECORD LENGTH =";
454 
455  const char PIXEL_GSD_DESC [PIXEL_GSD_DESC_SIZE + 1]
456  = " PIXEL SIZE =";
457 
458  const char BITS_PER_PIXEL_DESC [BITS_PER_PIXEL_DESC_SIZE + 1]
459  = "OUTPUT BITS PER PIXEL =";
460 
461  const char AQUIRED_BITS_PER_PIXEL_DESC
462  [AQUIRED_BITS_PER_PIXEL_DESC_SIZE + 1] = " ACQUIRED BITS PER PIXEL =";
463 
464  const char BANDS_PRESENT_DESC [BANDS_PRESENT_DESC_SIZE + 1]
465  = "BANDS PRESENT =";
466 
467  const char REV_DESC [REV_DESC_SIZE + 1]
468  = "REV ";
469 
470  const char BIAS_GAIN_DESC [BIAS_GAIN_DESC_SIZE + 1]
471  = "BIASES AND GAINS IN THE BAND ORDER AS ON THIS TAPE";
472 
473  const char GEO_DESC [GEO_DESC_SIZE + 1]
474  = "GEOMETRIC DATA";
475 
476  const char MAP_PROJECTION_NAME_DESC [MAP_PROJECTION_NAME_DESC_SIZE + 1]
477  = " MAP PROJECTION =";
478 
479  const char ELLIPSOID_DESC [ELLIPSOID_DESC_SIZE + 1]
480  = " ELLIPSOID =";
481 
482  const char DATUM_DESC [DATUM_DESC_SIZE + 1]
483  = " DATUM =";
484 
485  const char PROJECTION_PARAMETER_DESC [PROJECTION_PARAMETER_DESC_SIZE + 1]
486  = "USGS PROJECTION PARAMETERS =";
487 
488  const char UL_DESC [CORNER_DESC_SIZE + 1]
489  = "UL =";
490 
491  const char UR_DESC [CORNER_DESC_SIZE + 1]
492  = "UR =";
493 
494  const char LR_DESC [CORNER_DESC_SIZE + 1]
495  = "LR =";
496 
497  const char LL_DESC [CORNER_DESC_SIZE + 1]
498  = "LL =";
499 
500  const char CENTER_DESC [CENTER_DESC_SIZE + 1]
501  = "CENTER =";
502 
503  const char HORIZONTAL_OFFSET_DESC [HORIZONTAL_OFFSET_DESC_SIZE + 1]
504  = "OFFSET =";
505 
506  const char ORIENTATION_ANGLE_DESC [ORIENTATION_ANGLE_DESC_SIZE + 1]
507  = " ORIENTATION ANGLE =";
508 
509  const char SUN_ELEVATION_DESC [SUN_ELEVATION_DESC_SIZE + 1]
510  = "SUN ELEVATION ANGLE =";
511 
512  const char SUN_AZIMUTH_DESC [SUN_AZIMUTH_DESC_SIZE + 1]
513  = " SUN AZIMUTH ANGLE =";
514 
515  const char SPACE[] = " ";
516 
517  //>
518  // NOTE: "seekp's" will be perormed as needed for safety.
519  //<
520 
521  //>
522  // Start at beginning of the stream.
523  //<
524  os.seekp(0, std::ios_base::beg);
525 
526  //>
527  // Start of administrative record.
528  //<
529 
530  os << std::setiosflags(std::ios_base::fixed) // Disable scientific mode.
531 
532  << PRODUCT_ID_DESC
533 
534  << std::setw(PRODUCT_ORDER_NUMBER_SIZE)
536 
537  //>
538  // The admin record can contain info for up to four scenes.
539  //<
540 
541  int i;
542  for (i = 0; i < 4; i++)
543  {
544  os.seekp(LOCATION_OFFSET[i], std::ios_base::beg);
545 
546  os << LOCATION_DESC
547 
548  << std::setw(PATH_ROW_NUMBER_SIZE)
550 
551  << DATE_DESC
552 
553  << std::setw(DATE_SIZE)
555 
556  << std::setw(1) << SPACE << "\n" // End of line.
557 
558  << SATELLITE_NAME_DESC // Start of line.
559 
560  << std::setw(SAT_NAME_SIZE)
562 
563  << SENSOR_NAME_DESC
564 
565  << std::setw(SENSOR_NAME_SIZE)
567 
568  << SENSOR_MODE_DESC
569 
570  << std::setw(SENSOR_MODE_SIZE)
572 
573  << LOOK_ANGLE_DESC
574 
575  << std::setw(OFF_NADIR_ANGLE_SIZE)
576  << std::setiosflags(std::ios_base::right)
577  << std::setprecision(2)
578  << theAdminRecord.theOffNadirAngle[i] // End of scene.
579  << std::resetiosflags(std::ios_base::right)
580  << "\n"
581  << std::setw(23) << SPACE; // End of line.
582  } // End of scene loop.
583 
584  os.seekp(640, std::ios_base::beg); // Start of line.
585 
586  os << PRODUCT_TYPE_DESC
587 
588  << std::setiosflags(std::ios_base::left)
589 
590  << std::setw(PRODUCT_TYPE_SIZE)
592 
593  << PRODUCT_SIZE_DESC
594 
595  << std::setw(PRODUCT_SIZE_SIZE)
597 
598  << std::setw(22) << SPACE << "\n"; // End of line.
599 
600  os.seekp(720, std::ios_base::beg);
601 
602  os << PROCESSING_TYPE_DESC
603 
604  << std::setw(PROCESSING_TYPE_SIZE)
606 
607  << RESAMPLING_ALGO_DESC
608 
609  << std::setw(RESAMPLING_ALGO_SIZE)
611 
612  << std::resetiosflags(std::ios_base::left)
613 
614  << std::setw(33) << SPACE << "\n"; // End of line.
615 
616  os.seekp(800, std::ios_base::beg); // Start of line.
617 
618  os << TAPE_VOLUME_NUMBER_DESC
619 
620  << std::setiosflags(std::ios_base::right)
621 
622  << std::setw(TAPE_VOLUME_NUMBER_SIZE)
624  << "/" << std::setw(VOLUMES_PER_TAPE_SIZE)
626 
627  << PIXELS_PER_LINE_DESC
628 
629  << std::setw(PIXELS_PER_LINE_SIZE)
631 
632  << LINES_PER_IMAGE_DESC
633 
634  << std::setw(LINES_PER_IMAGE_SIZE)
636 
637  << "/"
638 
639  << std::setw(LINES_PER_IMAGE_SIZE)
641 
642  << std::setw(4) << SPACE << "\n"; // End of line.
643 
644  os.seekp(880, std::ios_base::beg); // Start of line.
645 
646  os << std::setiosflags(std::ios_base::right)
647 
648  << FIRST_LINE_DESC
649 
650  << std::setw(LINES_PER_IMAGE_SIZE)
652 
653  << BLOCKING_FACTOR_DESC
654 
655  << std::setw(BLOCKING_FACTOR_SIZE)
657 
658  << RECORD_LENGTH_DESC
659 
660  << std::setw(RECORD_LENGTH_SIZE)
662 
663  << PIXEL_GSD_DESC
664 
665 
666  << std::setw(PIXEL_GSD_SIZE)
667  << std::setprecision(2)
669 
670  << "\n"; // End of line.
671 
672  os.seekp(960, std::ios_base::beg); // Start of line.
673 
674  os << BITS_PER_PIXEL_DESC
675 
676  << std::setw(BITS_PER_PIXEL_SIZE)
678 
679  << AQUIRED_BITS_PER_PIXEL_DESC
680 
681  << std::setw(BITS_PER_PIXEL_SIZE)
683 
684  << std::resetiosflags(std::ios_base::right)
685 
686  << std::setw(26) << SPACE << "\n"; // End of line.
687 
688  os.seekp(1040, std::ios_base::beg); // Start of line.
689 
690  os << BANDS_PRESENT_DESC
691 
692  << std::setw(BANDS_PRESENT_SIZE)
694 
695  << std::setw(31) << SPACE << "\n" // End of line.
696  << std::setw(79) << SPACE << "\n"
697  << std::setw(79) << SPACE << "\n"
698  << std::setw(79) << SPACE << "\n"
699  << std::setw(79) << SPACE << "\n"
700  << std::setw(79) << SPACE << "\n";
701 
702  os.seekp(1520, std::ios_base::beg);
703 
704  os << REV_DESC
705 
706  << std::setw(FORMAT_VERSION_SIZE)
708 
709  //***
710  // End of administrative record(bytes 0 to 1535).
711  //***
712 
713  //***
714  // Beginning of radiometric record.
715  //***
716 
717  os.seekp(1536, std::ios_base::beg);
718 
719  os << BIAS_GAIN_DESC
720 
721  << std::setw(29) << SPACE << "\n";
722 
723  //***
724  // Loop through the bands and get write out the bias and gain for each
725  // band.
726  //***
727 
728  os << std::resetiosflags(std::ios_base::left) << std::setiosflags(std::ios_base::right);
729 
730  for (i = 0; i < 8; i++)
731  {
732  os.seekp(BIAS_OFFSET[i], std::ios_base::beg);
733 
734  os << std::setprecision(15)
735 
736  << std::setw(BIAS_SIZE)
738 
739  << SPACE
740 
741  << std::setw(GAIN_SIZE)
743 
744  << std::setw(30) << SPACE << "\n";
745  } // End of loop through the bands.
746 
747  os << std::resetiosflags(std::ios_base::right);
748 
749  os.seekp(2256, std::ios_base::beg);
750 
751  os << std::setw(79) << SPACE << "\n";
752  os << std::setw(79) << SPACE << "\n";
753  os << std::setw(79) << SPACE << "\n";
754  os << std::setw(79) << SPACE << "\n";
755  os << std::setw(79) << SPACE << "\n";
756  os << std::setw(79) << SPACE << "\n";
757  os << std::setw(79) << SPACE << "\n";
758  os << std::setw(79) << SPACE << "\n";
759  os << std::setw(79) << SPACE << "\n";
760  os << std::setw(79) << SPACE << "\n";
761  os << std::setw(15) << SPACE << "\n";
762 
763  //***
764  // End of radiometric record(bytes 1536 to 3071).
765  //***
766 
767  //**
768  // Start of geometric record(bytes 3072 to 4607).
769  //***
770 
771  os.seekp(3072, std::ios_base::beg); // Start of record.
772 
773  os << GEO_DESC
774 
775  << MAP_PROJECTION_NAME_DESC
776 
777  << std::setiosflags(std::ios_base::left) // Alpha fields left justified.
778 
779  << std::setw(MAP_PROJECTION_NAME_SIZE)
781 
782  << ELLIPSOID_DESC // Looks like this has changed.
783 
784  << std::setw(ELLIPSOID_SIZE)
786 
787  << DATUM_DESC
788 
789  << std::setw(DATUM_SIZE)
791 
792  << std::resetiosflags(std::ios_base::left)
793 
794  << "\n" // End of line
795 
796  << PROJECTION_PARAMETER_DESC
797  << SPACE;
798 
799  os.seekp(PROJ_PARAM_OFFSET[0], std::ios_base::beg);
800  os << std::setprecision(15)
801  << std::setiosflags(std::ios_base::right)
802 
803  << std::setw(PROJECTION_PARAMETER_SIZE)
805  << SPACE;
806 
807  os.seekp(PROJ_PARAM_OFFSET[1], std::ios_base::beg);
808  os << std::setw(PROJECTION_PARAMETER_SIZE)
810  << std::setw(1) << SPACE << "\n";
811 
812  //***
813  // Code is duplicated every three projection parameter four times;
814  // hence, the double loop.
815  //***
816  for (i = 0; i < 4; i++)
817  {
818  for (int j = i * 3 + 2; j < (i * 3) + 5; j++)
819  {
820  os.seekp(PROJ_PARAM_OFFSET[j], std::ios_base::beg);
821 
822  os << std::setw(PROJECTION_PARAMETER_SIZE)
824  << std::setw(1) << SPACE;
825 
826  os.seekp(PROJ_PARAM_OFFSET[j], std::ios_base::beg);
827  os << std::setw(PROJECTION_PARAMETER_SIZE)
829  << std::setw(1) << SPACE;
830 
831  os.seekp(PROJ_PARAM_OFFSET[j], std::ios_base::beg);
832  os << std::setw(PROJECTION_PARAMETER_SIZE)
834  << std::setw(5) << SPACE << "\n";
835  }
836  }
837 
838  os.seekp(PROJ_PARAM_OFFSET[14], std::ios_base::beg);
839  os << std::setw(PROJECTION_PARAMETER_SIZE)
841  << std::setw(55) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
842 
843 
844  os.seekp(3632, std::ios_base::beg);
845  os << UL_DESC
846 
847  << SPACE
848 
849  << std::setw(LON_SIZE) << theGeoRecord.theUlLon
850 
851  << SPACE
852 
853  << std::setw(LAT_SIZE) << theGeoRecord.theUlLat
854 
855  << SPACE
856 
857  << std::setprecision(3)
858 
859  << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right)
861 
862  << SPACE
863 
864  << std::setw(NORTHING_SIZE)
866 
867  << std::setw(20) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
868 
869 
870  os.seekp(3712, std::ios_base::beg);
871  os << UR_DESC
872 
873  << SPACE
874 
875  << std::setw(LON_SIZE) << theGeoRecord.theUrLon
876 
877  << SPACE
878 
879  << std::setw(LAT_SIZE) << theGeoRecord.theUrLat
880 
881  << SPACE
882 
883  << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right)
885 
886  << SPACE
887 
888  << std::setw(NORTHING_SIZE)
890 
891  << std::setw(20) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
892 
893 
894  os.seekp(3792, std::ios_base::beg);
895  os << LR_DESC
896 
897  << SPACE
898 
899  << std::setw(LON_SIZE) << theGeoRecord.theLrLon
900 
901  << SPACE
902 
903  << std::setw(LAT_SIZE) << theGeoRecord.theLrLat
904 
905  << SPACE
906 
907  << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right)
909 
910  << SPACE
911 
912  << std::setw(NORTHING_SIZE)
914 
915  << std::setw(20) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
916 
917 
918  os.seekp(3872, std::ios_base::beg);
919  os << LL_DESC
920 
921  << SPACE
922 
923  << std::setw(LON_SIZE) << theGeoRecord.theLlLon
924 
925  << SPACE
926 
927  << std::setw(LAT_SIZE) << theGeoRecord.theLlLat
928 
929  << SPACE
930 
931  << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right)
933 
934  << SPACE
935 
936  << std::setw(NORTHING_SIZE)
938 
939  << std::setw(20) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
940 
941  os.seekp(3952, std::ios_base::beg);
942  os << CENTER_DESC
943 
944  << SPACE
945 
946  << std::setw(LON_SIZE)
948 
949  << SPACE
950 
951  << std::setw(LAT_SIZE)
953 
954  << SPACE
955 
956  << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right)
958 
959  << SPACE
960 
961  << std::setw(NORTHING_SIZE)
963 
964  << SPACE
965 
966  << std::setw(CENTER_SAMPLE_SIZE)
968 
969  << SPACE
970 
971  << std::setw(CENTER_LINE_SIZE)
973 
974  << std::setw(4) << SPACE << "\n";
975 
976  os.seekp(4032, std::ios_base::beg);
977  os << HORIZONTAL_OFFSET_DESC
978 
979  << std::setw(HORIZONTAL_OFFSET_SIZE)
981 
982  << ORIENTATION_ANGLE_DESC
983 
984  << std::setw(ORIENTATION_ANGLE_SIZE)
985  << std::setprecision(2)
987 
988  << std::setw(39) << SPACE << "\n"; // 41 in spec
989 
990  os.seekp(4112, std::ios_base::beg);
991  os << SUN_ELEVATION_DESC
992 
993  << std::setw(SUN_ELEVATION_SIZE)
994  << std::setprecision(1)
996 
997  << SUN_AZIMUTH_DESC
998 
999  << std::setw(SUN_AZIMUTH_SIZE)
1000  << std::setprecision(1)
1001  << theGeoRecord.theSunAzimuth // End of data.
1002 
1003  << std::setw(29) << SPACE << "\n"
1004  << std::setw(79) << SPACE << "\n"
1005  << std::setw(79) << SPACE << "\n"
1006  << std::setw(79) << SPACE << "\n"
1007  << std::setw(79) << SPACE << "\n"
1008  << std::setw(79) << SPACE << "\n"
1009  << std::setw(15) << SPACE << "\n" << std::flush; // ? size
1010 
1011  //***
1012  // End of geometric record(bytes 3072 to 4607).
1013  //***
1014 
1015 }
1016 
1017 
1018 //***************************************************************************
1019 // PRIVATE METHOD:
1020 // ossimFfRevc::loadFromStream(istream& is)
1021 //***************************************************************************
1023 {
1024  //***
1025  // See .h for enumerations for field sizes and offsets.
1026  //***
1027 
1028  //***
1029  // NOTE: Because of header inconsistencies all seeks will be relative to
1030  // the beginning of the stream.
1031  //***
1032 
1033  //***
1034  // Temporary buffer for fields that need to be converted to integers or
1035  // floats.
1036  //***
1037 
1038  char tmpBuff[25];
1039 
1040  //***
1041  // Start of administrative record.
1042  //***
1043 
1044  is.seekg(PRODUCT_ORDER_NUMBER_OFFSET, std::ios_base::beg);
1045 
1048  ' ');
1049 
1050  if (checkStream(is)) return;
1051 
1052  //***
1053  // Loop through the four scenes and get the data.
1054  //***
1055 
1056  int i;
1057  for (i = 0; i < NUMBER_OF_SCENES; i++)
1058  {
1059 
1060  is.seekg(PATH_ROW_NUMBER_OFFSET[i], std::ios_base::beg);
1061 
1063 
1064  if (checkStream(is)) return;
1065 
1066  is.seekg(DATE_OFFSET[i], std::ios_base::beg);
1067 
1069 
1070  if (checkStream(is)) return;
1071 
1072  is.seekg(SAT_NAME_OFFSET[i], std::ios_base::beg);
1073 
1074  is.get(theAdminRecord.theSatName[i], SAT_NAME_SIZE + 1);
1075 
1076  if (checkStream(is)) return;
1077 
1078  is.seekg(SENSOR_NAME_OFFSET[i], std::ios_base::beg);
1079 
1081 
1082  if (checkStream(is)) return;
1083 
1084  is.seekg(SENSOR_MODE_OFFSET[i], std::ios_base::beg);
1085 
1087 
1088  if (checkStream(is)) return;
1089 
1090  is.seekg(OFF_NADIR_ANGLE_OFFSET[i], std::ios_base::beg);
1091 
1092  is.get(tmpBuff, OFF_NADIR_ANGLE_SIZE + 1);
1093 
1094  if (checkStream(is)) return;
1095 
1096  theAdminRecord.theOffNadirAngle[i] = atof(tmpBuff);
1097 
1098  } // End of scene loop.
1099 
1100  is.seekg(PRODUCT_TYPE_OFFSET, std::ios_base::beg);
1101 
1103 
1104  if (checkStream(is)) return;
1105 
1106  is.seekg(PRODUCT_SIZE_OFFSET, std::ios_base::beg);
1107 
1109 
1110  if (checkStream(is)) return;
1111 
1112  is.seekg(PROCESSING_TYPE_OFFSET, std::ios_base::beg);
1113 
1115 
1116  if (checkStream(is)) return;
1117 
1118  is.seekg(RESAMPLING_ALGO_OFFSET, std::ios_base::beg);
1119 
1121 
1122  if (checkStream(is)) return;
1123 
1124  is.seekg(TAPE_VOLUME_NUMBER_OFFSET, std::ios_base::beg);
1125 
1126  is.get(tmpBuff, TAPE_VOLUME_NUMBER_SIZE + 1, '/');
1127 
1128  if (checkStream(is)) return;
1129 
1130  theAdminRecord.theTapeVolumeNumber = atoi(tmpBuff);
1131 
1132  is.seekg(VOLUMES_PER_TAPE_OFFSET, std::ios_base::beg);
1133 
1134  is.get(tmpBuff, VOLUMES_PER_TAPE_SIZE + 1);
1135 
1136  if (checkStream(is)) return;
1137 
1138  theAdminRecord.theNumberVolumesPerTape = atoi(tmpBuff);
1139 
1140  is.seekg(PIXELS_PER_LINE_OFFSET, std::ios_base::beg);
1141 
1142  is.get(tmpBuff, PIXELS_PER_LINE_SIZE + 1);
1143 
1144  if (checkStream(is)) return;
1145 
1146  theAdminRecord.thePixelsPerLine = atoi(tmpBuff);
1147 
1148  is.seekg(LINES_PER_IMAGE_OFFSET, std::ios_base::beg);
1149 
1150  is.get(tmpBuff, LINES_PER_IMAGE_SIZE + 1);
1151 
1152  if (checkStream(is)) return;
1153 
1154  theAdminRecord.theLinesPerImage = atoi(tmpBuff);
1155 
1156  is.seekg(FIRST_LINE_IN_VOLUME_OFFSET, std::ios_base::beg);
1157 
1158  is.get(tmpBuff, FIRST_LINE_IN_VOLUME_SIZE + 1);
1159 
1160  if (checkStream(is)) return;
1161 
1162  theAdminRecord.the1stLineInVolume = atoi(tmpBuff);
1163 
1164  is.seekg(BLOCKING_FACTOR_OFFSET, std::ios_base::beg);
1165 
1166  is.get(tmpBuff, BLOCKING_FACTOR_SIZE + 1);
1167 
1168  if (checkStream(is)) return;
1169 
1170  theAdminRecord.theTapeBlockingFactor = atoi(tmpBuff);
1171 
1172  is.seekg(RECORD_LENGTH_OFFSET, std::ios_base::beg);
1173 
1174  is.get(tmpBuff, RECORD_LENGTH_SIZE + 1);
1175 
1176  if (checkStream(is)) return;
1177 
1178  theAdminRecord.theRecordSize = atoi(tmpBuff);
1179 
1180  is.seekg(PIXEL_GSD_OFFSET, std::ios_base::beg);
1181 
1182  is.get(tmpBuff, PIXEL_GSD_SIZE + 1);
1183 
1184  if (checkStream(is)) return;
1185 
1186  theAdminRecord.theGsd = atof(tmpBuff);
1187 
1188  is.seekg(BITS_PER_PIXEL_OFFSET, std::ios_base::beg);
1189 
1190  is.get(tmpBuff, BITS_PER_PIXEL_SIZE + 1);
1191 
1192  if (checkStream(is)) return;
1193 
1194  theAdminRecord.theOutputBitsPerPixel = atoi(tmpBuff);
1195 
1196  is.seekg(ACQUIRED_BITS_PER_PIXEL_OFFSET, std::ios_base::beg);
1197 
1198  is.get(tmpBuff, BITS_PER_PIXEL_SIZE + 1);
1199 
1200  if (checkStream(is)) return;
1201 
1202  theAdminRecord.theAcquiredBitsPerPixel = atoi(tmpBuff);
1203 
1204  is.seekg(BANDS_PRESENT_OFFSET, std::ios_base::beg);
1205 
1207 
1208  if (checkStream(is)) return;
1209 
1210  is.seekg(FORMAT_VERSION_OFFSET, std::ios_base::beg);
1211 
1213 
1214  if (checkStream(is)) return;
1215  //***
1216  // End of administrative record.
1217  //***
1218 
1219  //***
1220  // Start of radiometric record.
1221  //***
1222 
1223  for (i = 0; i < NUMBER_OF_BANDS; i++)
1224  {
1225  is.seekg(BIAS_OFFSET[i], std::ios_base::beg);
1226 
1227  is.get(tmpBuff, BIAS_SIZE + 1);
1228 
1229  if (checkStream(is)) return;
1230 
1231  theRadiomRecord.theBias[i] = atof(tmpBuff);
1232 
1233  is.seekg(GAIN_OFFSET[i], std::ios_base::beg);
1234 
1235  is.get(tmpBuff, GAIN_SIZE + 1);
1236 
1237  if (checkStream(is)) return;
1238 
1239  theRadiomRecord.theGain[i] = atof(tmpBuff);
1240  }
1241  //***
1242  // End of radiometric record.
1243  //***
1244 
1245  //***
1246  // Start of geometric record.
1247  //***
1248 
1249  is.seekg(MAP_PROJECTION_NAME_OFFSET, std::ios_base::beg);
1250 
1252 
1253  if (checkStream(is)) return;
1254 
1255  is.seekg(ELLIPSOID_OFFSET, std::ios_base::beg);
1256 
1258 
1259  if (checkStream(is)) return;
1260 
1261  is.seekg(DATUM_OFFSET, std::ios_base::beg);
1262 
1263  is.get(theGeoRecord.theDatum, DATUM_SIZE + 1, ' ');
1264 
1265  if (checkStream(is)) return;
1266 
1267  //***
1268  // Get the fifteen projection parameters.
1269  //***
1270 
1271  for(i = 0; i < 15; i++)
1272  {
1273  is.seekg(PROJ_PARAM_OFFSET[i], std::ios_base::beg);
1274 
1275  is.get(tmpBuff, PROJECTION_PARAMETER_SIZE + 1);
1276 
1277  if (checkStream(is)) return;
1278 
1279  theGeoRecord.theProjectionParams[i] = atof(tmpBuff);
1280  }
1281 
1282  //***
1283  // Start of upper left data: longitude, latitude, easting, and northing.
1284  //***
1285  is.seekg(UL_LON_OFFSET, std::ios_base::beg);
1286 
1287  is.get(theGeoRecord.theUlLon, LON_SIZE + 1);
1288 
1289  if (checkStream(is)) return;
1290 
1291  is.seekg(UL_LAT_OFFSET, std::ios_base::beg);
1292 
1293  is.get(theGeoRecord.theUlLat, LAT_SIZE + 1);
1294 
1295  if (checkStream(is)) return;
1296 
1297  is.seekg(UL_EASTING_OFFSET, std::ios_base::beg);
1298 
1299  is.get(tmpBuff, EASTING_SIZE + 1);
1300 
1301  if (checkStream(is)) return;
1302 
1303  theGeoRecord.theUlEasting = atof(tmpBuff);
1304 
1305  is.seekg(UL_NORTHING_OFFSET, std::ios_base::beg);
1306 
1307  is.get(tmpBuff, NORTHING_SIZE + 1);
1308 
1309  if (checkStream(is)) return;
1310 
1311  theGeoRecord.theUlNorthing = atof(tmpBuff);
1312 
1313  //***
1314  // End of upper left data.
1315  //***
1316 
1317  //***
1318  // Start of upper right data: longitude, latitude, easting, and northing.
1319  //***
1320  is.seekg(UR_LON_OFFSET, std::ios_base::beg);
1321 
1322  is.get(theGeoRecord.theUrLon, LON_SIZE + 1);
1323 
1324  if (checkStream(is)) return;
1325 
1326  is.seekg(UR_LAT_OFFSET, std::ios_base::beg);
1327 
1328  is.get(theGeoRecord.theUrLat, LAT_SIZE + 1);
1329 
1330  if (checkStream(is)) return;
1331 
1332  is.seekg(UR_EASTING_OFFSET, std::ios_base::beg);
1333 
1334  is.get(tmpBuff, EASTING_SIZE + 1);
1335 
1336  if (checkStream(is)) return;
1337 
1338  theGeoRecord.theUrEasting = atof(tmpBuff);
1339 
1340  is.seekg(UR_NORTHING_OFFSET, std::ios_base::beg);
1341 
1342  is.get(tmpBuff, NORTHING_SIZE + 1);
1343 
1344  if (checkStream(is)) return;
1345 
1346  theGeoRecord.theUrNorthing = atof(tmpBuff);
1347 
1348  //***
1349  // End of upper right data.
1350  //***
1351 
1352  //***
1353  // Start of lower right data: longitude, latitude, easting, and northing.
1354  //***
1355  is.seekg(LR_LON_OFFSET, std::ios_base::beg);
1356 
1357  is.get(theGeoRecord.theLrLon, LON_SIZE + 1);
1358 
1359  if (checkStream(is)) return;
1360 
1361  is.seekg(LR_LAT_OFFSET, std::ios_base::beg);
1362 
1363  is.get(theGeoRecord.theLrLat, LAT_SIZE + 1);
1364 
1365  if (checkStream(is)) return;
1366 
1367  is.seekg(LR_EASTING_OFFSET, std::ios_base::beg);
1368 
1369  is.get(tmpBuff, EASTING_SIZE + 1);
1370 
1371  if (checkStream(is)) return;
1372 
1373  theGeoRecord.theLrEasting = atof(tmpBuff);
1374 
1375  is.seekg(LR_NORTHING_OFFSET, std::ios_base::beg);
1376 
1377  is.get(tmpBuff, NORTHING_SIZE + 1);
1378 
1379  if (checkStream(is)) return;
1380 
1381  theGeoRecord.theLrNorthing = atof(tmpBuff);
1382 
1383  //***
1384  // End of lower right data.
1385  //***
1386 
1387  //***
1388  // Start of lower left data: longitude, latitude, easting, and northing.
1389  //***
1390  is.seekg(LL_LON_OFFSET, std::ios_base::beg);
1391 
1392  is.get(theGeoRecord.theLlLon, LON_SIZE + 1);
1393 
1394  if (checkStream(is)) return;
1395 
1396  is.seekg(LL_LAT_OFFSET, std::ios_base::beg);
1397 
1398  is.get(theGeoRecord.theLlLat, LAT_SIZE + 1);
1399 
1400  if (checkStream(is)) return;
1401 
1402  is.seekg(LL_EASTING_OFFSET, std::ios_base::beg);
1403 
1404  is.get(tmpBuff, EASTING_SIZE + 1);
1405 
1406  if (checkStream(is)) return;
1407 
1408  theGeoRecord.theLlEasting = atof(tmpBuff);
1409 
1410  is.seekg(LL_NORTHING_OFFSET, std::ios_base::beg);
1411 
1412  is.get(tmpBuff, NORTHING_SIZE + 1);
1413 
1414  if (checkStream(is)) return;
1415 
1416  theGeoRecord.theLlNorthing = atof(tmpBuff);
1417 
1418  //***
1419  // End of lower left data.
1420  //***
1421 
1422  //***
1423  // Start of scene center data: longitude, latitude, easting, northing,
1424  // sample, line.
1425  //***
1426  is.seekg(CENTER_LON_OFFSET, std::ios_base::beg);
1427 
1428  is.get(theGeoRecord.theCenterLon, LON_SIZE + 1);
1429 
1430  if (checkStream(is)) return;
1431 
1432  is.seekg(CENTER_LAT_OFFSET, std::ios_base::beg);
1433 
1434  is.get(theGeoRecord.theCenterLat, LAT_SIZE + 1);
1435 
1436  if (checkStream(is)) return;
1437 
1438  is.seekg(CENTER_EASTING_OFFSET, std::ios_base::beg);
1439 
1440  is.get(tmpBuff, EASTING_SIZE + 1);
1441 
1442  if (checkStream(is)) return;
1443 
1444  theGeoRecord.theCenterEasting = atof(tmpBuff);
1445 
1446  is.seekg(CENTER_NORTHING_OFFSET, std::ios_base::beg);
1447 
1448  is.get(tmpBuff, NORTHING_SIZE + 1);
1449 
1450  if (checkStream(is)) return;
1451 
1452  theGeoRecord.theCenterNorthing = atof(tmpBuff);
1453 
1454  is.seekg(CENTER_SAMPLE_OFFSET, std::ios_base::beg);
1455 
1456  is.get(tmpBuff, CENTER_SAMPLE_SIZE + 1);
1457 
1458  if (checkStream(is)) return;
1459 
1460  theGeoRecord.theCenterSample = atoi(tmpBuff);
1461 
1462  is.seekg(CENTER_LINE_OFFSET, std::ios_base::beg);
1463 
1464  is.get(tmpBuff, CENTER_LINE_SIZE + 1);
1465 
1466  if (checkStream(is)) return;
1467 
1468  theGeoRecord.theCenterLine = atoi(tmpBuff);
1469 
1470  //***
1471  // End of scene center data.
1472  //***
1473 
1474  is.seekg(HORIZONTAL_OFFSET_OFFSET, std::ios_base::beg);
1475 
1476  is.get(tmpBuff, HORIZONTAL_OFFSET_SIZE + 1);
1477 
1478  if (checkStream(is)) return;
1479 
1480  theGeoRecord.theHorizontalOffset = atoi(tmpBuff);
1481 
1482  is.seekg(ORIENTATION_ANGLE_OFFSET, std::ios_base::beg);
1483 
1484  is.get(tmpBuff, ORIENTATION_ANGLE_SIZE + 1);
1485 
1486  if (checkStream(is)) return;
1487 
1488  theGeoRecord.theOrientationAngle = atof(tmpBuff);
1489 
1490  is.seekg(SUN_ELEVATION_OFFSET, std::ios_base::beg);
1491 
1492  is.get(tmpBuff, SUN_ELEVATION_SIZE + 1);
1493 
1494  if (checkStream(is)) return;
1495 
1496  theGeoRecord.theSunElevationAngle = atof(tmpBuff);
1497 
1498  is.seekg(SUN_AZIMUTH_OFFSET, std::ios_base::beg);
1499 
1500  is.get(tmpBuff, SUN_AZIMUTH_SIZE + 1);
1501 
1502  if (checkStream(is)) return;
1503 
1504  theGeoRecord.theSunAzimuth = atof(tmpBuff);
1505 
1506  //***
1507  // End of geometric record.
1508  //***
1509 
1510 }
1511 
1512 //***************************************************************************
1513 // PRIVATE METHOD:
1514 // ossimFfRevc::checkStream(istream& is)
1515 //
1516 // Checks the stream. If an error has occurred it sets theErrorStatus.
1517 // Returns: theErrorStatus ( 0 = OK, 1 = ERROR )
1518 //***************************************************************************
1520 {
1521  //***
1522  // istreams set fault bits and the operator! is overloaded to return
1523  // true if an error has occurred.
1524  //***
1525 
1526  if (!is)
1527  {
1529 
1530  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevc::checkStream: "
1531  << "Stream corrupted. Returning from method."
1532  << std::endl;
1533  }
1534 
1535  return theErrorStatus;
1536 }
1537 
1538 //***************************************************************************
1539 // Function:
1540 // ostream& operator<<(ostream& os, const ossimFfRevc& head)
1541 //***************************************************************************
1543 {
1544  head.print(os);
1545 
1546  return os;
1547 }
1548 
1549 //***************************************************************************
1550 // CONSTRUCTOR:
1551 // ossimFfRevc::AdminRecord::AdminRecord()
1552 //
1553 // Default constructor for AdminRecord nested class:
1554 //***************************************************************************
1556  :
1557  theTapeVolumeNumber(1),
1558  theNumberVolumesPerTape(1),
1559  thePixelsPerLine(0),
1560  theLinesPerImage(0),
1561  the1stLineInVolume(1),
1562  theTapeBlockingFactor(1),
1563  theRecordSize(0),
1564  theGsd(0.0),
1565  theOutputBitsPerPixel(8),
1566  theAcquiredBitsPerPixel(6)
1567 {
1568  const char tmpBuff[] = "";
1569 
1570  strcpy(theProductOrderNumber, tmpBuff);
1571 
1572  //>
1573  // There can be four scenes.
1574  //<
1575 
1576  for (int i = 0; i < 4; i++)
1577  {
1578  strcpy(thePathRowNumber[i], tmpBuff);
1579  strcpy(theAcquisitionDate[i], tmpBuff);
1580  strcpy(theSatName[i], tmpBuff);
1581  strcpy(theSensorName[i], tmpBuff);
1582  strcpy(theSensorMode[i], tmpBuff);
1583  theOffNadirAngle[i] = 0.0;
1584  }
1585  strcpy(theProductType, "MAP ORIENTED");
1586  strcpy(theProductSize, tmpBuff);
1587  strcpy(theProcessingType, "SYSTEMATIC");
1588  strcpy(theResampAlgorithm, "CC");
1589  strcpy(theBandsPresentString, "P");
1590  strcpy(theFormatVersion, "C");
1591 }
1592 
1593 //***************************************************************************
1594 // CONSTRUCTOR:
1595 // ossimFfRevc::RadiomRecord::RadiomRecord()
1596 //
1597 // Default constructor for RadiomRecord nested class:
1598 //***************************************************************************
1600 {
1601  for (int i = 0; i < 8; i++)
1602  {
1603  theBias[i] = 0.0;
1604  theGain[i] = 0.0;
1605  }
1606 }
1607 
1608 //***************************************************************************
1609 // CONSTRUCTOR:
1610 // ossimFfRevc::GeoRecord::GeomRecord()
1611 //
1612 // Default constructor for GeoRecord nested class:
1613 //***************************************************************************
1615  :
1616  theUlEasting(0.0),
1617  theUlNorthing(0.0),
1618  theUrEasting(0.0),
1619  theUrNorthing(0.0),
1620  theLrEasting(0.0),
1621  theLrNorthing(0.0),
1622  theLlEasting(0.0),
1623  theLlNorthing(0.0),
1624  theCenterEasting(0.0),
1625  theCenterNorthing(0.0),
1626  theCenterSample(0),
1627  theCenterLine(0),
1628  theHorizontalOffset(0),
1629  theOrientationAngle(0.0),
1630  theSunElevationAngle(0.0),
1631  theSunAzimuth(0.0)
1632 {
1633  for (int i = 0; i < 15; i++)
1634  {
1635  theProjectionParams[i] = 0.0;
1636  }
1637 
1638  const char tmpBuff[] = "";
1639 
1640  strcpy(theMapProjectionName, "UTM");
1641  strcpy(theEllipsoid, tmpBuff);
1642  strcpy(theDatum, tmpBuff);
1643  strcpy(theUlLon, tmpBuff);
1644  strcpy(theUlLat, tmpBuff);
1645  strcpy(theUrLon, tmpBuff);
1646  strcpy(theUrLat, tmpBuff);
1647  strcpy(theLrLon, tmpBuff);
1648  strcpy(theLrLat, tmpBuff);
1649  strcpy(theLlLon, tmpBuff);
1650  strcpy(theLlLat, tmpBuff);
1651  strcpy(theCenterLon, tmpBuff);
1652  strcpy(theCenterLat, tmpBuff);
1653 }
double theProjectionParams[15]
Definition: ossimFfRevc.h:263
void print(std::ostream &os) const
std::ostream & operator<<(std::ostream &os, const ossimFfRevc &head)
const int OFF_NADIR_ANGLE_OFFSET[4]
Definition: ossimFfRevc.cpp:50
char theProductOrderNumber[PRODUCT_ORDER_NUMBER_SIZE+1]
Definition: ossimFfRevc.h:208
RadiomRecord theRadiomRecord
Definition: ossimFfRevc.h:299
char theProductType[PRODUCT_TYPE_SIZE+1]
Definition: ossimFfRevc.h:223
char theLrLon[LON_SIZE+1]
Definition: ossimFfRevc.h:275
ossimString subScene(int sceneNbr=0) const
char theUlLat[LAT_SIZE+1]
Definition: ossimFfRevc.h:266
void loadFromStream(ossim::istream &is)
static StreamFactoryRegistry * instance()
char theUrLat[LAT_SIZE+1]
Definition: ossimFfRevc.h:271
int checkStream(ossim::istream &is)
#define SPACE
Definition: vpfio.h:25
char theMapProjectionName[MAP_PROJECTION_NAME_SIZE+1]
Definition: ossimFfRevc.h:260
AdminRecord theAdminRecord
Definition: ossimFfRevc.h:298
const int SENSOR_MODE_OFFSET[4]
Definition: ossimFfRevc.cpp:45
int row(int sceneNbr=0) const
int path(int sceneNbr=0) const
void write(std::ostream &os) const
const int DATE_OFFSET[4]
Definition: ossimFfRevc.cpp:30
const int LOCATION_OFFSET[4]
Definition: ossimFfRevc.cpp:20
char theProcessingType[PROCESSING_TYPE_SIZE+1]
Definition: ossimFfRevc.h:227
const int SENSOR_NAME_OFFSET[4]
Definition: ossimFfRevc.cpp:40
ErrorStatus theErrorStatus
Definition: ossimFfRevc.h:343
char theProductSize[PRODUCT_SIZE_SIZE+1]
Definition: ossimFfRevc.h:224
char theResampAlgorithm[RESAMPLING_ALGO_SIZE+1]
Definition: ossimFfRevc.h:228
char theLlLon[LON_SIZE+1]
Definition: ossimFfRevc.h:280
char thePathRowNumber[NUMBER_OF_SCENES][PATH_ROW_NUMBER_SIZE+1]
Definition: ossimFfRevc.h:210
char theDatum[DATUM_SIZE+1]
Definition: ossimFfRevc.h:262
double theOffNadirAngle[NUMBER_OF_SCENES]
Definition: ossimFfRevc.h:221
char theUlLon[LON_SIZE+1]
Definition: ossimFfRevc.h:265
char theCenterLon[LON_SIZE+1]
Definition: ossimFfRevc.h:285
char theEllipsoid[ELLIPSOID_SIZE+1]
Definition: ossimFfRevc.h:261
char theLlLat[LAT_SIZE+1]
Definition: ossimFfRevc.h:281
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
char theUrLon[LON_SIZE+1]
Definition: ossimFfRevc.h:270
char theLrLat[LAT_SIZE+1]
Definition: ossimFfRevc.h:276
const int PATH_ROW_NUMBER_OFFSET[4]
Definition: ossimFfRevc.cpp:25
const int GAIN_OFFSET[8]
Definition: ossimFfRevc.cpp:65
char theSatName[NUMBER_OF_SCENES][SAT_NAME_SIZE+1]
Definition: ossimFfRevc.h:214
ossimString pathRow(int sceneNbr=0) const
int fraction(int sceneNbr=0) const
GeoRecord theGeoRecord
Definition: ossimFfRevc.h:300
ossimString & gsub(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false)
Substitutes searchKey string with replacementValue and returns a reference to *this.
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
char theSensorName[NUMBER_OF_SCENES][SENSOR_NAME_SIZE+1]
Definition: ossimFfRevc.h:217
const int SAT_NAME_OFFSET[4]
Definition: ossimFfRevc.cpp:35
const int BIAS_OFFSET[8]
Definition: ossimFfRevc.cpp:56
char theFormatVersion[FORMAT_VERSION_SIZE+1]
Definition: ossimFfRevc.h:240
char theCenterLat[LAT_SIZE+1]
Definition: ossimFfRevc.h:286
char theAcquisitionDate[NUMBER_OF_SCENES][DATE_SIZE+1]
Definition: ossimFfRevc.h:211
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
char theBandsPresentString[BANDS_PRESENT_SIZE+1]
Definition: ossimFfRevc.h:239
char theSensorMode[NUMBER_OF_SCENES][SENSOR_MODE_SIZE+1]
Definition: ossimFfRevc.h:220