OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
ossimRpcModel Class Reference

#include <ossimRpcModel.h>

Inheritance diagram for ossimRpcModel:
ossimSensorModel ossimProjection ossimOptimizableProjection ossimAdjustableParameterInterface ossimObject ossimErrorStatusInterface ossimReferenced ossimIkonosRpcModel ossimNitfRpcModel ossimplugins::ossimPleiadesModel ossimplugins::ossimRadarSat2RPCModel ossimplugins::ossimSpot6Model ossimQuickbirdRpcModel

Classes

struct  rpcModelStruct
 RPC model structure used for access function. More...
 

Public Types

enum  PolynomialType { A ='A', B ='B' }
 
- Public Types inherited from ossimSensorModel
enum  CovMatStatus { COV_INVALID = 0, COV_PARTIAL = 1, COV_FULL = 2 }
 
enum  DeriveMode {
  OBS_INIT =-99, EVALUATE =-98, P_WRT_X = -1, P_WRT_Y = -2,
  P_WRT_Z = -3
}
 

Public Member Functions

 ossimRpcModel ()
 default constructor More...
 
 ossimRpcModel (const ossimRpcModel &copy_this)
 copy construtor More...
 
void setAttributes (ossim_float64 theSampleOffset, ossim_float64 theLineOffset, ossim_float64 theSampleScale, ossim_float64 theLineScale, ossim_float64 theLatOffset, ossim_float64 theLonOffset, ossim_float64 theHeightOffset, ossim_float64 theLatScale, ossim_float64 theLonScale, ossim_float64 theHeightScale, const std::vector< double > &xNumeratorCoeffs, const std::vector< double > &xDenominatorCoeffs, const std::vector< double > &yNumeratorCoeffs, const std::vector< double > &yDenominatorCoeffs, PolynomialType polyType=B, bool computeGsdFlag=true)
 
void setMetersPerPixel (const ossimDpt &metersPerPixel)
 
void setPositionError (const ossim_float64 &biasError, const ossim_float64 &randomError, bool initNominalPostionErrorFlag)
 Sets data member theBiasError, theRandError. More...
 
virtual void worldToLineSample (const ossimGpt &world_point, ossimDpt &image_point) const
 worldToLineSample() Overrides base class implementation. More...
 
virtual std::ostream & print (std::ostream &out) const
 print() Extends base-class implementation. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 saveState Fulfills ossimObject base-class pure virtuals. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 loadState Fulfills ossimObject base-class pure virtuals. More...
 
virtual void lineSampleToWorld (const ossimDpt &image_point, ossimGpt &world_point) const
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
 
virtual void imagingRay (const ossimDpt &image_point, ossimEcefRay &image_ray) const
 imagingRay() Overrides base class pure virtual. More...
 
virtual void updateModel ()
 
virtual void initAdjustableParameters ()
 
virtual ossimObjectdup () const
 dup() Returns pointer to a new instance, copy of this. More...
 
virtual bool useForward () const
 
virtual bool setupOptimizer (const ossimString &init_file)
 uses file path to init model More...
 
virtual ossimDpt getForwardDeriv (int parmIdx, const ossimGpt &gpos, double h)
 Compute partials of samp/line WRT ground point. More...
 
double getBiasError () const
 Returns Error - Bias. More...
 
double getRandError () const
 Returns Error - Random. More...
 
void getRpcParameters (ossimRpcModel::rpcModelStruct &model) const
 Returns RPC parameter set in structure. More...
 
void setImageOffset (const ossimDpt &offset_to_chip_ul)
 Allows setting an offset to a subimage while using the coefficients of a full-image model. More...
 
bool toJSON (std::ostream &json) const
 Serializes RPC to JSON format. More...
 
bool toRPB (std::ostream &out) const
 Serialize to WorldView-style .RPB file to the stream provided. More...
 
- Public Member Functions inherited from ossimSensorModel
 ossimSensorModel ()
 
 ossimSensorModel (const ossimSensorModel &copy_this)
 
 ossimSensorModel (const ossimKeywordlist &geom_kwl)
 
const ossimSensorModeloperator= (const ossimSensorModel &rhs)
 assignment operator More...
 
virtual ossimObjectgetBaseObject ()
 
virtual const ossimObjectgetBaseObject () const
 
virtual ossimGpt origin () const
 
virtual ossimDpt getMetersPerPixel () const
 
virtual const double & getNominalPosError () const
 Returns the estimated Absolute horizontal position error (CE90) of the sensor model. More...
 
virtual const double & getRelativePosError () const
 Returns the estimated RELATIVE horizontal position error (CE90) of the sensor model. More...
 
virtual void setNominalPosError (const double &ce90)
 Assigns the absolute image position error uncertainty (abs CE90) More...
 
virtual void setRelativePosError (const double &ce90)
 Assigns the relative image position error uncertainty (rel CE90) More...
 
void setRefImgPt (const ossimDpt &pt)
 Sets the center line sampe of the image. More...
 
void setRefGndPt (const ossimGpt &pt)
 Sets the center latitude, longitude, height of the image. More...
 
void setImageRect (const ossimDrect &imageRect)
 
void setGroundRect (const ossimGpt &ul, const ossimGpt &ur, const ossimGpt &lr, const ossimGpt &ll)
 
ossimDpt imageSize () const
 
void setImageSize (const ossimDpt &size)
 
virtual void adjustableParametersChanged ()
 
virtual bool insideImage (const ossimDpt &p) const
 
virtual bool operator== (const ossimProjection &proj) const
 
const ossimStringgetImageID () const
 Access methods: More...
 
const ossimDrectgetImageClipRect () const
 
virtual ossim_uint32 degreesOfFreedom () const
 
virtual bool needsInitialState () const
 needsInitialState() More...
 
virtual double optimizeFit (const ossimTieGptSet &tieSet, double *targetVariance=0)
 
virtual ossimGpt getInverseDeriv (int parmIdx, const ossimDpt &ipos, double hdelta=1e-11)
 
virtual ossimSensorModel::CovMatStatus getObsCovMat (const ossimDpt &ipos, NEWMAT::SymmetricMatrix &Cov, const ossim_float64 defPointingSigma=0.5) const
 Gives 2X2 covariance matrix of observations. More...
 
virtual bool isAffectedByElevation () const
 Implementation of pure virtual ossimProjection::isAffectedByElevation method. More...
 
void computeGsd ()
 This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD by doing a lineSampleHeightToWorld on four points and calculating the distance from them. More...
 
virtual bool getImageGeometry (const ossimString &, const ossimString &, ossimKeywordlist &) const
 Extracts geometry info from a non-ossim key,value pair to an ossim keyword list. More...
 
- Public Member Functions inherited from ossimProjection
 ossimProjection ()
 
virtual ~ossimProjection ()
 
virtual ossimDpt forward (const ossimGpt &wp) const
 
virtual ossimGpt inverse (const ossimDpt &pp) const
 
virtual void getRoundTripError (const ossimDpt &imagePoint, ossimDpt &errorResult) const
 
virtual void getRoundTripError (const ossimGpt &groundPoint, ossimDpt &errorResult) const
 
virtual void getGroundClipPoints (ossimGeoPolygon &gpts) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual bool operator!= (const ossimProjection &projection) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
- Public Member Functions inherited from ossimOptimizableProjection
 ossimOptimizableProjection ()
 
 ossimOptimizableProjection (const ossimOptimizableProjection &source)
 
virtual ~ossimOptimizableProjection ()
 
virtual ossimOptimizableProjectionoperator= (const ossimOptimizableProjection &source)
 
- Public Member Functions inherited from ossimAdjustableParameterInterface
 ossimAdjustableParameterInterface ()
 
 ossimAdjustableParameterInterface (const ossimAdjustableParameterInterface &rhs)
 
virtual ~ossimAdjustableParameterInterface ()
 
void newAdjustment (ossim_uint32 numberOfParameters=0)
 
void setAdjustmentDescription (const ossimString &description)
 
ossimString getAdjustmentDescription () const
 
ossimString getAdjustmentDescription (ossim_uint32 adjustmentIdx) const
 Returns adjustmentDescription of specific adjustmentInfo. More...
 
void setCurrentAdjustment (ossim_uint32 adjustmentIndex, bool notify=false)
 
bool setCurrentAdjustment (const ossimString &description, bool notify=false)
 Sets the current adjustment to the adjustment with a matching description. More...
 
void eraseAdjustment (bool notify)
 
void eraseAdjustment (ossim_uint32 idx, bool notify)
 
void resetAdjustableParameters (bool notify=false)
 
void copyAdjustment (ossim_uint32 idx, bool notify)
 
void copyAdjustment (bool notify=false)
 
void keepAdjustment (ossim_uint32 idx, bool createCopy)
 
virtual void keepAdjustment (bool createCopy=true)
 
const ossimAdjustableParameterInterfaceoperator= (const ossimAdjustableParameterInterface &rhs)
 
void removeAllAdjustments ()
 
ossim_uint32 getNumberOfAdjustableParameters () const
 
double getAdjustableParameter (ossim_uint32 idx) const
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, bool notify=false)
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, double sigma, bool notify=false)
 
double getParameterSigma (ossim_uint32 idx) const
 
void setParameterSigma (ossim_uint32 idx, double value, bool notify=false)
 
ossimUnitType getParameterUnit (ossim_uint32 idx) const
 
void setParameterUnit (ossim_uint32 idx, ossimUnitType unit)
 
void setParameterUnit (ossim_uint32 idx, const ossimString &unit)
 
void setParameterCenter (ossim_uint32 idx, double center, bool notify=false)
 
double getParameterCenter (ossim_uint32 idx) const
 
double computeParameterOffset (ossim_uint32 idx) const
 
void setParameterOffset (ossim_uint32 idx, ossim_float64 value, bool notify=false)
 
ossimString getParameterDescription (ossim_uint32 idx) const
 
void setParameterDescription (ossim_uint32 idx, const ossimString &descrption)
 
ossim_int32 findParameterIdxGivenDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
ossim_int32 findParameterIdxContainingDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
bool isParameterLocked (ossim_uint32 idx) const
 
void setParameterLockFlag (ossim_uint32 idxParam, bool flag)
 
bool getParameterLockFlag (ossim_uint32 idx) const
 
void lockAllParametersCurrentAdjustment ()
 
void unlockAllParametersCurrentAdjustment ()
 
void lockAllParameters (ossim_uint32 idxAdjustment)
 
void unlockAllParameters (ossim_uint32 idxAdjustment)
 
void resizeAdjustableParameterArray (ossim_uint32 numberOfParameters)
 
void setAdjustment (const ossimAdjustmentInfo &adj, bool notify=false)
 
void setAdjustment (ossim_uint32 idx, const ossimAdjustmentInfo &adj, bool notify=false)
 
void addAdjustment (const ossimAdjustmentInfo &adj, bool notify)
 
void getAdjustment (ossimAdjustmentInfo &adj) const
 
void getAdjustment (ossim_uint32 idx, ossimAdjustmentInfo &adj) const
 
ossim_uint32 getNumberOfAdjustments () const
 
ossim_uint32 getCurrentAdjustmentIdx () const
 
void setDirtyFlag (bool flag=true)
 
void setAllDirtyFlag (bool flag=true)
 
bool hasDirtyAdjustments () const
 
