11 static ossimTrace traceDebug(
"ossimAlphaSensorSupportData:debug");
53 if ( hdr.
open(hdrFile) )
80 navDir = navDir.
dirCat(
"NavData");
84 txtFile.
gsub(
"corrected.hsi.hdr",
"insgps.txt");
99 txtFile.
gsub(
"cal/",
"nav/");
102 txtFile.
gsub(
"hsi.hdr",
"txt");
131 if ( navDir.
empty() )
133 navDir = navDir.
dirCat(
"../NavData");
137 std::string::size_type pos = navDir.
find(
"HRI_");
138 if(pos!=std::string::npos)
140 navDir = navDir.
replace(pos, 5,
"NavData");
146 std::string::size_type pos = txtFile.
find(
"HRI_");
147 if(pos!=std::string::npos)
149 txtFile.
replace(pos, 5,
"HRI");
151 txtFile.
gsub(
"corrected.hri.hdr",
"insgps.txt");
157 txtFile.
gsub(
"hri.hdr",
"txt");
168 <<
"ossimAlphaSensorSupportData::readSupportFiles DEBUG:" 169 <<
"\n hdrFile = " << hdr.
getFile()
170 <<
"\n txtFile = " << txtFile
181 if ( hdr.
open(hdrFile) )
253 hdr.
getValue(
"heading bias", value);
273 hdr.
getValue(
"slit rotation deg", value);
284 <<
"Missing: \"slit rotation deg\"\n";
291 <<
"ossimAlphaSensorSupportData::readHdrFile DEBUG:" 298 <<
"\n fpa fov deg = " <<
m_fov 299 <<
"\n slit rotation deg = " <<
m_slitRot 316 static const char M[] =
"ossimAlphaSensorSupportData::readInsGpsFile";
321 << M <<
" entered:\n" <<
"file: " << file <<
"\n";
325 createIstream( file, std::ios_base::in);
327 if ( in && in->good() )
342 std::vector< ossim_uint32 > lines;
347 <<
"ossimAlphaSensorSupportData::readInsGpsFile DEBUG:" << std::endl;
363 while ( !tmpStr.eof() )
375 in->seekg( 0, std::ios_base::beg );
384 *in >> inum >> roll >> pitch >> heading >> lon >> lat
385 >> alt >> scanAng >> res >> frm >> timeCode;
388 if ( timeCode != BOGUS )
390 lines.push_back(inum);
394 m_lon.push_back(lon);
395 m_lat.push_back(lat);
396 m_alt.push_back(alt);
402 if( (lines.size() <
m_imageSize.
y) || (lines.size() < 10) )
408 vector< ossimPolynom< ossim_float64 , 1 >::VAR_TUPLE >::iterator pit;
413 pit->push_back(lines[j]-lines[0]);
420 std::vector< ossimPolynom<ossim_float64,1>::EXPT_SET > expSet;
423 for (
int numExp=1; numExp<=
MAX_TERMS; ++numExp)
425 for(
int o=0; o<numExp ; ++o)
428 expSet[numExp-1].insert(et);
451 <<
"\n SA poly deg, rms error = " 461 <<
"\n R poly deg, rms error = " 471 <<
"\n P poly deg, rms error = " 481 <<
"\n H poly deg, rms error = " 491 <<
"\n Lon poly deg, rms error = " 501 <<
"\n Lat poly deg, rms error = " 511 <<
"\n Alt poly deg, rms error = " 512 <<
ALT_DEG <<
", " << rms <<
" mtr" << std::endl;
567 vector<ossim_float64> inp(1);
603 <<
" ...polynomial solution error for file: " << file << std::endl;
613 <<
"Could not open: " << file <<
"\n";
620 << M <<
" exit status = " << ( result ?
"true" :
"false" ) <<
"\n";
virtual bool readSupportFiles(const ossimFilename &hdrFile)
std::vector< ossim_float64 > m_pitchPolyCoef
std::vector< ossim_float64 > m_alt
std::vector< ossim_float64 > m_headingPolyCoef
T eval(const VAR_TUPLE &v) const
evaluation : needs DIM values as input
const std::vector< ossim_float64 > & getLatPoly() const
virtual bool readHdrFile(const ossimFilename &hdrFile)
ossimFilename expand() const
Method to do file name expansion.
std::vector< ossim_float64 > m_heading
double nan()
Method to return ieee floating point double precision NAN.
This code was derived from https://gist.github.com/mshockwave.
const ossim_float64 & getSlitRot() const
template class for multivariate polynom algebra
const std::vector< ossim_float64 > & getLonPoly() const
bool contains(char aChar) const
bool SLSfit(const EXPT_SET &expset, const std::vector< VAR_TUPLE > obs_input, const std::vector< T > obs_output, T *prms=NULL)
Standard least squares Modified version of LMSfit that uses standard NEWMAT inverse as alternative to...
const ossim_float64 & getFov() const
static StreamFactoryRegistry * instance()
std::istream & getline(std::istream &is, ossimString &str, char delim)
std::vector< ossim_float64 > m_altPolyCoef
ossimAlphaSensorSupportData()
double radiansToDegrees(double x)
const ossimDpt & getImageSize() const
ossim_float64 m_pitchBias
std::string::size_type size() const
const std::vector< ossim_float64 > & getAltPoly() const
ossim_float64 m_headingBias
unsigned int ossim_uint32
const ossim_float64 & getHeadingBias() const
std::vector< ossim_float64 > m_pitch
std::vector< int > EXP_TUPLE
inner types
const MONOM_MAP & getMonoms() const
std::vector< ossim_float64 > m_lat
std::vector< ossim_float64 > m_scanAngPolyCoef
std::vector< ossim_float64 > m_latPolyCoef
virtual bool readInsGpsFile(const ossimFilename &txtFile)
const ossim_float64 & getRollBias() const
std::vector< ossim_float64 > m_rollPolyCoef
std::string & replace(std::string::size_type pos, std::string::size_type n, const std::string &s)
Replaces a substring of *this with the string s.
std::vector< ossimPolynom< ossim_float64, 1 >::VAR_TUPLE > m_imgLine
ossimFilename dirCat(const ossimFilename &file) const
const std::vector< ossim_float64 > & getScanPoly() const
ossimAlphaSensorSupportData & operator=(const ossimAlphaSensorSupportData &src)
std::ostream & print(std::ostream &os) const
I/O.
ossimFilename file() const
std::vector< ossim_float64 > m_lonPolyCoef
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.
const std::vector< ossim_float64 > & getPitchPoly() const
ossimFilename path() const
std::vector< ossim_float64 > m_lon
const std::vector< ossim_float64 > & getHeadingPoly() const
std::string::size_type find(const std::string &s, std::string::size_type pos=0) const
Searches for s as a substring of *this, beginning at character pos of *this.
std::vector< ossim_float64 > m_roll
const ossim_float64 & getPitchBias() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
const std::vector< ossim_float64 > & getRollPoly() const
std::vector< ossim_float64 > m_scanAng