33 #ifdef OSSIM_ID_ENABLED 34 static const char OSSIM_ID[] =
"$Id: ossimSarModel.cpp 17206 2010-04-25 23:20:40Z dburken $";
37 static const char ACQ_MODE_KW[] =
"acq_mode";
38 static const char ORP_POS_KW[] =
"orp_pos";
39 static const char ORP_CENTER_KW[] =
"orp_ctr_xy";
40 static const char OPNORM_KW[] =
"opnorm";
41 static const char OP_X_AXIS_KW[] =
"opx";
42 static const char OIPR_KW[] =
"oipr";
43 static const char PIX_SIZE_KW[] =
"pixel_size";
44 static const char ARP_TIME_KW[] =
"arptm";
45 static const char ARP_POLY_COEFF_X_KW[] =
"arppol_coeff_x";
46 static const char ARP_POLY_COEFF_Y_KW[] =
"arppol_coeff_y";
47 static const char ARP_POLY_COEFF_Z_KW[] =
"arppol_coeff_z";
48 static const char TIME_COEFF[] =
"time_coeff";
50 static const ossimString PARAM_NAMES[] ={
"x_pos_offset",
69 theOutputPlaneNormal(),
78 <<
"ossimSarModel::ossimSarModel DEBUG:" << std::endl;
79 #ifdef OSSIM_ID_ENABLED 81 <<
"OSSIM_ID: " << OSSIM_ID << std::endl;
118 for (
int i=0; i<numParams; i++)
150 <<
"DEBUG ossimSarModel::loadState(): returning with error..." 160 lookup = kwl.
find(prefix, ACQ_MODE_KW);
171 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 172 << ACQ_MODE_KW <<
"\nreturning with error..." 180 lookup = kwl.
find(prefix, ORP_POS_KW);
191 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 192 << ORP_POS_KW <<
"\nreturning with error..." 200 lookup = kwl.
find(prefix, ORP_CENTER_KW);
211 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 212 << ORP_CENTER_KW <<
"\nreturning with error..." 220 lookup = kwl.
find(prefix, OPNORM_KW);
231 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 232 << OPNORM_KW <<
"\nreturning with error..." 240 lookup = kwl.
find(prefix, OP_X_AXIS_KW);
251 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 252 << OP_X_AXIS_KW <<
"\nreturning with error..." 260 lookup = kwl.
find(prefix, OIPR_KW);
271 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 272 << OIPR_KW <<
"\nreturning with error..." 280 lookup = kwl.
find(prefix, PIX_SIZE_KW);
291 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 292 << PIX_SIZE_KW <<
"\nreturning with error..." 300 lookup = kwl.
find(prefix, ARP_TIME_KW);
311 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 312 << ARP_TIME_KW <<
"\nreturning with error..." 327 if ( (x_count == y_count) && (x_count == z_count) )
332 while ( (found < x_count) &&
343 const char* xLookup = kwl.
find(prefix, xkw.
c_str());
344 const char* yLookup = kwl.
find(prefix, ykw.
c_str());
345 const char* zLookup = kwl.
find(prefix, zkw.
c_str());
347 if (xLookup && yLookup && zLookup)
362 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 363 <<
"arppol_coeff" <<
"\nreturning with error..." 378 while ( (found < timeCount) &&
399 <<
"DEBUG ossimSarModel::loadState() lookup failure: " 400 << TIME_COEFF <<
"\nreturning with error..." 412 <<
"ossimSarModel::loadState() DEBUG: " << std::endl;
479 "//************************************\n" 480 "// Template for SAR model keywordlist\n" 481 "//************************************\n";
485 <<
"// Base-class SAR Keywords:\n" 487 << ACQ_MODE_KW <<
": <SCAN, SPOT>\n" 488 << ORP_POS_KW <<
": <meters (ECF)>\n" 489 << ORP_CENTER_KW <<
": <pixels>\n" 490 << OPNORM_KW <<
": <unit vector>\n" 491 << OP_X_AXIS_KW <<
": <unit vector>\n" 492 << OIPR_KW <<
": <meters>\n" 493 << PIX_SIZE_KW <<
": <meters>\n" 494 << ARP_TIME_KW <<
": <sec>\n" 495 << ARP_POLY_COEFF_X_KW <<
": <meters (ECF)>\n" 496 << ARP_POLY_COEFF_Y_KW <<
": <meters (ECF)>\n" 497 << ARP_POLY_COEFF_Z_KW <<
": <meters (ECF)>\n" 498 << TIME_COEFF <<
": <sec>\n";
510 out <<
"// ossimSarModel::print:" << std::endl;
519 out <<
"// ossimSarModel::saveState failed!" << std::endl;
562 const double& heightAboveEllipsoid,
590 hgtSet = heightAboveEllipsoid;
708 const ossimDpt& , NEWMAT::SymmetricMatrix& Cov)
714 NEWMAT::SymmetricMatrix B(2);
720 NEWMAT::SymmetricMatrix P(2);
721 P(1,1) = defPointingSigma*defPointingSigma;
725 NEWMAT::SymmetricMatrix Cm;
731 NEWMAT::SymmetricMatrix Ctot = Cm;
736 NEWMAT::SymmetricMatrix Bad(2);
741 Cov << Bad * Ctot * Bad.t();
770 <<
"DEBUG updateModel:\n OP vectors...";
774 <<
"\n OPZ: "<<
theOPZ<<endl;
777 <<
" ORPgeo: "<<orpg<<endl;
817 pos = pos + ecfOffset;
855 for (i=nTermsX-2; i>=0; i--)
859 for (i=nTermsY-2; i>=0; i--)
863 for (i=nTermsZ-2; i>=0; i--)
876 pos = pos + ecfOffset;
906 for (i=nTermsX-2; i>=1; i--)
910 for (i=nTermsY-2; i>=1; i--)
914 for (i=nTermsZ-2; i>=1; i--)
1012 <<
"DEBUG computeRangeDoppler: range vector..." << endl;
1014 <<
"delta components: \n"<<delta<<endl;
1020 doppler = arpVel.
dot(delta) / range;
1097 NEWMAT::SymmetricMatrix BtB(3);
1098 NEWMAT::ColumnVector BtF(3);
1099 NEWMAT::ColumnVector F(3);
1100 NEWMAT::ColumnVector dR(3);
1107 while ((F(1)>=
theOipr || F(2)>=0.0003048 || F(3)>=0.5) && iter<5)
1132 F(1) = rngComp - range;
1133 F(2) = dopComp - doppler;
1150 p_fd[0], p_fd[1], p_fd[2],
1151 p_ft[0], p_ft[1], p_ft[2]);
1195 while (checkTime > 10.0e-6 && iter<5)
1200 checkTime = fabs(cTime-lTime)/cTime;
1394 else if (os ==
"spot")
virtual ossim_float64 getArpTime() const
Get ARP time for SPOT mode (constant time).
void setParameterDescription(ossim_uint32 idx, const ossimString &descrption)
ossim_float64 theOipr
output impulse response
ossimEcefVector unitVector() const
vector< ossim_float64 > theArpZPolCoeff
double azimuthTo(const ossimGpt &arg_gpt) const
METHOD: azimuthTo(ossimGpt) Computes the great-circle starting azimuth (i.e., at this gpt) to the arg...
ossimEcefVector theOutputPlaneXaxis
output plane x-axis
ossimString getAcquistionModeString() const
Returns the acquisition mode as a string.
virtual std::ostream & print(std::ostream &os) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
ossim_uint32 numberOf(const char *str) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to load or recreate the state of an ossimSarModel from a keyword list.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual ossim_float64 getRefHeight(const ossimGpt &pg) const
Method to get height reference.
double lond() const
Will convert the radian measure to degrees.
ossim_float64 theArpTime
Aperture Reference/Center Point (ARP) time in seconds.
Represents serializable keyword/value map.
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const
METHOD: imagingRay(image_point, &ossimEcefRay) Given an image point, returns a ray originating at the ARP...
virtual void lineSampleToWorld(const ossimDpt &image_point, ossimGpt &world_point) const
ossimEcefPoint theOrpPosition
Output/Ground Reference Point (ORP) position.
ossimEcefVector cross(const ossimEcefVector &) const
const char * find(const char *key) const
double dot(const ossimEcefVector &) const
ossimEcefVector theOPX
Output/slant plane unit vectors.
RTTI_DEF1(ossimSarModel, "ossimSarModel", ossimSensorModel)
virtual bool projOPtoSurface(const ossimEcefPoint &opPt, const ossim_float64 &range, const ossim_float64 &doppler, const ossimEcefPoint &arpPos, const ossimEcefVector &arpVel, const ossimHgtRef *hgtRef, ossimEcefPoint &ellPt) const
Method to project output plane coordinates to surface.
ossimString toString(ossim_uint32 precision=15) const
To string method.
double nan()
Method to return ieee floating point double precision NAN.
static ossimString toString(bool aValue)
Numeric to string methods.
void initAdjustableParameters()
ossim_float64 thePixelSpacing
Other computed parameters.
static void writeGeomTemplate(ostream &os)
virtual std::ostream & print(std::ostream &out) const
print method.
double latd() const
Will convert the radian measure to degrees.
virtual bool computeImageFromOP(const ossimEcefPoint &opPt, ossimDpt &imgPt) const
Method to compute image coordinates from output plane coordinates.
vector< ossim_float64 > theTimeCoeff
Time Coefficients.
void toPoint(const std::string &s)
Initializes this point from string.
virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt &gpos, double hdelta=1e-11)
virtual ~ossimSarModel()
virtual destructor
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
const NEWMAT::Matrix & lsrToEcefRotMatrix() const
void toPoint(const std::string &s)
Initializes this point from string.
void setAcquisitionMode(const ossimString &mode)
Sets the acquisition mode from string.
ossimEcefVector theObsArpVel_U
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of this object to a keyword list.
ossim_float64 theObsArpVel_Mag
ossimDpt theOrpCenter
sample (x)/line(y) image coordinates of ORP
unsigned int ossim_uint32
double getAdjustableParameter(ossim_uint32 idx) const
virtual bool computeOPfromImage(const ossimDpt &imgPt, ossimEcefPoint &opPt) const
Method to compute output plane coordinates from image coordinates.
void toPoint(const std::string &s)
Initializes this point from string.
ossim_float64 toFloat64() const
ossim_float64 theParDopWRTaz
Partials for current point.
virtual ossimSensorModel::CovMatStatus getObsCovMat(const ossimDpt &ipos, NEWMAT::SymmetricMatrix &Cov)
virtual void updateModel()
Compute other parameters & update the model.
virtual void lineSampleHeightToWorld(const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const
void setParameterUnit(ossim_uint32 idx, ossimUnitType unit)
static NEWMAT::Matrix create()
ossimEcefPoint theObsArpPos
static ossimString downcase(const ossimString &aString)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual std::ostream & print(std::ostream &out) const
ossimEcefVector theObsArpVel
static void writeGeomTemplate(ostream &os)
vector< ossim_float64 > theArpXPolCoeff
Aperture Reference Point (ARP) Polynomials.
ossimEcefPoint theObsPosition
ossimEcefVector theOutputPlaneNormal
output plane normal
AcquisitionMode theAcquisitionMode
acquisition mode
ossim_float64 theObsRng
Adjustment-related data used and set by getForwardDeriv.
virtual double sensorAzimuth(const ossimDpt &image_point) const
NEWMAT::ColumnVector solveLeastSquares(NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &r) const
ossimString toString(ossim_uint32 precision=15) const
virtual bool computeRangeDoppler(const ossimEcefPoint &pt, const ossimEcefPoint &arpPos, const ossimEcefVector &arpVel, ossim_float64 &range, ossim_float64 &doppler) const
Method to compute range & Doppler.
virtual void setAdjustableParameter(ossim_uint32 idx, double value, bool notify=false)
ossimSarModel()
default constructor
virtual ossimEcefPoint getArpPos() const
Get ARP position for SPOT mode (constant time).
void resizeAdjustableParameterArray(ossim_uint32 numberOfParameters)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
ossimEcefVector theLsrOffset
Adjustable parameters.
virtual void worldToLineSample(const ossimGpt &world_point, ossimDpt &image_point) const
ossim_float64 thePixelSize
pixel size
ossimDpt theParWRTx
Partials for current point.
ossimDpt theObs
Observations & residuals for current point.
virtual ossimEcefVector getArpVel() const
Get ARP velocity for SPOT mode (constant time).
vector< ossim_float64 > theArpYPolCoeff
void setParameterSigma(ossim_uint32 idx, double value, bool notify=false)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual bool projEllipsoidToOP(const ossimEcefPoint &ellPt, ossimEcefPoint &opPt) const
Method to project ellipsoid coordinates to output plane.
std::basic_ostream< char > ostream
Base class for char output streams.
double getParameterSigma(ossim_uint32 idx) const
ossimString toString(ossim_uint32 precision=15) const
To string method.
virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt &gpos, double h)
Compute partials of range/Doppler WRT ground point.
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.