virtual void saveCurrentAdjustmentOnly (ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 Saves the current active adjustment to the KWL file. More...
 
bool saveAdjustments (ossimKeywordlist &kwl, const ossimString &prefix=ossimString("")) const
 Save all adjustments to the KWL file. More...
 
bool loadAdjustments (const ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 
std::ostream & print (std::ostream &out) const
 Dumps the currently active adjustment to ostream. More...
 

Static Public Member Functions

static void writeGeomTemplate (ostream &os)
 STATIC METHOD: writeGeomTemplate(ostream) Writes a template of geom keywords processed by loadState and saveState to output stream. More...
 
- Static Public Member Functions inherited from ossimSensorModel
static void writeGeomTemplate (ostream &os)
 

Protected Types

enum  AdjustParamIndex {
  INTRACK_OFFSET = 0, CRTRACK_OFFSET, INTRACK_SCALE, CRTRACK_SCALE,
  MAP_ROTATION, NUM_ADJUSTABLE_PARAMS
}
 

Protected Member Functions

virtual ~ossimRpcModel ()
 virtual destructor More...
 
double polynomial (const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
 
double dPoly_dLat (const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
 
double dPoly_dLon (const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
 
double dPoly_dHgt (const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
 
- Protected Member Functions inherited from ossimSensorModel
virtual ~ossimSensorModel ()
 
virtual ossimDpt extrapolate (const ossimGpt &gp) const
 
virtual ossimGpt extrapolate (const ossimDpt &ip, const double &height=ossim::nan()) const
 
void buildNormalEquation (const ossimTieGptSet &tieSet, NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &residue, NEWMAT::ColumnVector &projResidue, double pstep_scale)
 
NEWMAT::ColumnVector getResidue (const ossimTieGptSet &tieSet)
 
NEWMAT::ColumnVector solveLeastSquares (NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &r) const
 
NEWMAT::Matrix invert (const NEWMAT::Matrix &m) const
 stable invert stolen from ossimRpcSolver More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimAdjustableParameterInterface
bool paramChanged (ossim_uint32 param_idx) const
 Returns true if specified parameter has been modified since last setAllChangeFlag(false) call. More...
 
void setAllChangeFlags (bool areChanged)
 Sets all the change flags to the boolean indicated to indicate parameters are changed (TRUE) or not (FALSE). More...
 
void initChangeFlags ()
 Initializes the change flags to TRUE. More...
 

Protected Attributes

PolynomialType thePolyType
 
double theLineScale
 
double theSampScale
 
double theLatScale
 
double theLonScale
 
double theHgtScale
 
double theLineOffset
 
double theSampOffset
 
double theLatOffset
 
double theLonOffset
 
double theHgtOffset
 
double theIntrackOffset
 
double theCrtrackOffset
 
double theIntrackScale
 
double theCrtrackScale
 
double theCosMapRot
 
double theSinMapRot
 
double theBiasError
 error More...
 
double theRandError
 
double theLineNumCoef [20]
 
double theLineDenCoef [20]
 
double theSampNumCoef [20]
 
double theSampDenCoef [20]
 
- Protected Attributes inherited from ossimSensorModel
ossimIpt theImageSize
 
ossimDpt theSubImageOffset
 
ossimString theImageID
 
ossimString theSensorID
 
ossimDpt theGSD
 
ossim_float64 theMeanGSD
 
ossimGpt theRefGndPt
 
ossimDpt theRefImgPt
 
ossimPolygon theBoundGndPolygon
 
ossimDrect theImageClipRect
 
ossim_float64 theRelPosError
 
ossim_float64 theNominalPosError
 
ossimDpt theParWRTx
 Partials for current point. More...
 
ossimDpt theParWRTy
 
ossimDpt theParWRTz
 
ossimDpt theObs
 Observations & residuals for current point. More...
 
ossimDpt theResid
 
ossimRefPtr< ossimProjectiontheSeedFunction
 Used as an initial guess for iterative solutions and a guess for points outside the support bounds. More...
 
bool theExtrapolateImageFlag
 
bool theExtrapolateGroundFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Friends

class ossimRpcSolver
 
class ossimNitfRpcBase
 

Detailed Description


CLASS: ossimRpcModel

Definition at line 31 of file ossimRpcModel.h.

Member Enumeration Documentation

◆ AdjustParamIndex

Enumerator
INTRACK_OFFSET 
CRTRACK_OFFSET 
INTRACK_SCALE 
CRTRACK_SCALE 
MAP_ROTATION 
NUM_ADJUSTABLE_PARAMS 

Definition at line 232 of file ossimRpcModel.h.

◆ PolynomialType

Enumerator

Definition at line 37 of file ossimRpcModel.h.

38  {
39  A='A', // corresponds to "RPC00A"
40  B='B' // corresponds to "RPC00B"
41  };

Constructor & Destructor Documentation

◆ ossimRpcModel() [1/2]

ossimRpcModel::ossimRpcModel ( )

default constructor

Definition at line 89 of file ossimRpcModel.cpp.

References initAdjustableParameters().

Referenced by dup().

90  : ossimSensorModel(),
91  thePolyType (A),
92  theLineScale (0.0),
93  theSampScale (0.0),
94  theLatScale (0.0),
95  theLonScale (0.0),
96  theHgtScale (0.0),
97  theLineOffset (0.0),
98  theSampOffset (0.0),
99  theLatOffset (0.0),
100  theLonOffset (0.0),
101  theHgtOffset (0.0),
102  theIntrackOffset(0.0),
103  theCrtrackOffset(0.0),
104  theIntrackScale (0.0),
105  theCrtrackScale (0.0),
106  theCosMapRot (1.0),
107  theSinMapRot (0.0),
108  theBiasError (0.0),
109  theRandError (0.0)
110 
111 {
113 }
double theSampOffset
PolynomialType thePolyType
double theIntrackOffset
double theIntrackScale
double theLonScale
double theLineScale
virtual void initAdjustableParameters()
double theLatOffset
double theHgtOffset
double theLonOffset
double theRandError
double theLatScale
double theCrtrackScale
double theCrtrackOffset
double theSampScale
double theSinMapRot
double theCosMapRot
double theLineOffset
double theHgtScale
double theBiasError
error

◆ ossimRpcModel() [2/2]

ossimRpcModel::ossimRpcModel ( const ossimRpcModel copy_this)

copy construtor

Definition at line 119 of file ossimRpcModel.cpp.

References theLineDenCoef, theLineNumCoef, theSampDenCoef, and theSampNumCoef.

120  :
121  ossimSensorModel(model),
122  thePolyType (model.thePolyType),
123  theLineScale (model.theLineScale),
124  theSampScale (model.theSampScale),
125  theLatScale (model.theLatScale),
126  theLonScale (model.theLonScale),
127  theHgtScale (model.theHgtScale),
128  theLineOffset (model.theLineOffset),
129  theSampOffset (model.theSampOffset),
130  theLatOffset (model.theLatOffset),
131  theLonOffset (model.theLonOffset),
132  theHgtOffset (model.theHgtOffset),
133  theIntrackOffset(model.theIntrackOffset),
134  theCrtrackOffset(model.theCrtrackOffset),
135  theIntrackScale(model.theIntrackScale),
136  theCrtrackScale(model.theCrtrackScale),
137  theCosMapRot (model.theCosMapRot),
138  theSinMapRot (model.theSinMapRot),
139  theBiasError (model.theBiasError),
140  theRandError (model.theRandError)
141 {
142  for (int i=0; i<20; ++i )
143  {
144  theLineNumCoef[i] = model.theLineNumCoef[i];
145  theLineDenCoef[i] = model.theLineDenCoef[i];
146  theSampNumCoef[i] = model.theSampNumCoef[i];
147  theSampDenCoef[i] = model.theSampDenCoef[i];
148  }
149 }
double theSampOffset
PolynomialType thePolyType
double theSampNumCoef[20]
double theIntrackOffset
double theIntrackScale
double theLonScale
double theLineScale
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double theHgtOffset
double theLonOffset
double theRandError
double theLatScale
double theCrtrackScale
double theCrtrackOffset
double theSampScale
double theLineDenCoef[20]
double theSinMapRot
double theCosMapRot
double theLineOffset
double theHgtScale
double theBiasError
error

◆ ~ossimRpcModel()

ossimRpcModel::~ossimRpcModel ( )
protectedvirtual

virtual destructor

Definition at line 155 of file ossimRpcModel.cpp.

156 {
157 }

Member Function Documentation

◆ dPoly_dHgt()

double ossimRpcModel::dPoly_dHgt ( const double &  nlat,
const double &  nlon,
const double &  nhgt,
const double *  coeffs 
) const
protected

Definition at line 701 of file ossimRpcModel.cpp.

References A, and thePolyType.

Referenced by getForwardDeriv().

703 {
704  double dr;
705 
706  if (thePolyType == A)
707  {
708  dr = c[3] + c[5]*L + c[6]*P + c[7]*L*P + 2*c[10]*H + c[13]*L*L +
709  c[16]*P*P + 2*c[17]*L*H + 2*c[18]*P*H + 3*c[19]*H*H;
710  }
711  else
712  {
713  dr = c[3] + c[5]*L + c[6]*P + 2*c[9]*H + c[10]*L*P + 2*c[13]*L*H +
714  2*c[16]*P*H + c[17]*L*L + c[18]*P*P + 3*c[19]*H*H;
715  }
716  return dr;
717 }
PolynomialType thePolyType

◆ dPoly_dLat()

double ossimRpcModel::dPoly_dLat ( const double &  nlat,
const double &  nlon,
const double &  nhgt,
const double *  coeffs 
) const
protected

Definition at line 652 of file ossimRpcModel.cpp.

References A, and thePolyType.

Referenced by getForwardDeriv(), and lineSampleHeightToWorld().

654 {
655  double dr;
656 
657  if (thePolyType == A)
658  {
659  dr = c[2] + c[4]*L + c[6]*H + c[7]*L*H + 2*c[9]*P + c[12]*L*L +
660  2*c[14]*L*P + 3*c[15]*P*P +2*c[16]*P*H + c[18]*H*H;
661  }
662  else
663  {
664  dr = c[2] + c[4]*L + c[6]*H + 2*c[8]*P + c[10]*L*H + 2*c[12]*L*P +
665  c[14]*L*L + 3*c[15]*P*P + c[16]*H*H + 2*c[18]*P*H;
666  }
667 
668  return dr;
669 }
PolynomialType thePolyType

◆ dPoly_dLon()

double ossimRpcModel::dPoly_dLon ( const double &  nlat,
const double &  nlon,
const double &  nhgt,
const double *  coeffs 
) const
protected

Definition at line 677 of file ossimRpcModel.cpp.

References A, and thePolyType.

Referenced by getForwardDeriv(), and lineSampleHeightToWorld().

679 {
680  double dr;
681 
682  if (thePolyType == A)
683  {
684  dr = c[1] + c[4]*P + c[5]*H + c[7]*P*H + 2*c[8]*L + 3*c[11]*L*L +
685  2*c[12]*L*P + 2*c[13]*L*H + c[14]*P*P + c[17]*H*H;
686  }
687  else
688  {
689  dr = c[1] + c[4]*P + c[5]*H + 2*c[7]*L + c[10]*P*H + 3*c[11]*L*L +
690  c[12]*P*P + c[13]*H*H + 2*c[14]*P*L + 2*c[17]*L*H;
691  }
692  return dr;
693 }
PolynomialType thePolyType

◆ dup()

ossimObject * ossimRpcModel::dup ( ) const
virtual

dup() Returns pointer to a new instance, copy of this.

Implements ossimProjection.

Reimplemented in ossimplugins::ossimRadarSat2RPCModel, ossimplugins::ossimPleiadesModel, ossimplugins::ossimSpot6Model, ossimQuickbirdRpcModel, and ossimNitfRpcModel.

Definition at line 748 of file ossimRpcModel.cpp.

References ossimRpcModel().

749 {
750  return new ossimRpcModel(*this);
751 }
ossimRpcModel()
default constructor

◆ getBiasError()

double ossimRpcModel::getBiasError ( ) const

Returns Error - Bias.

Returns
Error - Bias
Note
See NITF field "ERR_BIAS" from RPC00x tag where x = A or B.

Definition at line 1355 of file ossimRpcModel.cpp.

References theBiasError.

1356 {
1357  return theBiasError;
1358 }
double theBiasError
error

◆ getForwardDeriv()

ossimDpt ossimRpcModel::getForwardDeriv ( int  parmIdx,
const ossimGpt gpos,
double  h 
)
virtual

Compute partials of samp/line WRT ground point.

Parameters
parmIdxcomputational mode: OBS_INIT, EVALUATE, P_WRT_X, P_WRT_X, P_WRT_X.
gposCurrent ground point estimate.
hNot used.
Returns
OBS_INT: n/a, EVALUATE: residuals, P_WRT_X/Y/Z: partials.

Reimplemented from ossimSensorModel.

Definition at line 1197 of file ossimRpcModel.cpp.

References ossimGpt::datum(), DEG_PER_RAD, dPoly_dHgt(), dPoly_dLat(), dPoly_dLon(), ossimDatum::ellipsoid(), ossimSensorModel::EVALUATE, ossimSensorModel::getForwardDeriv(), ossimGpt::hgt, ossim::isnan(), ossimEllipsoid::jacobianWrtEcef(), ossimGpt::lat, ossimGpt::latd(), ossimDpt::line, ossimGpt::lon, ossimGpt::lond(), ossimSensorModel::OBS_INIT, ossimSensorModel::P_WRT_X, ossimSensorModel::P_WRT_Y, polynomial(), ossimDpt::samp, theHgtOffset, theHgtScale, theLatOffset, theLatScale, theLineDenCoef, theLineNumCoef, theLineOffset, theLineScale, theLonOffset, theLonScale, ossimSensorModel::theObs, ossimSensorModel::theParWRTx, ossimSensorModel::theParWRTy, ossimSensorModel::theParWRTz, theSampDenCoef, theSampNumCoef, theSampOffset, theSampScale, ossimDpt::u, and ossimDpt::v.

1200 {
1201  // If derivMode (parmIdx) >= 0 call base class version
1202  // for "adjustable parameters"
1203  if (derivMode >= 0)
1204  {
1205  return ossimSensorModel::getForwardDeriv(derivMode, pos, h);
1206  }
1207 
1208  // Use alternative derivMode definitions
1209  else
1210  {
1211  ossimDpt returnData;
1212 
1213  //******************************************
1214  // OBS_INIT mode
1215  // [1]
1216  // [2]
1217  // Note: In this mode, pos is used to pass
1218  // in the (s,l) observations.
1219  //******************************************
1220  if (derivMode==OBS_INIT)
1221  {
1222  // Image coordinates
1223  ossimDpt obs;
1224  obs.samp = pos.latd();
1225  obs.line = pos.lond();
1226  theObs = obs;
1227  }
1228 
1229  //******************************************
1230  // EVALUATE mode
1231  // [1] evaluate & save partials, residuals
1232  // [2] return residuals
1233  //******************************************
1234  else if (derivMode==EVALUATE)
1235  {
1236  //***
1237  // Normalize the lat, lon, hgt:
1238  //***
1239  double nlat = (pos.lat - theLatOffset) / theLatScale;
1240  double nlon = (pos.lon - theLonOffset) / theLonScale;
1241  double nhgt;
1242 
1243  if( ossim::isnan(pos.hgt) )
1244  {
1245  nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
1246  }
1247  else
1248  {
1249  nhgt = (pos.hgt - theHgtOffset) / theHgtScale;
1250  }
1251 
1252  //***
1253  // Compute the normalized line (Un) and sample (Vn):
1254  //***
1255  double Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
1256  double Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
1257  double Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
1258  double Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
1259  double Un = Pu / Qu;
1260  double Vn = Pv / Qv;
1261 
1262  //***
1263  // Compute the actual line (U) and sample (V):
1264  //***
1265  double U = Un*theLineScale + theLineOffset;
1266  double V = Vn*theSampScale + theSampOffset;
1267 
1268  //***
1269  // Compute the partials of each polynomial wrt lat, lon, hgt
1270  //***
1271  double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
1272  double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
1273  double dPu_dHgt, dQu_dHgt, dPv_dHgt, dQv_dHgt;
1274  dPu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineNumCoef);
1275  dQu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineDenCoef);
1276  dPv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampNumCoef);
1277  dQv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampDenCoef);
1278  dPu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineNumCoef);
1279  dQu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineDenCoef);
1280  dPv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampNumCoef);
1281  dQv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampDenCoef);
1282  dPu_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theLineNumCoef);
1283  dQu_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theLineDenCoef);
1284  dPv_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theSampNumCoef);
1285  dQv_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theSampDenCoef);
1286 
1287  //***
1288  // Compute partials of quotients U and V wrt lat, lon, hgt
1289  //***
1290  double dU_dLat, dU_dLon, dU_dHgt, dV_dLat, dV_dLon, dV_dHgt;
1291  dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
1292  dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
1293  dU_dHgt = (Qu*dPu_dHgt - Pu*dQu_dHgt)/(Qu*Qu);
1294  dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
1295  dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
1296  dV_dHgt = (Qv*dPv_dHgt - Pv*dQv_dHgt)/(Qv*Qv);
1297 
1298  //***
1299  // Apply necessary scale factors
1300  //***
1301  dU_dLat *= theLineScale/theLatScale;
1302  dU_dLon *= theLineScale/theLonScale;
1303  dU_dHgt *= theLineScale/theHgtScale;
1304  dV_dLat *= theSampScale/theLatScale;
1305  dV_dLon *= theSampScale/theLonScale;
1306  dV_dHgt *= theSampScale/theHgtScale;
1307 
1308  dU_dLat *= DEG_PER_RAD;
1309  dU_dLon *= DEG_PER_RAD;
1310  dV_dLat *= DEG_PER_RAD;
1311  dV_dLon *= DEG_PER_RAD;
1312 
1313  // Save the partials referenced to ECF
1314  ossimEcefPoint location(pos);
1315  NEWMAT::Matrix jMat(3,3);
1316  pos.datum()->ellipsoid()->jacobianWrtEcef(location, jMat);
1317  // Line
1318  theParWRTx.u = dU_dLat*jMat(1,1)+dU_dLon*jMat(2,1)+dU_dHgt*jMat(3,1);
1319  theParWRTy.u = dU_dLat*jMat(1,2)+dU_dLon*jMat(2,2)+dU_dHgt*jMat(3,2);
1320  theParWRTz.u = dU_dLat*jMat(1,3)+dU_dLon*jMat(2,3)+dU_dHgt*jMat(3,3);
1321  // Samp
1322  theParWRTx.v = dV_dLat*jMat(1,1)+dV_dLon*jMat(2,1)+dV_dHgt*jMat(3,1);
1323  theParWRTy.v = dV_dLat*jMat(1,2)+dV_dLon*jMat(2,2)+dV_dHgt*jMat(3,2);
1324  theParWRTz.v = dV_dLat*jMat(1,3)+dV_dLon*jMat(2,3)+dV_dHgt*jMat(3,3);
1325 
1326  // Residuals
1327  ossimDpt resid(theObs.samp-V, theObs.line-U);
1328  returnData = resid;
1329  }
1330 
1331  //******************************************
1332  // P_WRT_X, P_WRT_Y, P_WRT_Z modes
1333  // [1] 3 separate calls required
1334  // [2] return 3 sets of partials
1335  //******************************************
1336  else if (derivMode==P_WRT_X)
1337  {
1338  returnData = theParWRTx;
1339  }
1340 
1341  else if (derivMode==P_WRT_Y)
1342  {
1343  returnData = theParWRTy;
1344  }
1345 
1346  else
1347  {
1348  returnData = theParWRTz;
1349  }
1350 
1351  return returnData;
1352  }
1353 }
double theSampOffset
double theSampNumCoef[20]
#define DEG_PER_RAD
double u
Definition: ossimDpt.h:164
double dPoly_dHgt(const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
double samp
Definition: ossimDpt.h:164
double dPoly_dLat(const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
double theLonScale
double theLineScale
double polynomial(const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt &gpos, double hdelta=1e-11)
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double dPoly_dLon(const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
double theHgtOffset
double theLonOffset
double line
Definition: ossimDpt.h:165
double theLatScale
double theSampScale
double theLineDenCoef[20]
ossimDpt theParWRTx
Partials for current point.
double theLineOffset
ossimDpt theObs
Observations & residuals for current point.
double theHgtScale
double v
Definition: ossimDpt.h:165
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ getRandError()

double ossimRpcModel::getRandError ( ) const

Returns Error - Random.

Returns
Error - Random
Note
See NITF field "ERR_RAND" from RPC00x tag where x = A or B.

Definition at line 1360 of file ossimRpcModel.cpp.

References theRandError.

1361 {
1362  return theRandError;
1363 }
double theRandError

◆ getRpcParameters()

void ossimRpcModel::getRpcParameters ( ossimRpcModel::rpcModelStruct model) const

Returns RPC parameter set in structure.

Parameters
rpcModelStructstructure to initialize.

Definition at line 1372 of file ossimRpcModel.cpp.

References A, ossimRpcModel::rpcModelStruct::hgtOffset, ossimRpcModel::rpcModelStruct::hgtScale, ossimRpcModel::rpcModelStruct::latOffset, ossimRpcModel::rpcModelStruct::latScale, ossimRpcModel::rpcModelStruct::lineDenCoef, ossimRpcModel::rpcModelStruct::lineNumCoef, ossimRpcModel::rpcModelStruct::lineOffset, ossimRpcModel::rpcModelStruct::lineScale, ossimRpcModel::rpcModelStruct::lonOffset, ossimRpcModel::rpcModelStruct::lonScale, ossimRpcModel::rpcModelStruct::sampDenCoef, ossimRpcModel::rpcModelStruct::sampNumCoef, ossimRpcModel::rpcModelStruct::sampOffset, ossimRpcModel::rpcModelStruct::sampScale, theHgtOffset, theHgtScale, theLatOffset, theLatScale, theLineDenCoef, theLineNumCoef, theLineOffset, theLineScale, theLonOffset, theLonScale, thePolyType, theSampDenCoef, theSampNumCoef, theSampOffset, theSampScale, and ossimRpcModel::rpcModelStruct::type.

1373 {
1374  model.lineScale = theLineScale;
1375  model.sampScale = theSampScale;
1376  model.latScale = theLatScale;
1377  model.lonScale = theLonScale;
1378  model.hgtScale = theHgtScale;
1379  model.lineOffset = theLineOffset;
1380  model.sampOffset = theSampOffset;
1381  model.latOffset = theLatOffset;
1382  model.lonOffset = theLonOffset;
1383  model.hgtOffset = theHgtOffset;
1384 
1385  for (int i=0; i<20; ++i)
1386  {
1387  model.lineNumCoef[i] = theLineNumCoef[i];
1388  model.lineDenCoef[i] = theLineDenCoef[i];
1389  model.sampNumCoef[i] = theSampNumCoef[i];
1390  model.sampDenCoef[i] = theSampDenCoef[i];
1391  }
1392 
1393  if (thePolyType == A)
1394  {
1395  model.type= 'A';
1396  }
1397  else
1398  {
1399  model.type= 'B';
1400  }
1401 }
double theSampOffset
PolynomialType thePolyType
double theSampNumCoef[20]
double theLonScale
double theLineScale
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double theHgtOffset
double theLonOffset
double theLatScale
double theSampScale
double theLineDenCoef[20]
double theLineOffset
double theHgtScale

◆ imagingRay()

void ossimRpcModel::imagingRay ( const ossimDpt image_point,
ossimEcefRay image_ray 
) const
virtual

imagingRay() Overrides base class pure virtual.

Reimplemented from ossimSensorModel.

Definition at line 371 of file ossimRpcModel.cpp.

References ossimGpt::datum(), ossimDatum::ellipsoid(), ossimEllipsoid::gradient(), lineSampleHeightToWorld(), theHgtOffset, theHgtScale, and ossimEcefVector::unitVector().

Referenced by lineSampleToWorld().

373 {
374  //---
375  // For "from point", "to point" we want the image ray to be from above the
376  // ellipsoid down to Earth.
377  //
378  // It appears the ray "from point" must be above the ellipsiod for the
379  // ossimElevSource::intersectRay method; ultimately, the
380  // ossimEllipsoid::nearestIntersection method, else it goes off in the
381  // weeds...
382  //---
383 
384 // this one is messed up so keep as #if 0 untill tested more
385  #if 0
386 
387  ossimGpt gpt;
388 
389  lineSampleHeightToWorld(imagePoint, theHgtOffset, gpt);
390 
391  //lineSampleHeightToWorld(imagePoint, ossim::nan(), gpt);
392 
393  ossimEcefVector v;
394  if(gpt.datum())
395  {
396  if(gpt.datum()->ellipsoid())
397  {
398  gpt.datum()->ellipsoid()->gradient(ossimEcefPoint(gpt), v);
399 
400  v = v.unitVector();
401 
402  ossimEcefPoint intECFto(gpt);
403  ossimEcefPoint intECFfrom = (intECFto + v*100000);
404 
405  ossimEcefRay ray(intECFfrom, intECFto);
406 
407  imageRay = ray;
408  }
409  }
410 #else
411  double vectorLength = theHgtScale ? (theHgtScale * 2.0) : 1000.0;
412 
413  ossimGpt gpt;
414 
415  // "from" point
416  double intHgt = theHgtOffset + vectorLength;
417  lineSampleHeightToWorld(imagePoint, intHgt, gpt);
418  ossimEcefPoint intECFfrom(gpt);
419 
420  // "to" point
421  lineSampleHeightToWorld(imagePoint, theHgtOffset, gpt);
422  ossimEcefPoint intECFto(gpt);
423 
424  // Construct ray
425  ossimEcefRay ray(intECFfrom, intECFto);
426 
427  imageRay = ray;
428 
429  #endif
430 }
ossimEcefVector unitVector() const
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
double theHgtOffset
virtual const ossimEllipsoid * ellipsoid() const
Definition: ossimDatum.h:60
virtual void lineSampleHeightToWorld(const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
void gradient(const ossimEcefPoint &location, ossimEcefVector &result) const
double theHgtScale

◆ initAdjustableParameters()

void ossimRpcModel::initAdjustableParameters ( )
virtual

Reimplemented from ossimAdjustableParameterInterface.

Definition at line 730 of file ossimRpcModel.cpp.

References ossimAdjustableParameterInterface::getNumberOfAdjustableParameters(), NUM_ADJUSTABLE_PARAMS, ossimAdjustableParameterInterface::resizeAdjustableParameterArray(), ossimAdjustableParameterInterface::setAdjustableParameter(), and ossimAdjustableParameterInterface::setParameterDescription().

Referenced by ossimRpcModel().

731 {
733  int numParams = getNumberOfAdjustableParameters();
734  for (int i=0; i<numParams; i++)
735  {
736  setAdjustableParameter(i, 0.0);
737  setParameterDescription(i, PARAM_NAMES[i]);
738  setParameterUnit(i,PARAM_UNITS[i]);
739  }
745 // setParameterSigma(YAW_OFFSET, 0.001);
746 }
void setParameterDescription(ossim_uint32 idx, const ossimString &descrption)
void setParameterUnit(ossim_uint32 idx, ossimUnitType unit)
virtual void setAdjustableParameter(ossim_uint32 idx, double value, bool notify=false)
void resizeAdjustableParameterArray(ossim_uint32 numberOfParameters)
void setParameterSigma(ossim_uint32 idx, double value, bool notify=false)

◆ lineSampleHeightToWorld()

void ossimRpcModel::lineSampleHeightToWorld ( const ossimDpt lineSampPt,
const double &  heightEllipsoid,
ossimGpt worldPt 
) const
virtual

METHOD: lineSampleHeightToWorld This is the pure virtual that performs the actual work of projecting the image point to the given elevation above Ellipsoid.

Implements ossimSensorModel.

Reimplemented in ossimplugins::ossimRadarSat2RPCModel, and ossimNitfRpcModel.

Definition at line 442 of file ossimRpcModel.cpp.

References dPoly_dLat(), dPoly_dLon(), ossimGpt::hgt, ossim::isnan(), ossimGpt::lat, ossimGpt::lon, ossimNotify(), ossimNotifyLevel_WARN, polynomial(), theCosMapRot, theCrtrackOffset, theCrtrackScale, theHgtOffset, theHgtScale, theIntrackOffset, theIntrackScale, theLatOffset, theLatScale, theLineDenCoef, theLineNumCoef, theLineOffset, theLineScale, theLonOffset, theLonScale, theSampDenCoef, theSampNumCoef, theSampOffset, theSampScale, theSinMapRot, ossimDpt::x, and ossimDpt::y.

Referenced by ossimQuickbirdRpcModel::finishConstruction(), ossimplugins::ossimSpot6Model::finishConstruction(), ossimplugins::ossimPleiadesModel::finishConstruction(), imagingRay(), ossimNitfRpcModel::lineSampleHeightToWorld(), ossimplugins::ossimRadarSat2RPCModel::lineSampleHeightToWorld(), lineSampleToWorld(), and ossimplugins::ossimRadarSat2RPCModel::open().

445 {
446  // if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG)
447  // << "DEBUG ossimRpcModel::lineSampleHeightToWorld: entering..." << std::endl;
448 
449  //---
450  // Removed below "gpt.makeNan()" if outside of image. This was put in
451  // troubleshooting dateline wrap issues. Returned nans are also
452  // causing issues so commenting out. drb - 17 Dec. 2015
453  //---
454 
455  //***
456  // Extrapolate if point is outside image:
457  //***
458  // if (!insideImage(image_point))
459  // {
460  // gpt = extrapolate(image_point, ellHeight);
461  // if (traceExec()) CLOG << "returning..." << endl;
462  // return;
463  // }
464 
465  //***
466  // Constants for convergence tests:
467  //***
468  static const int MAX_NUM_ITERATIONS = 10;
469  static const double CONVERGENCE_EPSILON = 0.1; // pixels
470 
471  //***
472  // The image point must be adjusted by the adjustable parameters as well
473  // as the scale and offsets given as part of the RPC param normalization.
474  //
475  // NOTE: U = line, V = sample
476  //***
477  double U = (image_point.y-theLineOffset - theIntrackOffset) / (theLineScale+theIntrackScale);
478  double V = (image_point.x-theSampOffset - theCrtrackOffset) / (theSampScale+theCrtrackScale);
479 
480  //***
481  // Rotate the normalized U, V by the map rotation error (adjustable param):
482  //***
483  double U_rot = theCosMapRot*U - theSinMapRot*V;
484  double V_rot = theSinMapRot*U + theCosMapRot*V;
485  U = U_rot; V = V_rot;
486 
487 
488  // now apply adjust intrack and cross track
489  //***
490  // Initialize quantities to be used in the iteration for ground point:
491  //***
492  double nlat = 0.0; // normalized latitude
493  double nlon = 0.0; // normalized longitude
494 
495  double nhgt;
496 
497  if(ossim::isnan(ellHeight))
498  {
499  nhgt = (theHgtScale - theHgtOffset) / theHgtScale; // norm height
500  }
501  else
502  {
503  nhgt = (ellHeight - theHgtOffset) / theHgtScale; // norm height
504  }
505 
506  double epsilonU = CONVERGENCE_EPSILON/(theLineScale+theIntrackScale);
507  double epsilonV = CONVERGENCE_EPSILON/(theSampScale+theCrtrackScale);
508  int iteration = 0;
509 
510  //***
511  // Declare variables only once outside the loop. These include:
512  // * polynomials (numerators Pu, Pv, and denominators Qu, Qv),
513  // * partial derivatives of polynomials wrt X, Y,
514  // * computed normalized image point: Uc, Vc,
515  // * residuals of normalized image point: deltaU, deltaV,
516  // * partial derivatives of Uc and Vc wrt X, Y,
517  // * corrections to normalized lat, lon: deltaLat, deltaLon.
518  //***
519  double Pu, Qu, Pv, Qv;
520  double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
521  double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
522  double Uc, Vc;
523  double deltaU, deltaV;
524  double dU_dLat, dU_dLon, dV_dLat, dV_dLon, W;
525  double deltaLat, deltaLon;
526 
527  //***
528  // Now iterate until the computed Uc, Vc is within epsilon of the desired
529  // image point U, V:
530  //***
531  do
532  {
533  //***
534  // Calculate the normalized line and sample Uc, Vc as ratio of
535  // polynomials Pu, Qu and Pv, Qv:
536  //***
537  Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
538  Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
539  Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
540  Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
541  Uc = Pu/Qu;
542  Vc = Pv/Qv;
543 
544  //***
545  // Compute residuals between desired and computed line, sample:
546  //***
547  deltaU = U - Uc;
548  deltaV = V - Vc;
549 
550  //***
551  // Check for convergence and skip re-linearization if converged:
552  //***
553  if ((fabs(deltaU) > epsilonU) || (fabs(deltaV) > epsilonV))
554  {
555  //***
556  // Analytically compute the partials of each polynomial wrt lat, lon:
557  //***
558  dPu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineNumCoef);
559  dQu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineDenCoef);
560  dPv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampNumCoef);
561  dQv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampDenCoef);
562  dPu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineNumCoef);
563  dQu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineDenCoef);
564  dPv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampNumCoef);
565  dQv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampDenCoef);
566 
567  //***
568  // Analytically compute partials of quotients U and V wrt lat, lon:
569  //***
570  dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
571  dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
572  dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
573  dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
574 
575  W = dU_dLon*dV_dLat - dU_dLat*dV_dLon;
576 
577  //***
578  // Now compute the corrections to normalized lat, lon:
579  //***
580  deltaLat = (dU_dLon*deltaV - dV_dLon*deltaU) / W;
581  deltaLon = (dV_dLat*deltaU - dU_dLat*deltaV) / W;
582  nlat += deltaLat;
583  nlon += deltaLon;
584  }
585 
586  //double h = ossimElevManager::instance()->getHeightAboveEllipsoid(ossimGpt(nlat, nlon));
587  // if(!ossim::isnan(h))
588  // {
589  // nhgt = h;
590  // }
591 
592  iteration++;
593 
594  } while (((fabs(deltaU)>epsilonU) || (fabs(deltaV)>epsilonV))
595  && (iteration < MAX_NUM_ITERATIONS));
596 
597  //***
598  // Test for exceeding allowed number of iterations. Flag error if so:
599  //***
600  if (iteration == MAX_NUM_ITERATIONS)
601  {
602  ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimRpcModel::lineSampleHeightToWorld: \nMax number of iterations reached in ground point "
603  << "solution. Results are inaccurate." << endl;
604  }
605 
606  //***
607  // Now un-normalize the ground point lat, lon and establish return quantity:
608  //***
609  gpt.lat = nlat*theLatScale + theLatOffset;
610  gpt.lon = nlon*theLonScale + theLonOffset;
611  gpt.hgt = ellHeight;
612 
613 }
double theSampOffset
double theSampNumCoef[20]
double theIntrackOffset
double theIntrackScale
double dPoly_dLat(const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
double theLonScale
double theLineScale
double polynomial(const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double dPoly_dLon(const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
double theHgtOffset
double theLonOffset
double theLatScale
double theCrtrackScale
double theCrtrackOffset
double theSampScale
double theLineDenCoef[20]
double theSinMapRot
double theCosMapRot
double theLineOffset
double theHgtScale
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ lineSampleToWorld()

void ossimRpcModel::lineSampleToWorld ( const ossimDpt image_point,
ossimGpt world_point 
) const
virtual

Implementation of base-class pure virtual projection methods. These methods may be overriden by derived classes if those have more efficient schemes. The implementations here are iterative (relatively slow). Both depend on calls to the pure virtual lineSampleHeightToWorld() method.

Reimplemented from ossimSensorModel.

Definition at line 331 of file ossimRpcModel.cpp.

References ossimDpt::hasNans(), ossimGpt::height(), imagingRay(), ossimElevManager::instance(), ossimElevSource::intersectRay(), lineSampleHeightToWorld(), and ossimGpt::makeNan().

Referenced by ossimplugins::ossimRadarSat2RPCModel::open().

333 {
334 //---
335 // Under debate... (drb 20130610)
336 // this seems to be more accurate for the round trip
337 //---
338 #if 0
339  if(!imagePoint.hasNans())
340  {
341 
342  lineSampleHeightToWorld(imagePoint,
343  worldPoint.height(),
344  worldPoint);
345  }
346  else
347  {
348  worldPoint.makeNan();
349  }
350 #else
351  if(!imagePoint.hasNans())
352  {
353  ossimEcefRay ray;
354  imagingRay(imagePoint, ray);
355  ossimElevManager::instance()->intersectRay(ray, worldPoint);
356  }
357  else
358  {
359  worldPoint.makeNan();
360  }
361 #endif
362 }
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const
imagingRay() Overrides base class pure virtual.
bool intersectRay(const ossimEcefRay &ray, ossimGpt &gpt, double defaultElevValue=0.0)
METHOD: intersectRay()
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
virtual void lineSampleHeightToWorld(const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const

◆ loadState()

bool ossimRpcModel::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

loadState Fulfills ossimObject base-class pure virtuals.

Loads and saves geometry KWL files. Returns true if successful.

Reimplemented from ossimSensorModel.

Reimplemented in ossimplugins::ossimRadarSat2RPCModel, ossimplugins::ossimPleiadesModel, ossimplugins::ossimSpot6Model, ossimNitfRpcModel, ossimIkonosRpcModel, and ossimQuickbirdRpcModel.

Definition at line 870 of file ossimRpcModel.cpp.

Referenced by ossimQuickbirdRpcModel::loadState(), ossimIkonosRpcModel::loadState(), ossimNitfRpcModel::loadState(), ossimplugins::ossimSpot6Model::loadState(), ossimplugins::ossimPleiadesModel::loadState(), ossimplugins::ossimRadarSat2RPCModel::loadState(), and setupOptimizer().

872 {
873  if (traceExec())
874  {
876  << "DEBUG ossimRpcModel::loadState(): entering..." << std::endl;
877  }
878 
879  const char* value;
880  const char* keyword;
881 
882  //***
883  // Pass on to the base-class for parsing first:
884  //***
885  bool success = ossimSensorModel::loadState(kwl, prefix);
886  if (!success)
887  {
888  theErrorStatus++;
889 
890  if (traceExec())
891  {
893  << "DEBUG ossimRpcModel::loadState(): returning with error..."
894  << std::endl;
895  }
896  return false;
897  }
898 
899  //---
900  // Continue parsing for local members:
901  //---
902  value = kwl.find(prefix, BIAS_ERROR_KW);
903  if (value)
904  {
905  theBiasError = ossimString(value).toDouble();
906  }
907 
908  value = kwl.find(prefix, RAND_ERROR_KW);
909  if (value)
910  {
911  theRandError = ossimString(value).toDouble();
912  }
913 
914  keyword = POLY_TYPE_KW;
915  value = kwl.find(prefix, keyword);
916  if (!value)
917  {
918  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
919  << "<" << keyword << ">. Check the keywordlist for proper syntax."
920  << std::endl;
921  return false;
922  }
923  thePolyType = (PolynomialType) value[0];
924 
925  keyword = LINE_SCALE_KW;
926  value = kwl.find(prefix, keyword);
927  if (!value)
928  {
929  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
930  << "<" << keyword << ">. Check the keywordlist for proper syntax."
931  << std::endl;
932  return false;
933  }
934  theLineScale = atof(value);
935 
936  keyword = SAMP_SCALE_KW;
937  value = kwl.find(prefix, keyword);
938  if (!value)
939  {
940  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
941  << "<" << keyword << ">. Check the keywordlist for proper syntax."
942  << std::endl;
943  return false;
944  }
945  theSampScale = atof(value);
946 
947  keyword = LAT_SCALE_KW;
948  value = kwl.find(prefix, keyword);
949  if (!value)
950  {
951  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
952  << "<" << keyword << ">. Check the keywordlist for proper syntax."
953  << std::endl;
954  return false;
955  }
956  theLatScale = atof(value);
957 
958  keyword = LON_SCALE_KW;
959  value = kwl.find(prefix, keyword);
960  if (!value)
961  {
962  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
963  << "<" << keyword << ">. Check the keywordlist for proper syntax."
964  << std::endl;
965  return false;
966  }
967  theLonScale = atof(value);
968 
969  keyword = HGT_SCALE_KW;
970  value = kwl.find(prefix, keyword);
971  if (!value)
972  {
973  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
974  << "<" << keyword << ">. Check the keywordlist for proper syntax."
975  << std::endl;
976  return false;
977  }
978  theHgtScale = atof(value);
979 
980  keyword = LINE_OFFSET_KW;
981  value = kwl.find(prefix, keyword);
982  if (!value)
983  {
984  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
985  << "<" << keyword << ">. Check the keywordlist for proper syntax."
986  << std::endl;
987  return false;
988  }
989  theLineOffset = atof(value);
990 
991  keyword = SAMP_OFFSET_KW;
992  value = kwl.find(prefix, keyword);
993  if (!value)
994  {
995  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
996  << "<" << keyword << ">. Check the keywordlist for proper syntax."
997  << std::endl;
998  return false;
999  }
1000  theSampOffset = atof(value);
1001 
1002  keyword = LAT_OFFSET_KW;
1003  value = kwl.find(prefix, keyword);
1004  if (!value)
1005  {
1006  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
1007  << "<" << keyword << ">. Check the keywordlist for proper syntax."
1008  << std::endl;
1009  return false;
1010  }
1011  theLatOffset = atof(value);
1012 
1013  keyword = LON_OFFSET_KW;
1014  value = kwl.find(prefix, keyword);
1015  if (!value)
1016  {
1017  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
1018  << "<" << keyword << ">. Check the keywordlist for proper syntax."
1019  << std::endl;
1020  return false;
1021  }
1022  theLonOffset = atof(value);
1023 
1024  keyword = HGT_OFFSET_KW;
1025  value = kwl.find(prefix, keyword);
1026  if (!value)
1027  {
1028  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
1029  << "<" << keyword << ">. Check the keywordlist for proper syntax."
1030  << std::endl;
1031  return false;
1032  }
1033  theHgtOffset = atof(value);
1034 
1035  for (int i=0; i<NUM_COEFFS; i++)
1036  {
1037  ossimString keyword;
1038  ostringstream os;
1039  os << setw(2) << setfill('0') << right << i;
1040 
1041  keyword = LINE_NUM_COEF_KW;
1042  keyword += os.str();
1043  value = kwl.find(prefix, keyword.c_str());
1044  if (!value)
1045  {
1047  << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
1048  << "<" << keyword << ">. Check the keywordlist for proper syntax."
1049  << std::endl;
1050  return false;
1051  }
1052  theLineNumCoef[i] = atof(value);
1053 
1054  keyword = LINE_DEN_COEF_KW;
1055  keyword += os.str();
1056  value = kwl.find(prefix, keyword.c_str());
1057  if (!value)
1058  {
1059  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
1060  << "<" << keyword << ">. Check the keywordlist for proper syntax."
1061  << std::endl;
1062  return false;
1063  }
1064  theLineDenCoef[i] = atof(value);
1065 
1066  keyword = SAMP_NUM_COEF_KW;
1067  keyword += os.str();
1068  value = kwl.find(prefix, keyword.c_str());
1069  if (!value)
1070  {
1071  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
1072  << "<" << keyword << ">. Check the keywordlist for proper syntax."
1073  << std::endl;
1074  return false;
1075  }
1076  theSampNumCoef[i] = atof(value);
1077 
1078  keyword = SAMP_DEN_COEF_KW;
1079  keyword += os.str();
1080  value = kwl.find(prefix, keyword.c_str());
1081  if (!value)
1082  {
1083  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
1084  << "<" << keyword << ">. Check the keywordlist for proper syntax."
1085  << std::endl;
1086  return false;
1087  }
1088  theSampDenCoef[i] = atof(value);
1089  }
1090 
1091  //***
1092  // Initialize other data members given quantities read in KWL:
1093  //***
1094  theCosMapRot = 1.0;
1095  theSinMapRot = 0.0;
1096 
1097  updateModel();
1098 
1099  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::loadState(): returning..." << std::endl;
1100  return true;
1101 }
double theSampOffset
PolynomialType thePolyType
double theSampNumCoef[20]
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
const char * find(const char *key) const
virtual void updateModel()
double theLonScale
double theLineScale
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double theHgtOffset
double theLonOffset
double theRandError
double theLatScale
double toDouble() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
double theSampScale
double theLineDenCoef[20]
double theSinMapRot
double theCosMapRot
double theLineOffset
double theHgtScale
double theBiasError
error
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ polynomial()

double ossimRpcModel::polynomial ( const double &  nlat,
const double &  nlon,
const double &  nhgt,
const double *  coeffs 
) const
protected

Definition at line 621 of file ossimRpcModel.cpp.

References A, and thePolyType.

Referenced by getForwardDeriv(), lineSampleHeightToWorld(), and worldToLineSample().

623 {
624  double r;
625 
626  if (thePolyType == A)
627  {
628  r = c[ 0] + c[ 1]*L + c[ 2]*P + c[ 3]*H +
629  c[ 4]*L*P + c[ 5]*L*H + c[ 6]*P*H + c[ 7]*L*P*H +
630  c[ 8]*L*L + c[ 9]*P*P + c[10]*H*H + c[11]*L*L*L +
631  c[12]*L*L*P + c[13]*L*L*H + c[14]*L*P*P + c[15]*P*P*P +
632  c[16]*P*P*H + c[17]*L*H*H + c[18]*P*H*H + c[19]*H*H*H;
633  }
634  else
635  {
636  r = c[ 0] + c[ 1]*L + c[ 2]*P + c[ 3]*H +
637  c[ 4]*L*P + c[ 5]*L*H + c[ 6]*P*H + c[ 7]*L*L +
638  c[ 8]*P*P + c[ 9]*H*H + c[10]*L*P*H + c[11]*L*L*L +
639  c[12]*L*P*P + c[13]*L*H*H + c[14]*L*L*P + c[15]*P*P*P +
640  c[16]*P*H*H + c[17]*L*L*H + c[18]*P*P*H + c[19]*H*H*H;
641  }
642 
643  return r;
644 }
PolynomialType thePolyType

◆ print()

std::ostream & ossimRpcModel::print ( std::ostream &  out) const
virtual

print() Extends base-class implementation.

Dumps contents of object to ostream.

Reimplemented from ossimSensorModel.

Reimplemented in ossimplugins::ossimRadarSat2RPCModel, ossimplugins::ossimPleiadesModel, and ossimplugins::ossimSpot6Model.

Definition at line 759 of file ossimRpcModel.cpp.

Referenced by ossimplugins::ossimPleiadesModel::print(), ossimplugins::ossimSpot6Model::print(), and ossimplugins::ossimRadarSat2RPCModel::print().

760 {
761  out << "\nDump of ossimRpcModel object at " << std::hex << this << std::dec << ":\n"
762  << POLY_TYPE_KW << ": " << thePolyType << "\n"
763  << LINE_SCALE_KW << ": " << theLineScale << "\n"
764  << SAMP_SCALE_KW << ": " << theSampScale << "\n"
765  << LAT_SCALE_KW << ": " << theLatScale << "\n"
766  << LON_SCALE_KW << ": " << theLonScale << "\n"
767  << HGT_SCALE_KW << ": " << theHgtScale << "\n"
768  << LINE_OFFSET_KW << ": " << theLineOffset << "\n"
769  << SAMP_OFFSET_KW << ": " << theSampOffset << "\n"
770  << LAT_OFFSET_KW << ": " << theLatOffset << "\n"
771  << LON_OFFSET_KW << ": " << theLonOffset << "\n"
772  << HGT_OFFSET_KW << ": " << theHgtOffset << "\n"
773  << BIAS_ERROR_KW << ": " << theBiasError << "\n"
774  << RAND_ERROR_KW << ": " << theRandError << "\n"
775  << std::endl;
776 
777  for (int i=0; i<NUM_COEFFS; i++)
778  out<<" "<<LINE_NUM_COEF_KW<<"["<<i<<"]: "<<theLineNumCoef[i]<<std::endl;
779 
780  out << std::endl;
781  for (int i=0; i<NUM_COEFFS; i++)
782  out<<" "<<LINE_DEN_COEF_KW<<"["<<i<<"]: "<<theLineDenCoef[i]<<std::endl;
783 
784  out << std::endl;
785  for (int i=0; i<NUM_COEFFS; i++)
786  out<<" "<<SAMP_NUM_COEF_KW<<"["<<i<<"]: "<<theSampNumCoef[i]<<std::endl;
787 
788  out << std::endl;
789  for (int i=0; i<NUM_COEFFS; i++)
790  out<<" "<<SAMP_DEN_COEF_KW<<"["<<i<<"]: "<<theSampDenCoef[i]<<std::endl;
791 
792  out << std::endl;
793 
794  return ossimSensorModel::print(out);
795 }
double theSampOffset
PolynomialType thePolyType
double theSampNumCoef[20]
double theLonScale
double theLineScale
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double theHgtOffset
double theLonOffset
double theRandError
double theLatScale
virtual std::ostream & print(std::ostream &out) const
double theSampScale
double theLineDenCoef[20]
double theLineOffset
double theHgtScale
double theBiasError
error

◆ saveState()

bool ossimRpcModel::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

saveState Fulfills ossimObject base-class pure virtuals.

Loads and saves geometry KWL files. Returns true if successful.

Reimplemented from ossimSensorModel.

Reimplemented in ossimplugins::ossimRadarSat2RPCModel, ossimplugins::ossimPleiadesModel, ossimplugins::ossimSpot6Model, ossimNitfRpcModel, ossimQuickbirdRpcModel, and ossimIkonosRpcModel.

Definition at line 803 of file ossimRpcModel.cpp.

Referenced by ossimRpcProjection::optimizeFit(), ossimIkonosRpcModel::saveState(), ossimQuickbirdRpcModel::saveState(), ossimNitfRpcModel::saveState(), ossimplugins::ossimPleiadesModel::saveState(), ossimplugins::ossimSpot6Model::saveState(), and ossimplugins::ossimRadarSat2RPCModel::saveState().

805 {
806  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::saveState(): entering..." << std::endl;
807 
808  kwl.add(prefix, ossimKeywordNames::TYPE_KW, MODEL_TYPE);
809 
810  //***
811  // Hand off to base class for common stuff:
812  //***
813  ossimSensorModel::saveState(kwl, prefix);
814 
815  //---
816  // Save off offsets and scales:
817  //---
818  kwl.add(prefix, POLY_TYPE_KW, ((char)thePolyType));
819  kwl.add(prefix, LINE_SCALE_KW, theLineScale);
820  kwl.add(prefix, SAMP_SCALE_KW, theSampScale);
821  kwl.add(prefix, LAT_SCALE_KW, theLatScale);
822  kwl.add(prefix, LON_SCALE_KW, theLonScale);
823  kwl.add(prefix, HGT_SCALE_KW, theHgtScale);
824  kwl.add(prefix, LINE_OFFSET_KW, theLineOffset);
825  kwl.add(prefix, SAMP_OFFSET_KW, theSampOffset);
826  kwl.add(prefix, LAT_OFFSET_KW, theLatOffset);
827  kwl.add(prefix, LON_OFFSET_KW, theLonOffset);
828  kwl.add(prefix, HGT_OFFSET_KW, theHgtOffset);
829  kwl.add(prefix, BIAS_ERROR_KW, theBiasError);
830  kwl.add(prefix, RAND_ERROR_KW, theRandError);
831 
832  for (int i=0; i<NUM_COEFFS; i++)
833  {
834  ossimString key;
836  os << setw(2) << setfill('0') << right << i;
837 
838  key = LINE_NUM_COEF_KW;
839  key += os.str();
840  kwl.add(prefix, key.c_str(), theLineNumCoef[i],
841  true, 15);
842 
843  key = LINE_DEN_COEF_KW;
844  key += os.str();
845  kwl.add(prefix, key.c_str(), theLineDenCoef[i],
846  true, 15);
847 
848  key = SAMP_NUM_COEF_KW;
849  key += os.str();
850  kwl.add(prefix, key.c_str(), theSampNumCoef[i],
851  true, 15);
852 
853  key = SAMP_DEN_COEF_KW;
854  key += os.str();
855  kwl.add(prefix, key.c_str(), theSampDenCoef[i],
856  true, 15);
857  }
858 
859  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::saveState(): returning..." << std::endl;
860  return true;
861 }
double theSampOffset
PolynomialType thePolyType
double theSampNumCoef[20]
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
double theLonScale
double theLineScale
static const char * TYPE_KW
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
double theHgtOffset
double theLonOffset
double theRandError
double theLatScale
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
double theSampScale
double theLineDenCoef[20]
double theLineOffset
double theHgtScale
double theBiasError
error
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ setAttributes()

void ossimRpcModel::setAttributes ( ossim_float64  theSampleOffset,
ossim_float64  theLineOffset,
ossim_float64  theSampleScale,
ossim_float64  theLineScale,
ossim_float64  theLatOffset,
ossim_float64  theLonOffset,
ossim_float64  theHeightOffset,
ossim_float64  theLatScale,
ossim_float64  theLonScale,
ossim_float64  theHeightScale,
const std::vector< double > &  xNumeratorCoeffs,
const std::vector< double > &  xDenominatorCoeffs,
const std::vector< double > &  yNumeratorCoeffs,
const std::vector< double > &  yDenominatorCoeffs,
PolynomialType  polyType = B,
bool  computeGsdFlag = true 
)

Definition at line 159 of file ossimRpcModel.cpp.

References ossimSensorModel::computeGsd(), theHgtOffset, theHgtScale, theLatOffset, theLatScale, theLineDenCoef, theLineNumCoef, theLineOffset, theLineScale, theLonOffset, theLonScale, thePolyType, theSampDenCoef, theSampNumCoef, theSampOffset, and theSampScale.

175 {
176  thePolyType = polyType;
177 
178  theLineScale = lineScale;
179  theSampScale = sampleScale;
180  theLatScale = latScale;
181  theLonScale = lonScale;
182  theHgtScale = heightScale;
183  theLineOffset = lineOffset;
184  theSampOffset = sampleOffset;
185  theLatOffset = latOffset;
186  theLonOffset = lonOffset;
187  theHgtOffset = heightOffset;
188 
189  if(xNumeratorCoeffs.size() == 20)
190  {
191  std::copy(xNumeratorCoeffs.begin(),
192  xNumeratorCoeffs.end(),
194  }
195  if(xDenominatorCoeffs.size() == 20)
196  {
197  std::copy(xDenominatorCoeffs.begin(),
198  xDenominatorCoeffs.end(),
200  }
201  if(yNumeratorCoeffs.size() == 20)
202  {
203  std::copy(yNumeratorCoeffs.begin(),
204  yNumeratorCoeffs.end(),
206  }
207  if(yDenominatorCoeffs.size() == 20)
208  {
209  std::copy(yDenominatorCoeffs.begin(),
210  yDenominatorCoeffs.end(),
212  }
213 
214  if(computeGsdFlag)
215  {
216  try
217  {
218  // This will set theGSD and theMeanGSD. Method throws ossimException.
219  computeGsd();
220  }
221  catch (const ossimException& e)
222  {
223  if (traceDebug())
224  {
226  << "ossimRpcModel::setAttributes Caught Exception:\n"
227  << e.what() << std::endl;
228  }
229  }
230  }
231 }
double theSampOffset
PolynomialType thePolyType
double theSampNumCoef[20]
double theLonScale
double theLineScale
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double theHgtOffset
double theLonOffset
void computeGsd()
This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD ...
double theLatScale
virtual const char * what() const
Returns the error message.
double theSampScale
double theLineDenCoef[20]
double theLineOffset
double theHgtScale
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ setImageOffset()

void ossimRpcModel::setImageOffset ( const ossimDpt offset_to_chip_ul)

Allows setting an offset to a subimage while using the coefficients of a full-image model.

This adds a shift to the line and sample offsets so they corresond to the local subimage image space coordinates. Note thatthe base class' theImageRect will be adjusted to reflect the shift, even though the chip's LR corner will probably be wrong.

Definition at line 1403 of file ossimRpcModel.cpp.

References ossimDrect::hasNans(), ossimDpt::line, ossimDpt::samp, ossimSensorModel::theImageClipRect, ossimSensorModel::theImageSize, theLineOffset, theSampOffset, ossimIpt::x, ossimDpt::x, ossimIpt::y, and ossimDpt::y.

Referenced by ossimSubImageTool::execute(), and ossimQuickbirdRpcModel::parseTileData().

1404 {
1405  theLineOffset -= offset.line;
1406  theSampOffset -= offset.samp;
1407 
1408  if (theImageClipRect.hasNans())
1409  theImageClipRect = ossimDrect(0, 0, theImageSize.x-offset.x-1, theImageSize.y-offset.y-1);
1410  else
1411  theImageClipRect -= offset;
1412 }
double theSampOffset
bool hasNans() const
Definition: ossimDrect.h:396
ossimDrect theImageClipRect
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
double theLineOffset

◆ setMetersPerPixel()

void ossimRpcModel::setMetersPerPixel ( const ossimDpt metersPerPixel)

Definition at line 233 of file ossimRpcModel.cpp.

References ossimSensorModel::theGSD, ossimSensorModel::theMeanGSD, ossimDpt::x, and ossimDpt::y.

234 {
235  theGSD = metersPerPixel;
236  theMeanGSD = (theGSD.x+theGSD.y)*.5;
237 }
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164
ossim_float64 theMeanGSD

◆ setPositionError()

void ossimRpcModel::setPositionError ( const ossim_float64 biasError,
const ossim_float64 randomError,
bool  initNominalPostionErrorFlag 
)

Sets data member theBiasError, theRandError.

Parameters
biasErrorError - Bias 68% non time - varying error estimate assumes correlated images. Units = meters.
randErrorError - Random 68% time - varying error estimate assumes uncorrelated images. Units = meters.
initNominalPostionErrorFlagIf true the base data member theNominalPosError will be initialized with: sqrt(theBiasError*theBiasError +theRandError*theRandError)

Definition at line 239 of file ossimRpcModel.cpp.

References theBiasError, ossimSensorModel::theNominalPosError, and theRandError.

242 {
243  theBiasError = biasError;
244  theRandError = randomError;
245  if (initNominalPostionErrorFlag)
246  {
248  theRandError*theRandError); // meters
249  }
250 }
double theRandError
ossim_float64 theNominalPosError
double theBiasError
error

◆ setupOptimizer()

bool ossimRpcModel::setupOptimizer ( const ossimString init_file)
virtual

uses file path to init model

Reimplemented from ossimOptimizableProjection.

Definition at line 1168 of file ossimRpcModel.cpp.

References ossimKeywordlist::addFile(), ossimKeywordlist::clear(), ossimProjectionFactoryRegistry::createProjection(), ossimProjectionFactoryRegistry::instance(), loadState(), ossimProjection::saveState(), and ossimRefPtr< T >::valid().

1169 {
1170  ossimKeywordlist kwl;
1171 
1172  if(kwl.addFile(ossimFilename(init_file)))
1173  {
1174  return loadState(kwl);
1175  }
1176  else
1177  {
1179  if(proj.valid())
1180  {
1181  kwl.clear();
1182  proj->saveState(kwl);
1183 
1184  return loadState(kwl);
1185  }
1186  }
1187 
1188  return false;
1189 }
Represents serializable keyword/value map.
bool addFile(const char *file)
bool valid() const
Definition: ossimRefPtr.h:75
ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
static ossimProjectionFactoryRegistry * instance()
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
loadState Fulfills ossimObject base-class pure virtuals.

◆ toJSON()

bool ossimRpcModel::toJSON ( std::ostream &  json) const

Serializes RPC to JSON format.

Definition at line 1415 of file ossimRpcModel.cpp.

References A, ossimString::string(), theBiasError, theHgtOffset, theHgtScale, theLatOffset, theLatScale, theLineDenCoef, theLineNumCoef, theLineOffset, theLineScale, theLonOffset, theLonScale, thePolyType, theRandError, theSampDenCoef, theSampNumCoef, theSampOffset, theSampScale, and ossimString::toString().

Referenced by ossimSubImageTool::execute().

1416 {
1417 #if OSSIM_HAS_JSONCPP
1418  Json::Value IMAGE;
1419  IMAGE["ERRBIAS"] = theBiasError;
1420  IMAGE["ERRRAND"] = theRandError;
1421  IMAGE["LINEOFFSET"] = (int)theLineOffset;
1422  IMAGE["SAMPOFFSET"] = (int)theSampOffset;
1423  IMAGE["LATOFFSET"] = theLatOffset;
1424  IMAGE["LONGOFFSET"] = theLonOffset;
1425  IMAGE["HEIGHTOFFSET"] = theHgtOffset;
1426  IMAGE["LINESCALE"] = theLineScale;
1427  IMAGE["SAMPSCALE"] = theSampScale;
1428  IMAGE["LATSCALE"] = theLatScale;
1429  IMAGE["LONGSCALE"] = theLonScale;
1430  IMAGE["HEIGHTSCALE"] = theHgtScale;
1431 
1432  // Preferred way to output coeff arrays:
1433 // Json::Value LINENUMCOEF(Json::arrayValue);
1434 // Json::Value LINEDENCOEF(Json::arrayValue);
1435 // Json::Value SAMPNUMCOEF(Json::arrayValue);
1436 // Json::Value SAMPDENCOEF(Json::arrayValue);
1437 // for (int i=0; i<20; ++i)
1438 // {
1439 // LINENUMCOEF.append(theLineNumCoef[i]);
1440 // LINEDENCOEF.append(theLineDenCoef[i]);
1441 // SAMPNUMCOEF.append(theSampNumCoef[i]);
1442 // SAMPDENCOEF.append(theSampDenCoef[i]);
1443 // }
1444 
1445  // Write coeffs as string list for JSON to XML converter to output properly:
1446  ossimString LINENUMCOEF;
1447  ossimString LINEDENCOEF;
1448  ossimString SAMPNUMCOEF;
1449  ossimString SAMPDENCOEF;
1450  for (int i=0; i<20; ++i)
1451  {
1452  LINENUMCOEF += ossimString::toString(theLineNumCoef[i]) + " ";
1453  LINEDENCOEF += ossimString::toString(theLineDenCoef[i]) + " ";
1454  SAMPNUMCOEF += ossimString::toString(theSampNumCoef[i]) + " ";
1455  SAMPDENCOEF += ossimString::toString(theSampDenCoef[i]) + " ";
1456  }
1457 
1458  Json::Value LINENUMCOEFList;
1459  LINENUMCOEFList["LINENUMCOEF"] = LINENUMCOEF.string();
1460  IMAGE["LINENUMCOEFList"] = LINENUMCOEFList;
1461 
1462  Json::Value LINEDENCOEFList;
1463  LINEDENCOEFList["LINEDENCOEF"] = LINEDENCOEF.string();
1464  IMAGE["LINEDENCOEFList"] = LINEDENCOEFList;
1465 
1466  Json::Value SAMPNUMCOEFList;
1467  SAMPNUMCOEFList["SAMPNUMCOEF"] = SAMPNUMCOEF.string();
1468  IMAGE["SAMPNUMCOEFList"] = SAMPNUMCOEFList;
1469 
1470  Json::Value SAMPDENCOEFList;
1471  SAMPDENCOEFList["SAMPDENCOEF"] = SAMPDENCOEF.string();
1472  IMAGE["SAMPDENCOEFList"] = SAMPDENCOEFList;
1473 
1474  Json::Value RPB;
1475  RPB["SATID"] = "NOT_ASSIGNED";
1476  RPB["BANDID"] = "NOT_ASSIGNED";
1477  if (thePolyType == A)
1478  RPB["SPECID"] = "RPC00A"; // Not sure this will work
1479  else
1480  RPB["SPECID"] = "RPC00B";
1481  RPB["IMAGE"] = IMAGE;
1482 
1483  Json::Value ISD;
1484  ISD["RPB"] = RPB;
1485 
1486  Json::Value root;
1487  root["isd"] = ISD;
1488  jsonStream << root;
1489  return true;
1490 #else
1491  jsonStream<<"Error: JSON format not supported."<<endl;
1492  return false;
1493 #endif
1494 }
double theSampOffset
PolynomialType thePolyType
double theSampNumCoef[20]
static ossimString toString(bool aValue)
Numeric to string methods.
double theLonScale
double theLineScale
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double theHgtOffset
double theLonOffset
double theRandError
double theLatScale
double theSampScale
double theLineDenCoef[20]
double theLineOffset
double theHgtScale
double theBiasError
error
const std::string & string() const
Definition: ossimString.h:414

◆ toRPB()

bool ossimRpcModel::toRPB ( std::ostream &  out) const

Serialize to WorldView-style .RPB file to the stream provided.

Returns TRUE on successful write.

Definition at line 1496 of file ossimRpcModel.cpp.

References theBiasError, theHgtOffset, theHgtScale, theLatOffset, theLatScale, theLineDenCoef, theLineNumCoef, theLineOffset, theLineScale, theLonOffset, theLonScale, theRandError, theSampDenCoef, theSampNumCoef, theSampOffset, and theSampScale.

Referenced by ossimDemTool::doASP(), and ossimSubImageTool::execute().

1497 {
1498  out<<"satId = \"NOT_ASSIGNED\";\n";
1499  out<<"bandId = \"NOT_ASSIGNED\";\n";
1500  out<<"SpecId = \"RPC00B\";\n";
1501 
1502  out<<"BEGIN_GROUP = IMAGE\n";
1503  out<<"\terrBias = "<<theBiasError<<";\n";
1504  out<<"\terrRand = "<<theRandError<<";\n";
1505  out<<"\tlineOffset = "<<(int)theLineOffset<<";\n";
1506  out<<"\tsampOffset = "<<(int)theSampOffset<<";\n";
1507  out<<"\tlatOffset = "<<theLatOffset<<";\n";
1508  out<<"\tlongOffset = "<<theLonOffset<<";\n";
1509  out<<"\theightOffset = "<<theHgtOffset<<";\n";
1510  out<<"\tlineScale = "<<theLineScale<<";\n";
1511  out<<"\tsampScale = "<<theSampScale<<";\n";
1512  out<<"\tlatScale = "<<theLatScale<<";\n";
1513  out<<"\tlongScale = "<<theLonScale<<";\n";
1514  out<<"\theightScale = "<<theHgtScale<<";\n";
1515 
1516  out<<"\tlineNumCoef = (\n";
1517  for (int i=0; i<19; ++i)
1518  out<<"\t\t\t"<<std::scientific<<theLineNumCoef[i]<<",\n";
1519  out<<"\t\t\t"<<std::scientific<<theLineNumCoef[19]<<");\n";
1520 
1521  out<<"\tlineDenCoef = (\n";
1522  for (int i=0; i<19; ++i)
1523  out<<"\t\t\t"<<std::scientific<<theLineDenCoef[i]<<",\n";
1524  out<<"\t\t\t"<<std::scientific<<theLineDenCoef[19]<<");\n";
1525 
1526  out<<"\tsampNumCoef = (\n";
1527  for (int i=0; i<19; ++i)
1528  out<<"\t\t\t"<<std::scientific<<theSampNumCoef[i]<<",\n";
1529  out<<"\t\t\t"<<std::scientific<<theSampNumCoef[19]<<");\n";
1530 
1531  out<<"\tsampDenCoef = (\n";
1532  for (int i=0; i<19; ++i)
1533  out<<"\t\t\t"<<std::scientific<<theSampDenCoef[i]<<",\n";
1534  out<<"\t\t\t"<<std::scientific<<theSampDenCoef[19]<<");\n";
1535 
1536  out<<"END_GROUP = IMAGE\n";
1537  out<<"END;";
1538 
1539  return true;
1540 }
double theSampOffset
double theSampNumCoef[20]
double theLonScale
double theLineScale
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double theHgtOffset
double theLonOffset
double theRandError
double theLatScale
double theSampScale
double theLineDenCoef[20]
double theLineOffset
double theHgtScale
double theBiasError
error

◆ updateModel()

void ossimRpcModel::updateModel ( )
virtual

VIRTUAL METHOD: updateModel() Following a change to the adjustable parameter set, this virtual is called to permit instances to compute derived quantities after parameter change.

Reimplemented from ossimSensorModel.

Definition at line 719 of file ossimRpcModel.cpp.

References ossimAdjustableParameterInterface::computeParameterOffset(), ossim::cosd(), CRTRACK_OFFSET, CRTRACK_SCALE, INTRACK_OFFSET, INTRACK_SCALE, MAP_ROTATION, ossim::sind(), theCosMapRot, theCrtrackOffset, theCrtrackScale, theIntrackOffset, theIntrackScale, and theSinMapRot.

Referenced by ossimQuickbirdRpcModel::finishConstruction(), ossimplugins::ossimSpot6Model::finishConstruction(), ossimplugins::ossimPleiadesModel::finishConstruction(), and ossimplugins::ossimRadarSat2RPCModel::open().

720 {
725  double mapRotation = computeParameterOffset(MAP_ROTATION);
726  theCosMapRot = ossim::cosd(mapRotation);
727  theSinMapRot = ossim::sind(mapRotation);
728 }
double theIntrackOffset
double theIntrackScale
double sind(double x)
Definition: ossimCommon.h:260
double theCrtrackScale
double cosd(double x)
Definition: ossimCommon.h:259
double theCrtrackOffset
double theSinMapRot
double theCosMapRot

◆ useForward()

virtual bool ossimRpcModel::useForward ( ) const
inlinevirtual

useForward() return true when it's better (more accurate / fast) to use forward (from ground to image) than inverse(from image to ground)

Implements ossimOptimizableProjection.

Definition at line 172 of file ossimRpcModel.h.

172 {return false;}

◆ worldToLineSample()

void ossimRpcModel::worldToLineSample ( const ossimGpt world_point,
ossimDpt image_point 
) const
virtual

worldToLineSample() Overrides base class implementation.

Directly computes line-sample from the polynomials.

Reimplemented from ossimSensorModel.

Reimplemented in ossimplugins::ossimRadarSat2RPCModel, and ossimNitfRpcModel.

Definition at line 258 of file ossimRpcModel.cpp.

References ossimGpt::hgt, ossimGpt::isHgtNan(), ossimGpt::isLatNan(), ossimGpt::isLonNan(), ossimGpt::lat, ossimDpt::line, ossimGpt::lon, ossimDpt::makeNan(), polynomial(), ossimDpt::samp, theCosMapRot, theCrtrackOffset, theCrtrackScale, theHgtOffset, theHgtScale, theIntrackOffset, theIntrackScale, theLatOffset, theLatScale, theLineDenCoef, theLineNumCoef, theLineOffset, theLineScale, theLonOffset, theLonScale, theSampDenCoef, theSampNumCoef, theSampOffset, theSampScale, and theSinMapRot.

Referenced by ossimRpcSolver::evalPoint(), ossimNitfRpcModel::worldToLineSample(), and ossimplugins::ossimRadarSat2RPCModel::worldToLineSample().

260 {
261  // if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::worldToLineSample(): entering..." << std::endl;
262 
263  if(ground_point.isLatNan() || ground_point.isLonNan() )
264  {
265  img_pt.makeNan();
266  return;
267  }
268 
269  //***
270  // First check if the world point is inside bounding rectangle:
271  //***
272  //ossimDpt wdp (ground_point);
273  //if (!(theBoundGndPolygon.pointWithin(ground_point)))
274  // {
275  //img_pt = extrapolate(ground_point);
276  //if (traceExec()) CLOG << "returning..." << endl;
277  // img_pt.makeNan();
278  // return;
279  // }
280 
281  //***
282  // Normalize the lat, lon, hgt:
283  //***
284  double nlat = (ground_point.lat - theLatOffset) / theLatScale;
285  double nlon = (ground_point.lon - theLonOffset) / theLonScale;
286  double nhgt;
287 
288  if( ground_point.isHgtNan() )
289  {
290  // nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
291  nhgt = ( - theHgtOffset) / theHgtScale;
292  }
293  else
294  {
295  nhgt = (ground_point.hgt - theHgtOffset) / theHgtScale;
296  }
297 
298  //***
299  // Compute the adjusted, normalized line (U) and sample (V):
300  //***
301  double Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
302  double Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
303  double Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
304  double Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
305  double U_rot = Pu / Qu;
306  double V_rot = Pv / Qv;
307 
308  //***
309  // U, V are normalized quantities. Need now to establish the image file
310  // line and sample. First, back out the adjustable parameter effects
311  // starting with rotation:
312  //***
313  double U = U_rot*theCosMapRot + V_rot*theSinMapRot;
314  double V = V_rot*theCosMapRot - U_rot*theSinMapRot;
315 
316  //***
317  // Now back out skew, scale, and offset adjustments:
318  //***
321 
322  // if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::worldToLineSample(): returning..." << std::endl;
323  return;
324 }
double theSampOffset
double theSampNumCoef[20]
double theIntrackOffset
double theIntrackScale
double theLonScale
double theLineScale
double polynomial(const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double theHgtOffset
double theLonOffset
double theLatScale
double theCrtrackScale
double theCrtrackOffset
double theSampScale
double theLineDenCoef[20]
double theSinMapRot
double theCosMapRot
double theLineOffset
double theHgtScale

◆ writeGeomTemplate()

void ossimRpcModel::writeGeomTemplate ( ostream &  os)
static

STATIC METHOD: writeGeomTemplate(ostream) Writes a template of geom keywords processed by loadState and saveState to output stream.

Definition at line 1109 of file ossimRpcModel.cpp.

1110 {
1111  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(): entering..." << std::endl;
1112 
1113  os <<
1114  "//**************************************************************\n"
1115  "// Template for RPC model keywordlist\n"
1116  "//**************************************************************\n"
1117  << ossimKeywordNames::TYPE_KW << ": " << MODEL_TYPE << endl;
1118 
1120 
1121  os << "//\n"
1122  << "// Derived-class ossimRpcModel Keywords:\n"
1123  << "//\n"
1124  << POLY_TYPE_KW << ": A|B\n"
1125  << "\n"
1126  << "// RPC data consists of coefficients and normalization \n"
1127  << "// parameters. The RPC keywords used here are compatible with \n"
1128  << "// keywords found in Ikonos \"rpc.txt\" files.\n"
1129  << "// First are the normalization parameters:\n"
1130  << LINE_OFFSET_KW << ": <float>\n"
1131  << SAMP_OFFSET_KW << ": <float>\n"
1132  << LAT_OFFSET_KW << ": <float>\n"
1133  << LON_OFFSET_KW << ": <float>\n"
1134  << HGT_OFFSET_KW << ": <float>\n"
1135  << LINE_SCALE_KW << ": <float>\n"
1136  << SAMP_SCALE_KW << ": <float>\n"
1137  << LAT_SCALE_KW << ": <float>\n"
1138  << LON_SCALE_KW << ": <float>\n"
1139  << HGT_SCALE_KW << ": <float>\n"
1140  << BIAS_ERROR_KW << ": <float>\n"
1141  << RAND_ERROR_KW << ": <float>\n"
1142  << "\n"
1143  << "// RPC Coefficients are specified with indexes. Coefficients \n "
1144  << "// are specified for the four polynomials: line numerator, line \n"
1145  << "// denominator, sample numerator, and sample denominator:" << endl;
1146 
1147  for (int i=1; i<=20; i++)
1148  os << LINE_NUM_COEF_KW << setw(2) << setfill('0') << right
1149  << i << ": <float>" << endl;
1150  os << endl;
1151  for (int i=1; i<=20; i++)
1152  os << LINE_DEN_COEF_KW << setw(2) << setfill('0') << right
1153  << i << ": <float>" << endl;
1154  os << endl;
1155  for (int i=1; i<=20; i++)
1156  os << SAMP_NUM_COEF_KW << setw(2) << setfill('0') << right
1157  << i << ": <float>" << endl;
1158  os << endl;
1159  for (int i=1; i<=20; i++)
1160  os << SAMP_DEN_COEF_KW << setw(2) << setfill('0') << right
1161  << i << ": <float>" << endl;
1162  os << "\n" <<endl;
1163 
1164  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(): returning..." << std::endl;
1165  return;
1166 }
static const char * TYPE_KW
static void writeGeomTemplate(ostream &os)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Friends And Related Function Documentation

◆ ossimNitfRpcBase

friend class ossimNitfRpcBase
friend

Definition at line 307 of file ossimRpcModel.h.

◆ ossimRpcSolver

friend class ossimRpcSolver
friend

Definition at line 306 of file ossimRpcModel.h.

Member Data Documentation

◆ theBiasError

double ossimRpcModel::theBiasError
protected

◆ theCosMapRot

double ossimRpcModel::theCosMapRot
protected

Definition at line 291 of file ossimRpcModel.h.

Referenced by lineSampleHeightToWorld(), updateModel(), and worldToLineSample().

◆ theCrtrackOffset

double ossimRpcModel::theCrtrackOffset
protected

Definition at line 288 of file ossimRpcModel.h.

Referenced by lineSampleHeightToWorld(), updateModel(), and worldToLineSample().

◆ theCrtrackScale

double ossimRpcModel::theCrtrackScale
protected

Definition at line 290 of file ossimRpcModel.h.

Referenced by lineSampleHeightToWorld(), updateModel(), and worldToLineSample().

◆ theHgtOffset

double ossimRpcModel::theHgtOffset
protected

◆ theHgtScale

double ossimRpcModel::theHgtScale
protected

◆ theIntrackOffset

double ossimRpcModel::theIntrackOffset
protected

Definition at line 287 of file ossimRpcModel.h.

Referenced by lineSampleHeightToWorld(), updateModel(), and worldToLineSample().

◆ theIntrackScale

double ossimRpcModel::theIntrackScale
protected

Definition at line 289 of file ossimRpcModel.h.

Referenced by lineSampleHeightToWorld(), updateModel(), and worldToLineSample().

◆ theLatOffset

double ossimRpcModel::theLatOffset
protected

◆ theLatScale

double ossimRpcModel::theLatScale
protected

◆ theLineDenCoef

double ossimRpcModel::theLineDenCoef[20]
protected

◆ theLineNumCoef

double ossimRpcModel::theLineNumCoef[20]
protected

◆ theLineOffset

double ossimRpcModel::theLineOffset
protected

◆ theLineScale

double ossimRpcModel::theLineScale
protected

◆ theLonOffset

double ossimRpcModel::theLonOffset
protected

◆ theLonScale

double ossimRpcModel::theLonScale
protected

◆ thePolyType

PolynomialType ossimRpcModel::thePolyType
protected

◆ theRandError

double ossimRpcModel::theRandError
protected

◆ theSampDenCoef

double ossimRpcModel::theSampDenCoef[20]
protected

◆ theSampNumCoef

double ossimRpcModel::theSampNumCoef[20]
protected

◆ theSampOffset

double ossimRpcModel::theSampOffset
protected

◆ theSampScale

double ossimRpcModel::theSampScale
protected

◆ theSinMapRot

double ossimRpcModel::theSinMapRot
protected

Definition at line 292 of file ossimRpcModel.h.

Referenced by lineSampleHeightToWorld(), updateModel(), and worldToLineSample().


The documentation for this class was generated from the following files: