30 static const ossimString ACQUISITION_DATE_KW =
"acquisition_date";
34 static const ossimString SATELLITE_NAME_KW =
"satellite_name";
35 static const ossimString SENSOR_NAME_KW =
"sensor_name";
52 FILE* fptr = fopen(headerFile,
"r");
85 os << setiosflags(ios::left | ios::fixed)
86 <<
"\nAdministrative Record:" 87 << setw(30) <<
"\ntheRequestNumber: " 92 << setw(30) <<
"\nSatelliteName: " <<
theSatName 95 << setw(30) <<
"\nOffNadirAngle: " 98 os << setw(30) <<
"\nProductType: " 100 << setw(30) <<
"\nProductSize: " 102 << setw(30) <<
"\nProcessingType: " 104 << setw(30) <<
"\nResampAlgorithm: " 106 << setw(30) <<
"\nPixelsPerLine: " 108 << setw(30) <<
"\nLinesPerImage: " 110 << setw(30) <<
"\nRecordSize: " 112 << setw(30) <<
"\nGsd: " 113 << setprecision(2) <<
theGsd 114 << setw(30) <<
"\nOutputBitsPerPixel: " 116 << setw(30) <<
"\nAcquiredBitsPerPixel: " 118 << setw(30) <<
"\nBandsPresentString: " 121 for (
int i=0; i<6; i++)
125 os << setprecision(15) << setw(30) <<
"\nRadiometric record:" << endl;
127 vector<ossim_float64>::const_iterator bi =
theBias.begin();
130 os <<
"band[" << band <<
"] bias: " << (*bi) << endl;
139 os <<
"band[" << band <<
"] gain: " << (*bi) << endl;
145 <<
"Geometric Record:" 146 << setw(30) <<
"\nMapProjectionName:" 148 << setw(30) <<
"\nEllipsoid:" 150 << setw(30) <<
"\nDatum:" 153 for (
int i = 0; i < 15; i++)
155 os <<
"\nProjectionParams[" << setw(2) << i << setw(10) <<
"]: " 159 os << setprecision(3)
164 << setw(30) <<
"\nCenter Point (Ground):" <<
theCenterGP 166 << setw(30) <<
"\nHorizontalOffset:" 168 << setprecision(2) << setw(30) <<
"\nOrientationAngle:" 170 << setw(30) <<
"\nSunElevationAngle:" 173 << resetiosflags(ios::left)
181 os <<
"WARNING ossimFfL7::writeHeader: This method is not yet implemented. Ignoring request..." 187 static const int OFFSET = -1;
191 fseek(fptr, OFFSET + 9, SEEK_SET);
193 if (converted != 1)
return;
195 fseek(fptr, OFFSET + 35, SEEK_SET);
197 if (converted != 1)
return;
199 fseek(fptr, OFFSET + 71, SEEK_SET);
201 if (converted != 1)
return;
203 fseek(fptr, OFFSET + 92, SEEK_SET);
205 if (converted != 1)
return;
207 fseek(fptr, OFFSET + 111, SEEK_SET);
209 if (converted != 1)
return;
211 fseek(fptr, OFFSET + 135, SEEK_SET);
213 if (converted != 1)
return;
215 fseek(fptr, OFFSET + 154, SEEK_SET);
217 if (converted != 1)
return;
219 fseek(fptr, OFFSET + 655, SEEK_SET);
221 if (converted != 1)
return;
223 fseek(fptr, OFFSET + 688, SEEK_SET);
225 if (converted != 1)
return;
227 fseek(fptr, OFFSET + 741, SEEK_SET);
229 if (converted != 1)
return;
231 fseek(fptr, OFFSET + 765, SEEK_SET);
233 if (converted != 1)
return;
235 fseek(fptr, OFFSET + 843, SEEK_SET);
237 if (converted != 1)
return;
239 fseek(fptr, OFFSET + 865, SEEK_SET);
241 if (converted != 1)
return;
243 fseek(fptr, OFFSET + 932, SEEK_SET);
245 if (converted != 1)
return;
247 fseek(fptr, OFFSET + 954, SEEK_SET);
248 converted = fscanf(fptr,
"%6lf", &
theGsd);
249 if (converted != 1)
return;
251 fseek(fptr, OFFSET + 984, SEEK_SET);
253 if (converted != 1)
return;
255 fseek(fptr, OFFSET + 1012, SEEK_SET);
257 if (converted != 1)
return;
259 fseek(fptr, OFFSET + 1056, SEEK_SET);
261 if (converted != 1)
return;
263 fseek(fptr, OFFSET + 1131, SEEK_SET);
265 if (converted != 1)
return;
267 fseek(fptr, OFFSET + 1170, SEEK_SET);
269 if (converted != 1)
return;
271 fseek(fptr, OFFSET + 1211, SEEK_SET);
273 if (converted != 1)
return;
275 fseek(fptr, OFFSET + 1250, SEEK_SET);
277 if (converted != 1)
return;
279 fseek(fptr, OFFSET + 1291, SEEK_SET);
281 if (converted != 1)
return;
283 fseek(fptr, OFFSET + 1330, SEEK_SET);
285 if (converted != 1)
return;
288 if(arrayPathRow.size() == 2)
316 char radiom_record[1537];
320 fseek(fptr, 1536, SEEK_SET);
321 converted = fscanf(fptr,
"%1536c", radiom_record);
330 char temp_chars[
MAX];
334 is.getline(temp_chars,
MAX);
336 const char SPACE = 0x20;
337 const char LINE_FEED = 0x0a;
342 is.getline(temp_chars,
MAX);
343 bool blank_line =
true;
346 if (temp_chars[i] == LINE_FEED)
break;
348 if (temp_chars[i] !=
SPACE)
355 if (blank_line ==
true)
continue;
357 std::vector<ossimString> splitString;
359 tempString.
split(splitString,
" ");
361 if(splitString.size() > 1)
363 theBias.push_back(splitString[0].toDouble());
364 theGain.push_back(splitString[1].toDouble());
375 static const int OFFSET = 3071;
379 fseek(fptr, OFFSET + 32, SEEK_SET);
381 if (converted != 1)
return;
383 fseek(fptr, OFFSET + 48, SEEK_SET);
385 if (converted != 1)
return;
390 long currentOffset = OFFSET + 110;
391 for(
long parameter=0;parameter < 15; ++parameter)
393 fseek(fptr, currentOffset, SEEK_SET);
395 if (converted != 1)
return;
401 fseek(fptr, OFFSET + 521, SEEK_SET);
403 if (converted != 1)
return;
405 fseek(fptr, OFFSET + 566, SEEK_SET);
408 fseek(fptr, OFFSET + 646, SEEK_SET);
411 fseek(fptr, OFFSET + 726, SEEK_SET);
414 fseek(fptr, OFFSET + 806, SEEK_SET);
417 fseek(fptr, OFFSET + 890, SEEK_SET);
420 fseek(fptr, OFFSET + 945, SEEK_SET);
425 converted = fscanf(fptr,
"%5d %5d", &
x, &
y);
426 if (converted != 2)
return;
431 fseek(fptr, OFFSET + 969, SEEK_SET);
433 if (converted != 1)
return;
435 fseek(fptr, OFFSET + 995, SEEK_SET);
437 if (converted != 1)
return;
439 fseek(fptr, OFFSET + 1062, SEEK_SET);
441 if (converted != 1)
return;
443 fseek(fptr, OFFSET + 1086, SEEK_SET);
445 if (converted != 1)
return;
469 int converted = fscanf(fptr,
"%03d%02d%7lf%c %02d%02d%7lf%c",
470 &londeg, &lonmin, &lonsec, &lonhem,
471 &latdeg, &latmin, &latsec, &lathem);
479 geo_point.
lat = (double)latdeg + (
double)latmin/60.0 + latsec/3600.0;
481 geo_point.
lat *= -1.0;
483 geo_point.
lon= (double)londeg + (
double)lonmin/60.0 + lonsec/3600.0;
485 geo_point.
lon *= -1.0;
496 static const char source[] =
"";
534 for (
int i=0; i<15; i++)
579 return static_cast<long>(date.
getJulian());
640 if(name == ACQUISITION_DATE_KW)
646 else if (name == PATH_KW)
652 else if (name == PATH_ROW_KW)
658 else if (name == ROW_KW)
664 else if (name == SATELLITE_NAME_KW)
670 else if (name == SENSOR_NAME_KW)
682 propertyNames.push_back(ACQUISITION_DATE_KW);
683 propertyNames.push_back(PATH_KW);
684 propertyNames.push_back(PATH_ROW_KW);
685 propertyNames.push_back(ROW_KW);
686 propertyNames.push_back(SATELLITE_NAME_KW);
687 propertyNames.push_back(SENSOR_NAME_KW);
694 return (
unsigned int)tmp.
length();
int getLinesPerBand() const
void writeHeader(std::ostream &os) const
char theProcessingType[12]
void getSunElevation(double &elevation) const
Gets the sun elevation in degrees.
char theResampAlgorithm[3]
static const ossimErrorCode OSSIM_OK
double getParam(ossim_uint32 i) const
virtual unsigned int getBandCount() const
void getGain(vector< double > &gain) const
void dump(std::ostream &os) const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Gets a property for matching name.
int getPixelsPerLine() const
void readGeomRecord(FILE *fptr)
static ossimString toString(bool aValue)
Numeric to string methods.
ossimIpt theCenterImagePoint
char theBandsPresentString[33]
ossimString getSatelliteName() const
void getBias(vector< double > &bias) const
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
static const ossimErrorCode OSSIM_ERROR
char theAcquisitionDate[20]
long getJulianDay() const
int convertGeoPoint(FILE *, ossimGpt &)
ossimFilename getBandFilename(ossim_uint32 idx) const
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
Gets a list of property names available.
char theBandFileNames[8][30]
char theMapProjectionName[5]
std::string::size_type length() const
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
ossimString pathRow() const
int theAcquiredBitsPerPixel
std::ostream & operator<<(std::ostream &os, const ossimFfL7 &head)
ossimErrorCode theErrorStatus
void readAdminRecord(FILE *fptr)
void getSunAzimuth(double &azimuth) const
Gets the sun azimuth in degrees.
ossimString getAcquisitionDate() const
void readRadiomRecord(FILE *fptr)
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.
double theProjectionParams[15]
int theOutputBitsPerPixel
char theRequestNumber[21]
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
double theOrientationAngle