OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFfRevc.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
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 
12 #ifndef ossimFfRevc_HEADER
13 #define ossimFfRevc_HEADER 1
14 
15 #include <ossim/base/ossimIosFwd.h>
16 
17 // Forward class declarations.
18 class ossimString;
19 
20 //***************************************************************************
21 // CLASS: ossimFfRevc.h
22 //***************************************************************************
23 
25 {
26 public:
27  ossimFfRevc ();
28  ossimFfRevc (const char* headerFile);
30 
32  {
33  OSSIM_OK = 0,
35  };
36 
37  //>
38  // Enumerations for parsing header. Contains size in bytes
39  // for all fields.
40  //
41  // NOTE: Sizes are the actual number of bytes for that field so add
42  // one for trailing '\0' to get the string length for the
43  // data member that are character arrays.
44  //<
45 
46  enum
47  {
51  };
52 
53  enum
54  {
55  // Adminstrative record:
61  DATE_SIZE = 8,
94  BITS_PER_PIXEL_SIZE = 2, // Output and Acquired
100  // Radiometric record:
102  BIAS_SIZE = 24,
103  GAIN_SIZE = 24,
104  // Geometric record:
116  LON_SIZE = 13,
117  LAT_SIZE = 12,
130  };
131 
132  //---
133  //>
134  // Enumerations for byte offsets in header. All offsets are relative to
135  // the first byte of the first record which is byte 0.
136  //<
137 
138  enum
139  {
140  // Administrative record: bytes 0 - 1535
158  // Radiometric record: bytes 1536 - 3071
159  // See file scope constants for bias and gain OFFSET positions.
160  // Geometric record: bytes 3072 - 4607
163  DATUM_OFFSET = 3145,
190  };
191 
192  //---
193  //>
194  // An EOSAT Fast Format Rev C header consists of three
195  // records: administrative, radiometric and geometric
196  // each record has a class defined for it to hold the pertinent
197  // data.
198  //<
199 
201  {
202  public:
203  AdminRecord();
205 
206  // Data Members for record.
207 
209 
212  //> yyyyddmm
213  //<
215  //> L4, L5, 1B, 1C
216  //<
218  //> TM, LISS1 LISS2, LISS3, PAN, WIFS
219  //<
221  double theOffNadirAngle[NUMBER_OF_SCENES]; // degrees
222 
223  char theProductType[PRODUCT_TYPE_SIZE + 1]; // MAP or ORBIT oriented
224  char theProductSize[PRODUCT_SIZE_SIZE + 1]; // FULL, SUB, MAP
225  //> SYSTEMATIC, PRECISION, TERRAIN RADIOMETRIC
226  //<
236  double theGsd; // pixel size in meters
241  };
242 
244  {
245  public:
246  RadiomRecord();
248 
249 
250  double theBias[8];
251  double theGain[8];
252  };
253 
254  class GeoRecord
255  {
256  public:
257  GeoRecord();
259 
262  char theDatum[DATUM_SIZE + 1];
264 
265  char theUlLon[LON_SIZE + 1]; // deg, min, sec
266  char theUlLat[LAT_SIZE + 1]; // deg, min, sec
267  double theUlEasting;
269 
270  char theUrLon[LON_SIZE + 1]; // deg, min, sec
271  char theUrLat[LAT_SIZE + 1]; // deg, min, sec
272  double theUrEasting;
274 
275  char theLrLon[LON_SIZE + 1]; // deg, min, sec
276  char theLrLat[LAT_SIZE + 1]; // deg, min, sec
277  double theLrEasting;
279 
280  char theLlLon[LON_SIZE + 1]; // deg, min, sec
281  char theLlLat[LAT_SIZE + 1]; // deg, min, sec
282  double theLlEasting;
284 
285  char theCenterLon[LON_SIZE + 1]; // deg, min, sec
286  char theCenterLat[LAT_SIZE + 1]; // deg, min, sec
289  int theCenterSample; // Nearest whole pixel.
290  int theCenterLine; // Nearest whole pixel.
291 
292  int theHorizontalOffset; // pixels
293  double theOrientationAngle; // degrees
294  double theSunElevationAngle; // degrees
295  double theSunAzimuth; // degrees
296  };
297 
301 
302  int errorStatus() const { return theErrorStatus; }
303 
304  void print(std::ostream& os) const;
305 
306  void write(std::ostream& os) const;
307 
308  friend std::ostream& operator<<(std::ostream& os, const ossimFfRevc& head);
309 
310 
311  //>
312  // Convenience methods.
313  //<
314 
315  int path(int sceneNbr=0) const;
316  //> Returns the path as an int.
317  // Currently uses the1stPathRowNumber string.
318  //<
319  int row(int sceneNbr=0) const;
320  //> Returns the row as an int from the pathRowString.
321  // Currently uses the1stPathRowNumber string.
322  //<
323  int fraction(int sceneNbr=0) const;
324  //> Returns the fraction as an int from the pathRowString.
325  // Currently uses the1stPathRowNumber string.
326  //<
327  ossimString subScene(int sceneNbr=0) const;
328  //> Returns the sub scene as an string from the pathRowString.
329  // Currently uses the1stPathRowNumber string.
330  //<
331 
332  ossimString pathRow(int sceneNbr=0) const;
333  //> Returns a string represnting the path and row as a name.
334  // i.e.: 287/05100D0 will be returned as p287r05100D0
335  // This method will remove any spaces.
336  //<
337 
338 private:
339  void loadFromStream(ossim::istream& is);
340 
341  int checkStream(ossim::istream& is);
342 
344 };
345 
346 #endif
double theProjectionParams[15]
Definition: ossimFfRevc.h:263
void print(std::ostream &os) const
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)
char theUrLat[LAT_SIZE+1]
Definition: ossimFfRevc.h:271
int checkStream(ossim::istream &is)
char theMapProjectionName[MAP_PROJECTION_NAME_SIZE+1]
Definition: ossimFfRevc.h:260
AdminRecord theAdminRecord
Definition: ossimFfRevc.h:298
int row(int sceneNbr=0) const
int errorStatus() const
Definition: ossimFfRevc.h:302
friend std::ostream & operator<<(std::ostream &os, const ossimFfRevc &head)
int path(int sceneNbr=0) const
void write(std::ostream &os) const
char theProcessingType[PROCESSING_TYPE_SIZE+1]
Definition: ossimFfRevc.h:227
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
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
char theSensorName[NUMBER_OF_SCENES][SENSOR_NAME_SIZE+1]
Definition: ossimFfRevc.h:217
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
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