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

#include <ossimSarModel.h>

Inheritance diagram for ossimSarModel:
ossimSensorModel ossimProjection ossimOptimizableProjection ossimAdjustableParameterInterface ossimObject ossimErrorStatusInterface ossimReferenced

Public Types

enum  AcquisitionMode { UNKNOWN = 0, SCAN = 1, SPOT = 2 }
 
enum  AdjustParamIndex { X_POS = 0, Y_POS, Z_POS, NUM_ADJUSTABLE_PARAMS }
 
- 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

 ossimSarModel ()
 default constructor More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to load or recreate the state of an ossimSarModel from a keyword list. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of this object to a keyword list. More...
 
virtual ossimObjectdup () const
 
virtual std::ostream & print (std::ostream &out) const
 print method. More...
 
virtual void lineSampleToWorld (const ossimDpt &image_point, ossimGpt &world_point) const
 
virtual void worldToLineSample (const ossimGpt &world_point, ossimDpt &image_point) const
 
virtual void lineSampleHeightToWorld (const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const
 
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 position and pointing towards the target's position in the Output Plane. More...
 
virtual double sensorAzimuth (const ossimDpt &image_point) const
 
virtual ossimDpt getForwardDeriv (int parmIdx, const ossimGpt &gpos, double h)
 Compute partials of range/Doppler WRT ground point. More...
 
virtual bool useForward () const
 ossimOptimizableProjection More...
 
virtual void updateModel ()
 Compute other parameters & update the model. More...
 
virtual ossimSensorModel::CovMatStatus getObsCovMat (const ossimDpt &ipos, NEWMAT::SymmetricMatrix &Cov)
 
- 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)
 
virtual bool setupOptimizer (const ossimString &setup)
 setupFromString() Derived classes should implement as needed. Initialize parameters needed for optimizeFit and degreesOfFreedom More...
 
- 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 Public Member Functions inherited from ossimSensorModel
static void writeGeomTemplate (ostream &os)
 

Protected Member Functions

virtual ~ossimSarModel ()
 virtual destructor More...
 
void initAdjustableParameters ()
 
virtual ossim_float64 getArpTime () const
 Get ARP time for SPOT mode (constant time). More...
 
virtual ossim_float64 getArpTime (const ossimDpt &imgPt) const
 Get ARP time for SCAN mode (varying time). More...
 
virtual ossimEcefPoint getArpPos () const
 Get ARP position for SPOT mode (constant time). More...
 
virtual ossimEcefPoint getArpPos (const ossim_float64 &time) const
 Get ARP position for SCAN mode (varying time). More...
 
virtual ossimEcefVector getArpVel () const
 Get ARP velocity for SPOT mode (constant time). More...
 
virtual ossimEcefVector getArpVel (const ossim_float64 &time) const
 Get ARP velocity for SPOT mode (constant time). More...
 
virtual bool computeRangeDoppler (const ossimEcefPoint &pt, const ossimEcefPoint &arpPos, const ossimEcefVector &arpVel, ossim_float64 &range, ossim_float64 &doppler) const
 Method to compute range & Doppler. More...
 
virtual bool computeImageFromOP (const ossimEcefPoint &opPt, ossimDpt &imgPt) const
 Method to compute image coordinates from output plane coordinates. More...
 
virtual bool computeOPfromImage (const ossimDpt &imgPt, ossimEcefPoint &opPt) const
 Method to compute output plane coordinates from image coordinates. More...
 
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. More...
 
virtual bool projEllipsoidToOP (const ossimEcefPoint &ellPt, ossimEcefPoint &opPt) const
 Method to project ellipsoid coordinates to output plane. More...
 
ossimString getAcquistionModeString () const
 Returns the acquisition mode as a string. More...
 
void setAcquisitionMode (const ossimString &mode)
 Sets the acquisition mode from string. More...
 
- 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

AcquisitionMode theAcquisitionMode
 acquisition mode More...
 
ossimEcefPoint theOrpPosition
 Output/Ground Reference Point (ORP) position. More...
 
ossimDpt theOrpCenter
 sample (x)/line(y) image coordinates of ORP More...
 
ossimEcefVector theOutputPlaneNormal
 output plane normal More...
 
ossimEcefVector theOutputPlaneXaxis
 output plane x-axis More...
 
ossim_float64 theOipr
 output impulse response More...
 
ossim_float64 thePixelSize
 pixel size More...
 
ossim_float64 theArpTime
 Aperture Reference/Center Point (ARP) time in seconds. More...
 
vector< ossim_float64theArpXPolCoeff
 Aperture Reference Point (ARP) Polynomials. More...
 
vector< ossim_float64theArpYPolCoeff
 
vector< ossim_float64theArpZPolCoeff
 
vector< ossim_float64theTimeCoeff
 Time Coefficients. More...
 
ossim_float64 thePixelSpacing
 Other computed parameters. More...
 
ossimEcefVector theOPX
 Output/slant plane unit vectors. More...
 
ossimEcefVector theOPY
 
ossimEcefVector theOPZ
 
ossim_float64 theObsRng
 Adjustment-related data used and set by getForwardDeriv. More...
 
ossim_float64 theObsDop
 
ossim_float64 theObsTime
 
ossimEcefPoint theObsPosition
 
ossimEcefPoint theObsOP
 
ossimEcefPoint theObsArpPos
 
ossimEcefVector theObsArpVel
 
ossimEcefVector theObsArpVel_U
 
ossim_float64 theObsArpVel_Mag
 
ossim_float64 theParDopWRTaz
 Partials for current point. More...
 
ossimEcefVector theLsrOffset
 Adjustable parameters. More...
 
- 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
 

Detailed Description

Definition at line 29 of file ossimSarModel.h.

Member Enumeration Documentation

◆ AcquisitionMode

Enumerator
UNKNOWN 
SCAN 
SPOT 

Definition at line 33 of file ossimSarModel.h.

34  {
35  UNKNOWN = 0,
36  SCAN = 1,
37  SPOT = 2
38  };

◆ AdjustParamIndex

Enumerator
X_POS 
Y_POS 
Z_POS 
NUM_ADJUSTABLE_PARAMS 

Definition at line 40 of file ossimSarModel.h.

Constructor & Destructor Documentation

◆ ossimSarModel()

ossimSarModel::ossimSarModel ( )

default constructor

Definition at line 64 of file ossimSarModel.cpp.

References initAdjustableParameters().

65  :
68  theOrpCenter(),
70  theOipr(0.0),
71  theLsrOffset(0, 0, 0)
72 {
74 
75  if (traceDebug())
76  {
78  << "ossimSarModel::ossimSarModel DEBUG:" << std::endl;
79 #ifdef OSSIM_ID_ENABLED
81  << "OSSIM_ID: " << OSSIM_ID << std::endl;
82 #endif
83  }
84 
85 }
ossim_float64 theOipr
output impulse response
ossimEcefPoint theOrpPosition
Output/Ground Reference Point (ORP) position.
void initAdjustableParameters()
ossimDpt theOrpCenter
sample (x)/line(y) image coordinates of ORP
ossimEcefVector theOutputPlaneNormal
output plane normal
AcquisitionMode theAcquisitionMode
acquisition mode
ossimEcefVector theLsrOffset
Adjustable parameters.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ~ossimSarModel()

ossimSarModel::~ossimSarModel ( )
protectedvirtual

virtual destructor

Definition at line 92 of file ossimSarModel.cpp.

93 {
94  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimSarModel(): entering..." << std::endl;
95  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimSarModel(): returning..." << std::endl;
96 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Function Documentation

◆ computeImageFromOP()

bool ossimSarModel::computeImageFromOP ( const ossimEcefPoint opPt,
ossimDpt imgPt 
) const
protectedvirtual

Method to compute image coordinates from output plane coordinates.

Parameters
opPtECF output plane position of point.
imgPtimage position of point.
Returns
true on success, false on error.

Definition at line 1057 of file ossimSarModel.cpp.

References ossimEcefVector::dot(), ossimDpt::line, ossimDpt::samp, theOPX, theOPY, theOrpCenter, theOrpPosition, and thePixelSpacing.

Referenced by projEllipsoidToOP(), and worldToLineSample().

1058 {
1059  ossimEcefVector delta(opPt - theOrpPosition);
1060 
1061  ossim_float64 dL = delta.dot(theOPX) / thePixelSpacing;
1062  ossim_float64 dS = delta.dot(theOPY) / thePixelSpacing;
1063 
1064  imgPt.line = theOrpCenter.line + dL;
1065  imgPt.samp = theOrpCenter.samp + dS;
1066 
1067  return true;
1068 }
ossimEcefPoint theOrpPosition
Output/Ground Reference Point (ORP) position.
double samp
Definition: ossimDpt.h:164
ossimEcefVector theOPX
Output/slant plane unit vectors.
ossim_float64 thePixelSpacing
Other computed parameters.
double ossim_float64
double line
Definition: ossimDpt.h:165
ossimDpt theOrpCenter
sample (x)/line(y) image coordinates of ORP
ossimEcefVector theOPY

◆ computeOPfromImage()

bool ossimSarModel::computeOPfromImage ( const ossimDpt imgPt,
ossimEcefPoint opPt 
) const
protectedvirtual

Method to compute output plane coordinates from image coordinates.

Parameters
imgPtimage position of point.
opPtECF output plane position of point.
Returns
true on success, false on error.

Definition at line 1035 of file ossimSarModel.cpp.

References ossimDpt::line, ossimDpt::samp, theOPX, theOPY, theOrpCenter, theOrpPosition, and thePixelSpacing.

Referenced by getForwardDeriv(), imagingRay(), lineSampleHeightToWorld(), and lineSampleToWorld().

1037 {
1038  ossim_float64 dL = imgPt.line - theOrpCenter.line;
1039  ossim_float64 dS = imgPt.samp - theOrpCenter.samp;
1040 
1041  dL *= thePixelSpacing;
1042  dS *= thePixelSpacing;
1043 
1044  opPt = theOPX*dL + theOPY*dS + theOrpPosition;
1045 
1046  return true;
1047 }
ossimEcefPoint theOrpPosition
Output/Ground Reference Point (ORP) position.
double samp
Definition: ossimDpt.h:164
ossimEcefVector theOPX
Output/slant plane unit vectors.
ossim_float64 thePixelSpacing
Other computed parameters.
double ossim_float64
double line
Definition: ossimDpt.h:165
ossimDpt theOrpCenter
sample (x)/line(y) image coordinates of ORP
ossimEcefVector theOPY

◆ computeRangeDoppler()

bool ossimSarModel::computeRangeDoppler ( const ossimEcefPoint pt,
const ossimEcefPoint arpPos,
const ossimEcefVector arpVel,
ossim_float64 range,
ossim_float64 doppler 
) const
protectedvirtual

Method to compute range & Doppler.

Parameters
ptECF ground point coordinates.
arpPosECF ARP position.
arpVelECF ARP velocity.
rangerange.
arpVelDoppler.
Returns
true on success, false on error.

Definition at line 999 of file ossimSarModel.cpp.

References ossimEcefVector::magnitude().

Referenced by getForwardDeriv(), lineSampleHeightToWorld(), lineSampleToWorld(), and projOPtoSurface().

1004 {
1005  // Compute range
1006  ossimEcefVector delta = pt - arpPos;
1007  range = delta.magnitude();
1008 
1009  if (traceDebug())
1010  {
1012  << "DEBUG computeRangeDoppler: range vector..." << endl;
1014  << "delta components: \n"<<delta<<endl;
1015  }
1016 
1017  if (range != 0.0)
1018  {
1019  // Compute Doppler
1020  doppler = arpVel.dot(delta) / range;
1021  return true;
1022  }
1023 
1024  return false;
1025 }
double dot(const ossimEcefVector &) const
double magnitude() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ dup()

virtual ossimObject* ossimSarModel::dup ( ) const
inlinevirtual

Returns pointer to a new instance, copy of this.

Implements ossimProjection.

Definition at line 83 of file ossimSarModel.h.

83 { return 0; } // TBR

◆ getAcquistionModeString()

ossimString ossimSarModel::getAcquistionModeString ( ) const
protected

Returns the acquisition mode as a string.

Definition at line 531 of file ossimSarModel.cpp.

References SCAN, SPOT, theAcquisitionMode, and UNKNOWN.

532 {
533  ossimString result;
534 
535  switch (theAcquisitionMode)
536  {
537  case ossimSarModel::SCAN:
538  result = "scan";
539  break;
540  case ossimSarModel::SPOT:
541  result = "spot";
542  break;
544  default:
545  result = "unknown";
546  break;
547  }
548  return result;
549 }
AcquisitionMode theAcquisitionMode
acquisition mode

◆ getArpPos() [1/2]

ossimEcefPoint ossimSarModel::getArpPos ( ) const
protectedvirtual

Get ARP position for SPOT mode (constant time).

Definition at line 803 of file ossimSarModel.cpp.

References ossimLsrSpace::lsrToEcefRotMatrix(), theArpXPolCoeff, theArpYPolCoeff, theArpZPolCoeff, and theLsrOffset.

Referenced by getForwardDeriv(), imagingRay(), lineSampleHeightToWorld(), lineSampleToWorld(), projEllipsoidToOP(), and sensorAzimuth().

804 {
806  theArpYPolCoeff[0],
807  theArpZPolCoeff[0]);
808 
809  // Handle the adjustable offset
810  // Define ENU space at pos
811  ossimGpt posG(pos);
812  ossimLsrSpace enu(posG);
813  // Rotate offset vector to ECF
815  ossimEcefVector ecfOffset = enu.lsrToEcefRotMatrix()*tpnn;
816  // Add the offset
817  pos = pos + ecfOffset;
818 
819  return pos;
820 }
vector< ossim_float64 > theArpZPolCoeff
vector< ossim_float64 > theArpXPolCoeff
Aperture Reference Point (ARP) Polynomials.
ossimEcefVector theLsrOffset
Adjustable parameters.
vector< ossim_float64 > theArpYPolCoeff

◆ getArpPos() [2/2]

ossimEcefPoint ossimSarModel::getArpPos ( const ossim_float64 time) const
protectedvirtual

Get ARP position for SCAN mode (varying time).

Definition at line 847 of file ossimSarModel.cpp.

References ossimLsrSpace::lsrToEcefRotMatrix(), theArpXPolCoeff, theArpYPolCoeff, theArpZPolCoeff, theLsrOffset, x, and y.

848 {
849  ossim_int32 i;
850  ossim_uint32 nTermsX = (ossim_uint32)theArpXPolCoeff.size();
851  ossim_uint32 nTermsY = (ossim_uint32)theArpYPolCoeff.size();
852  ossim_uint32 nTermsZ = (ossim_uint32)theArpZPolCoeff.size();
853 
854  ossim_float64 x = theArpXPolCoeff[nTermsX-1];
855  for (i=nTermsX-2; i>=0; i--)
856  x = x*time + theArpXPolCoeff[i];
857 
858  ossim_float64 y = theArpYPolCoeff[nTermsY-1];
859  for (i=nTermsY-2; i>=0; i--)
860  y = y*time + theArpYPolCoeff[i];
861 
862  ossim_float64 z = theArpZPolCoeff[nTermsZ-1];
863  for (i=nTermsZ-2; i>=0; i--)
864  z = z*time + theArpZPolCoeff[i];
865 
866  ossimEcefPoint pos(x, y, z);
867 
868  // Handle the adjustable offset
869  // Define ENU space at pos
870  ossimGpt posG(pos);
871  ossimLsrSpace enu(posG);
872  // Rotate offset vector to ECF
874  ossimEcefVector ecfOffset = enu.lsrToEcefRotMatrix()*tpnn;
875  // Add the offset
876  pos = pos + ecfOffset;
877 
878  if (traceDebug())
879  {
880  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG getArpPos:"<<endl;
881  ossimNotify(ossimNotifyLevel_DEBUG) << " time = "<<time<<endl;
882  ossimNotify(ossimNotifyLevel_DEBUG) << " pos = "<<pos<<endl;
883  ossimNotify(ossimNotifyLevel_DEBUG) << " offset = "<<theLsrOffset<<endl;
884  }
885 
886  return pos;
887 }
ossim_uint32 x
vector< ossim_float64 > theArpZPolCoeff
ossim_uint32 y
double ossim_float64
unsigned int ossim_uint32
vector< ossim_float64 > theArpXPolCoeff
Aperture Reference Point (ARP) Polynomials.
ossimEcefVector theLsrOffset
Adjustable parameters.
vector< ossim_float64 > theArpYPolCoeff
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ getArpTime() [1/2]

ossim_float64 ossimSarModel::getArpTime ( ) const
protectedvirtual

Get ARP time for SPOT mode (constant time).

Definition at line 936 of file ossimSarModel.cpp.

References theTimeCoeff.

Referenced by getForwardDeriv(), imagingRay(), lineSampleHeightToWorld(), lineSampleToWorld(), projEllipsoidToOP(), and sensorAzimuth().

937 {
938  return theTimeCoeff[0];
939 }
vector< ossim_float64 > theTimeCoeff
Time Coefficients.

◆ getArpTime() [2/2]

ossim_float64 ossimSarModel::getArpTime ( const ossimDpt imgPt) const
protectedvirtual

Get ARP time for SCAN mode (varying time).

Parameters
imgPtThe image coordinates.

Definition at line 952 of file ossimSarModel.cpp.

References ossimDpt::line, ossimDpt::samp, and theTimeCoeff.

953 {
954  ossim_float64 s = imgPt.samp;
955  ossim_float64 l = imgPt.line;
956 
957  ossim_float64 s2 = s*s;
958  ossim_float64 s3 = s2*s;
959  ossim_float64 l2 = l*l;
960  ossim_float64 l3 = l2*l;
961 
962  // Evaluate the time polynomial
963  ossim_float64 imgTime = theTimeCoeff[0];
964  imgTime += theTimeCoeff[1] * l;
965  imgTime += theTimeCoeff[2] * l2;
966  imgTime += theTimeCoeff[3] * l3;
967  imgTime += theTimeCoeff[4] * s;
968  imgTime += theTimeCoeff[5] * s * l;
969  imgTime += theTimeCoeff[6] * s * l2;
970  imgTime += theTimeCoeff[7] * s * l3;
971  imgTime += theTimeCoeff[8] * s2;
972  imgTime += theTimeCoeff[9] * s2 * l;
973  imgTime += theTimeCoeff[10] * s2 * l2;
974  imgTime += theTimeCoeff[11] * s2 * l3;
975  imgTime += theTimeCoeff[12] * s3;
976  imgTime += theTimeCoeff[13] * s3 * l;
977  imgTime += theTimeCoeff[14] * s3 * l2;
978  imgTime += theTimeCoeff[15] * s3 * l3;
979 
980  if (traceDebug())
981  {
982  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG getArpTime:"<<endl;
983  ossimNotify(ossimNotifyLevel_DEBUG) << " imgPt = "<<imgPt<<endl;
984  ossimNotify(ossimNotifyLevel_DEBUG) << " imgTime = "<<imgTime<<endl;
985  }
986 
987 
988  return imgTime;
989 }
double samp
Definition: ossimDpt.h:164
vector< ossim_float64 > theTimeCoeff
Time Coefficients.
double ossim_float64
double line
Definition: ossimDpt.h:165
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getArpVel() [1/2]

ossimEcefVector ossimSarModel::getArpVel ( ) const
protectedvirtual

Get ARP velocity for SPOT mode (constant time).

Definition at line 829 of file ossimSarModel.cpp.

References theArpXPolCoeff, theArpYPolCoeff, and theArpZPolCoeff.

Referenced by getForwardDeriv(), lineSampleHeightToWorld(), lineSampleToWorld(), and projEllipsoidToOP().

830 {
832  theArpYPolCoeff[1],
833  theArpZPolCoeff[1]);
834 
835  return vec;
836 }
vector< ossim_float64 > theArpZPolCoeff
vector< ossim_float64 > theArpXPolCoeff
Aperture Reference Point (ARP) Polynomials.
vector< ossim_float64 > theArpYPolCoeff

◆ getArpVel() [2/2]

ossimEcefVector ossimSarModel::getArpVel ( const ossim_float64 time) const
protectedvirtual

Get ARP velocity for SPOT mode (constant time).

Definition at line 898 of file ossimSarModel.cpp.

References theArpXPolCoeff, theArpYPolCoeff, theArpZPolCoeff, x, and y.

899 {
900  ossim_int32 i;
901  ossim_uint32 nTermsX = (ossim_uint32)theArpXPolCoeff.size();
902  ossim_uint32 nTermsY = (ossim_uint32)theArpYPolCoeff.size();
903  ossim_uint32 nTermsZ = (ossim_uint32)theArpZPolCoeff.size();
904 
905  ossim_float64 x = nTermsX * theArpXPolCoeff[nTermsX-1];
906  for (i=nTermsX-2; i>=1; i--)
907  x = x*time + i*theArpXPolCoeff[i];
908 
909  ossim_float64 y = nTermsY * theArpYPolCoeff[nTermsY-1];
910  for (i=nTermsY-2; i>=1; i--)
911  y = y*time + i*theArpYPolCoeff[i];
912 
913  ossim_float64 z = nTermsZ * theArpZPolCoeff[nTermsZ-1];
914  for (i=nTermsZ-2; i>=1; i--)
915  z = z*time + i*theArpZPolCoeff[i];
916 
917  ossimEcefVector vel(x, y, z);
918 
919  if (traceDebug())
920  {
921  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG getArpVel:"<<endl;
922  ossimNotify(ossimNotifyLevel_DEBUG) << " time = "<<time<<endl;
923  ossimNotify(ossimNotifyLevel_DEBUG) << " vel = "<<vel<<endl;
924  }
925 
926  return vel;
927 }
ossim_uint32 x
vector< ossim_float64 > theArpZPolCoeff
ossim_uint32 y
double ossim_float64
unsigned int ossim_uint32
vector< ossim_float64 > theArpXPolCoeff
Aperture Reference Point (ARP) Polynomials.
vector< ossim_float64 > theArpYPolCoeff
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ getForwardDeriv()

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

Compute partials of range/Doppler 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 1263 of file ossimSarModel.cpp.

References computeOPfromImage(), computeRangeDoppler(), ossimEcefVector::cross(), ossimEcefVector::dot(), ossimSensorModel::EVALUATE, getArpPos(), getArpTime(), getArpVel(), ossimSensorModel::getForwardDeriv(), ossimGpt::latd(), ossimDpt::line, ossimGpt::lond(), ossimEcefVector::magnitude(), ossimSensorModel::OBS_INIT, ossimSensorModel::P_WRT_X, ossimSensorModel::P_WRT_Y, projEllipsoidToOP(), ossimDpt::samp, ossimSensorModel::theObs, theObsArpPos, theObsArpVel, theObsArpVel_Mag, theObsArpVel_U, theObsDop, theObsOP, theObsPosition, theObsRng, theObsTime, theParDopWRTaz, ossimSensorModel::theParWRTx, ossimSensorModel::theParWRTy, ossimSensorModel::theParWRTz, ossimDpt::u, ossimEcefVector::unitVector(), ossimDpt::v, ossimEcefVector::x(), ossimEcefVector::y(), and ossimEcefVector::z().

1266 {
1267  // If derivMode (parmIdx) >= 0 call base class version
1268  // for "adjustable parameters"
1269  if (derivMode >= 0)
1270  {
1271  return ossimSensorModel::getForwardDeriv(derivMode, pos, h);
1272  }
1273 
1274  // Use alternative derivMode definitions
1275  else
1276  {
1277  ossimDpt returnData;
1278 
1279  //******************************************
1280  // OBS_INIT mode
1281  // [1] compute r/D corresponding to (s,l)
1282  // [2] compute time, ARP posvel and save
1283  // Note: In this mode, pos is used to pass
1284  // in the (s,l) observations.
1285  //******************************************
1286  if (derivMode==OBS_INIT)
1287  {
1288  // Compute the r/D observations from image coordinates
1289  ossimDpt obs;
1290  obs.samp = pos.latd();
1291  obs.line = pos.lond();
1292 
1293  theObsTime = getArpTime(obs);
1298 
1302  ossimDpt obsRD(theObsRng, theObsDop);
1303  theObs = obsRD;
1304  }
1305 
1306  //******************************************
1307  // EVALUATE mode
1308  // [1] evaluate & save partials, residuals
1309  // [2] return residuals
1310  //******************************************
1311  else if (derivMode==EVALUATE)
1312  {
1313 
1314  // Compute the partials
1315  ossimEcefPoint gpos(pos);
1316  ossimEcefPoint ellObs = gpos;
1317  theObsPosition = gpos;
1318 
1319  // Partials of range WRT ground
1320  ossimEcefVector rng = ellObs - theObsArpPos;
1321  ossimEcefVector rngU = rng.unitVector();
1322 
1323  // Partials of azimuth WRT ground
1324  ossimEcefVector slantPerp = rngU.cross(theObsArpVel);
1326  ossim_float64 signPar = (slantPerp.dot(rs)<0.0) ? -1:1;
1327  ossimEcefVector slantNormal = slantPerp.unitVector() * signPar;
1328  ossimEcefVector azU = slantNormal.unitVector().cross(rngU);
1329 
1330  // Partials of Doppler WRT azimuth
1331  ossim_float64 dca = acos(theObsArpVel_U.dot(rngU));
1332  signPar = ((theObsArpVel.cross(rng)).dot(slantNormal)<0.0) ? 1:-1;
1333  theParDopWRTaz = signPar*sin(dca)*theObsArpVel_Mag/rng.magnitude();
1334 
1335  // Save the partials
1336  // Range
1337  theParWRTx.u = rngU.x();
1338  theParWRTy.u = rngU.y();
1339  theParWRTz.u = rngU.z();
1340  // Doppler
1341  theParWRTx.v = azU.x()*theParDopWRTaz;
1342  theParWRTy.v = azU.y()*theParDopWRTaz;
1343  theParWRTz.v = azU.z()*theParDopWRTaz;
1344 
1345  // Residuals
1346  ossim_float64 cRng;
1347  ossim_float64 cDop;
1348  ossimEcefPoint opPt;
1349  projEllipsoidToOP(ellObs, opPt);
1350  computeRangeDoppler(opPt, theObsArpPos, theObsArpVel, cRng, cDop);
1351  ossimDpt resid(theObsRng-cRng, theObsDop-cDop);
1352  returnData = resid;
1353  }
1354 
1355  //******************************************
1356  // P_WRT_X, P_WRT_Y, P_WRT_Z modes
1357  // [1] 3 separate calls required
1358  // [2] return 3 sets of partials
1359  //******************************************
1360  else if (derivMode==P_WRT_X)
1361  {
1362  returnData = theParWRTx;
1363  }
1364 
1365  else if (derivMode==P_WRT_Y)
1366  {
1367  returnData = theParWRTy;
1368  }
1369 
1370  else
1371  {
1372  returnData = theParWRTz;
1373  }
1374 
1375  return returnData;
1376  }
1377 }
virtual ossim_float64 getArpTime() const
Get ARP time for SPOT mode (constant time).
ossimEcefVector unitVector() const
ossim_float64 theObsDop
ossimEcefPoint theObsOP
double z() const
double u
Definition: ossimDpt.h:164
ossimEcefVector cross(const ossimEcefVector &) const
double dot(const ossimEcefVector &) const
double samp
Definition: ossimDpt.h:164
double magnitude() const
virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt &gpos, double hdelta=1e-11)
ossim_float64 theObsTime
double ossim_float64
double line
Definition: ossimDpt.h:165
ossimEcefVector theObsArpVel_U
ossim_float64 theObsArpVel_Mag
virtual bool computeOPfromImage(const ossimDpt &imgPt, ossimEcefPoint &opPt) const
Method to compute output plane coordinates from image coordinates.
ossim_float64 theParDopWRTaz
Partials for current point.
ossimEcefPoint theObsArpPos
ossimEcefVector theObsArpVel
ossimEcefPoint theObsPosition
ossim_float64 theObsRng
Adjustment-related data used and set by getForwardDeriv.
double x() 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 ossimEcefPoint getArpPos() const
Get ARP position for SPOT mode (constant time).
double y() const
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).
virtual bool projEllipsoidToOP(const ossimEcefPoint &ellPt, ossimEcefPoint &opPt) const
Method to project ellipsoid coordinates to output plane.
double v
Definition: ossimDpt.h:165

◆ getObsCovMat()

ossimSensorModel::CovMatStatus ossimSarModel::getObsCovMat ( const ossimDpt ipos,
NEWMAT::SymmetricMatrix &  Cov 
)
virtual

METHOD: getObsCovMat() gives 2X2 covariance matrix of observations

Definition at line 707 of file ossimSarModel.cpp.

709 {
710  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
711  // Mensuration error contribution
712  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
713  // Sensitivity matrix
714  NEWMAT::SymmetricMatrix B(2);
715  B(1,1) = thePixelSpacing;
716  B(2,2) = B(1,1);
717  B(1,2) = 0.0;
718  // Default pointing error = 0.5 pixels
719  ossim_float64 defPointingSigma = 0.5;
720  NEWMAT::SymmetricMatrix P(2);
721  P(1,1) = defPointingSigma*defPointingSigma;
722  P(2,2) = P(1,1);
723  P(1,2) = 0.0;
724  // Propagate to rng/az
725  NEWMAT::SymmetricMatrix Cm;
726  Cm << B * P * B.t();
727 
728  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
729  // Sum total covariance in rng/az
730  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
731  NEWMAT::SymmetricMatrix Ctot = Cm; //+ other contributors as identified
732 
733  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
734  // Propagate to rng/Dop
735  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
736  NEWMAT::SymmetricMatrix Bad(2);
737  Bad(1,1) = 1.0;
738  Bad(2,2) = theParDopWRTaz;
739  Bad(1,2) = 0.0;
740 
741  Cov << Bad * Ctot * Bad.t();
742 
744 }
ossim_float64 thePixelSpacing
Other computed parameters.
double ossim_float64
ossim_float64 theParDopWRTaz
Partials for current point.

◆ imagingRay()

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

METHOD: imagingRay(image_point, &ossimEcefRay) Given an image point, returns a ray originating at the ARP position and pointing towards the target's position in the Output Plane.

This DOES NOT provide the conventional definition for an imaging ray because the imaging locus for SAR is not a ray.

It DOES provide a radius vector for the range/Doppler circle.

Reimplemented from ossimSensorModel.

Definition at line 674 of file ossimSarModel.cpp.

References computeOPfromImage(), getArpPos(), and getArpTime().

676 {
677  // Compute OP position from image coordinates
678  ossimEcefPoint opPt;
679  computeOPfromImage(image_point, opPt);
680 
681  // Get image time
682  ossim_float64 iTime = getArpTime(image_point);
683 
684  // Get ARP position
685  ossimEcefPoint arpPos = getArpPos(iTime);
686 
687  // Construct the ray
688  ossimGpt start(arpPos);
689  ossimGpt end(opPt);
690 
691  image_ray = ossimEcefRay(start, end);
692 
693  return;
694 }
virtual ossim_float64 getArpTime() const
Get ARP time for SPOT mode (constant time).
double ossim_float64
virtual bool computeOPfromImage(const ossimDpt &imgPt, ossimEcefPoint &opPt) const
Method to compute output plane coordinates from image coordinates.
virtual ossimEcefPoint getArpPos() const
Get ARP position for SPOT mode (constant time).

◆ initAdjustableParameters()

void ossimSarModel::initAdjustableParameters ( )
protectedvirtual

Assigns initial default values to adjustable parameters and related members.

Reimplemented from ossimAdjustableParameterInterface.

Definition at line 108 of file ossimSarModel.cpp.

Referenced by ossimSarModel().

109 {
110  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSarModel::initAdjustableParameters: entering..." << std::endl;
111 
112  int numParams = NUM_ADJUSTABLE_PARAMS;
114 
115  //***
116  // Initialize adjustable parameter array:
117  //***
118  for (int i=0; i<numParams; i++)
119  {
120  setAdjustableParameter(i, 0.0);
121  setParameterDescription(i, PARAM_NAMES[i]);
122  setParameterUnit(i, PARAM_UNITS[i]);
123  }
124 
125  //***
126  // Initialize parameter sigma array:
127  //***
128  setParameterSigma(X_POS, 50.0);
129  setParameterSigma(Y_POS, 50.0);
130  setParameterSigma(Z_POS, 50.0);
131 
132  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSarModel::initAdjustableParameters: returning..." << std::endl;
133 }
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)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ lineSampleHeightToWorld()

void ossimSarModel::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.

Definition at line 561 of file ossimSarModel.cpp.

References AT_HGT, computeOPfromImage(), computeRangeDoppler(), getArpPos(), getArpTime(), getArpVel(), ossimGpt::height(), ossim::isnan(), projOPtoSurface(), and theOrpPosition.

564 {
565  // Compute OP position from image coordinates
566  ossimEcefPoint opPt;
567  computeOPfromImage(lineSampPt, opPt);
568 
569  // Get image time
570  ossim_float64 iTime = getArpTime(lineSampPt);
571 
572  // Get ARP state
573  ossimEcefPoint arpPos = getArpPos(iTime);
574  ossimEcefVector arpVel = getArpVel(iTime);
575 
576  // Get range/Doppler
577  ossim_float64 range;
578  ossim_float64 doppler;
579  computeRangeDoppler(opPt, arpPos, arpVel, range, doppler);
580 
581  // Set the height reference
582  ossim_float64 hgtSet;
583  if ( ossim::isnan(heightAboveEllipsoid) )
584  {
585  ossimGpt orpG(theOrpPosition);
586  hgtSet = orpG.height();
587  }
588  else
589  {
590  hgtSet = heightAboveEllipsoid;
591  }
592 
593  ossimHgtRef hgtRef(AT_HGT, hgtSet);
594 
595  // Project OP to DEM
596  ossimEcefPoint ellPt;
597  projOPtoSurface(opPt, range, doppler, arpPos, arpVel, &hgtRef, ellPt);
598  ossimGpt iPt(ellPt);
599 
600  worldPt = iPt;
601 }
virtual ossim_float64 getArpTime() const
Get ARP time for SPOT mode (constant time).
ossimEcefPoint theOrpPosition
Output/Ground Reference Point (ORP) position.
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.
double ossim_float64
virtual bool computeOPfromImage(const ossimDpt &imgPt, ossimEcefPoint &opPt) const
Method to compute output plane coordinates from image coordinates.
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 ossimEcefPoint getArpPos() const
Get ARP position for SPOT mode (constant time).
virtual ossimEcefVector getArpVel() const
Get ARP velocity for SPOT mode (constant time).
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ lineSampleToWorld()

void ossimSarModel::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 630 of file ossimSarModel.cpp.

References AT_DEM, computeOPfromImage(), computeRangeDoppler(), getArpPos(), getArpTime(), getArpVel(), and projOPtoSurface().

Referenced by sensorAzimuth().

632 {
633  // Compute OP position from image coordinates
634  ossimEcefPoint opPt;
635  computeOPfromImage(lineSampPt, opPt);
636 
637  // Get image time
638  ossim_float64 iTime = getArpTime(lineSampPt);
639 
640  // Get ARP state vector
641  ossimEcefPoint arpPos = getArpPos(iTime);
642  ossimEcefVector arpVel = getArpVel(iTime);
643 
644  // Get range/Doppler
645  ossim_float64 range;
646  ossim_float64 doppler;
647  computeRangeDoppler(opPt, arpPos, arpVel, range, doppler);
648 
649  // Set the height reference
650  ossimHgtRef hgtRef(AT_DEM);
651 
652  // Project OP to DEM
653  ossimEcefPoint ellPt;
654  projOPtoSurface(opPt, range, doppler, arpPos, arpVel, &hgtRef, ellPt);
655  ossimGpt iPt(ellPt);
656 
657  worldPt = iPt;
658 
659 }
virtual ossim_float64 getArpTime() const
Get ARP time for SPOT mode (constant time).
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.
double ossim_float64
virtual bool computeOPfromImage(const ossimDpt &imgPt, ossimEcefPoint &opPt) const
Method to compute output plane coordinates from image coordinates.
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 ossimEcefPoint getArpPos() const
Get ARP position for SPOT mode (constant time).
virtual ossimEcefVector getArpVel() const
Get ARP velocity for SPOT mode (constant time).

◆ loadState()

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

Method to load or recreate the state of an ossimSarModel from a keyword list.

Parameters
kwlKeyword list to load from.
prefixPrefix for keywords, like "image01.".
Returns
true on success, false on error.

Reimplemented from ossimSensorModel.

Definition at line 142 of file ossimSarModel.cpp.

References ossimSensorModel::loadState().

143 {
144  // Call the base class. If it fails, no sense going on.
145  if (ossimSensorModel::loadState(kwl, prefix) == false)
146  {
147  if (traceDebug())
148  {
150  << "DEBUG ossimSarModel::loadState(): returning with error..."
151  << std::endl;
152  }
153 
154  return false;
155  }
156 
157  const char* lookup;
158 
159  // Get the acquisition mode
160  lookup = kwl.find(prefix, ACQ_MODE_KW);
162  if (lookup)
163  {
165  }
167  {
168  if (traceDebug())
169  {
171  << "DEBUG ossimSarModel::loadState() lookup failure: "
172  << ACQ_MODE_KW << "\nreturning with error..."
173  << std::endl;
174  }
175  return false;
176  }
177 
178  // Get the ORP (aka Output/Ground Reference Point)
180  lookup = kwl.find(prefix, ORP_POS_KW);
181  if (lookup)
182  {
183  theOrpPosition.toPoint(std::string(lookup));
184  }
185 
186  if (theOrpPosition.hasNans())
187  {
188  if (traceDebug())
189  {
191  << "DEBUG ossimSarModel::loadState() lookup failure: "
192  << ORP_POS_KW << "\nreturning with error..."
193  << std::endl;
194  }
195  return false;
196  }
197 
198  // Get the ORP image coordinates
200  lookup = kwl.find(prefix, ORP_CENTER_KW);
201  if (lookup)
202  {
203  theOrpCenter.toPoint(std::string(lookup));
204  }
205 
206  if (theOrpCenter.hasNans())
207  {
208  if (traceDebug())
209  {
211  << "DEBUG ossimSarModel::loadState() lookup failure: "
212  << ORP_CENTER_KW << "\nreturning with error..."
213  << std::endl;
214  }
215  return false;
216  }
217 
218  // Get the output plane normal (slant plane orientation)
220  lookup = kwl.find(prefix, OPNORM_KW);
221  if (lookup)
222  {
223  theOutputPlaneNormal.toPoint(std::string(lookup));
224  }
225 
227  {
228  if (traceDebug())
229  {
231  << "DEBUG ossimSarModel::loadState() lookup failure: "
232  << OPNORM_KW << "\nreturning with error..."
233  << std::endl;
234  }
235  return false;
236  }
237 
238  // Get the output plane x-axis (slant plane orientation)
240  lookup = kwl.find(prefix, OP_X_AXIS_KW);
241  if (lookup)
242  {
243  theOutputPlaneXaxis.toPoint(std::string(lookup));
244  }
245 
247  {
248  if (traceDebug())
249  {
251  << "DEBUG ossimSarModel::loadState() lookup failure: "
252  << OP_X_AXIS_KW << "\nreturning with error..."
253  << std::endl;
254  }
255  return false;
256  }
257 
258  // Get the output IPR
259  theOipr = ossim::nan();
260  lookup = kwl.find(prefix, OIPR_KW);
261  if (lookup)
262  {
264  }
265 
266  if (ossim::isnan(theOipr))
267  {
268  if (traceDebug())
269  {
271  << "DEBUG ossimSarModel::loadState() lookup failure: "
272  << OIPR_KW << "\nreturning with error..."
273  << std::endl;
274  }
275  return false;
276  }
277 
278  // Get the pixel size
280  lookup = kwl.find(prefix, PIX_SIZE_KW);
281  if (lookup)
282  {
284  }
285 
287  {
288  if (traceDebug())
289  {
291  << "DEBUG ossimSarModel::loadState() lookup failure: "
292  << PIX_SIZE_KW << "\nreturning with error..."
293  << std::endl;
294  }
295  return false;
296  }
297 
298  // Get the ARP time
300  lookup = kwl.find(prefix, ARP_TIME_KW);
301  if (lookup)
302  {
304  }
305 
307  {
308  if (traceDebug())
309  {
311  << "DEBUG ossimSarModel::loadState() lookup failure: "
312  << ARP_TIME_KW << "\nreturning with error..."
313  << std::endl;
314  }
315  return false;
316  }
317 
318  // Get the ARP position coefficients
319  // (variable degree polynomial representation of position)
320  theArpXPolCoeff.clear();
321  theArpYPolCoeff.clear();
322  theArpZPolCoeff.clear();
323  ossim_uint32 x_count = kwl.numberOf(ARP_POLY_COEFF_X_KW);
324  ossim_uint32 y_count = kwl.numberOf(ARP_POLY_COEFF_Y_KW);
325  ossim_uint32 z_count = kwl.numberOf(ARP_POLY_COEFF_Z_KW);
326 
327  if ( (x_count == y_count) && (x_count == z_count) )
328  {
329  ossim_uint32 found = 0;
330  ossim_uint32 count = 0;
331 
332  while ( (found < x_count) &&
333  (count < 100) ) // limit lookups to 100...
334  {
336  ossimString xkw = ARP_POLY_COEFF_X_KW;
337  ossimString ykw = ARP_POLY_COEFF_Y_KW;
338  ossimString zkw = ARP_POLY_COEFF_Z_KW;
339  xkw += s;
340  ykw += s;
341  zkw += s;
342 
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());
346 
347  if (xLookup && yLookup && zLookup)
348  {
349  ++found;
350  theArpXPolCoeff.push_back(ossimString::toFloat64(xLookup));
351  theArpYPolCoeff.push_back(ossimString::toFloat64(yLookup));
352  theArpZPolCoeff.push_back(ossimString::toFloat64(zLookup));
353  }
354  ++count;
355  }
356  }
357  else
358  {
359  if (traceDebug())
360  {
362  << "DEBUG ossimSarModel::loadState() lookup failure: "
363  << "arppol_coeff" << "\nreturning with error..."
364  << std::endl;
365  }
366  return false;
367  }
368 
369  // Get the time coefficients
370  // (variable degree polynomial representation of time WRT image coordinates)
371  theTimeCoeff.clear();
372  ossim_uint32 timeCount = kwl.numberOf(TIME_COEFF);
373  if (timeCount)
374  {
375  ossim_uint32 found = 0;
376  ossim_uint32 count = 0;
377 
378  while ( (found < timeCount) &&
379  (count < 100) ) // limit lookups to 100...
380  {
381  ossimString kw = TIME_COEFF;
382  kw += ossimString::toString(count);;
383 
384  lookup = kwl.find(prefix, kw.c_str());
385 
386  if (lookup)
387  {
388  ++found;
389  theTimeCoeff.push_back(ossimString::toFloat64(lookup));
390  }
391  ++count;
392  }
393  }
394  else
395  {
396  if (traceDebug())
397  {
399  << "DEBUG ossimSarModel::loadState() lookup failure: "
400  << TIME_COEFF << "\nreturning with error..."
401  << std::endl;
402  }
403  return false;
404  }
405 
406 
407  updateModel();
408 
409  if (traceDebug())
410  {
412  << "ossimSarModel::loadState() DEBUG: " << std::endl;
413  }
414 
415  return true;
416 }
ossim_float64 theOipr
output impulse response
vector< ossim_float64 > theArpZPolCoeff
ossimEcefVector theOutputPlaneXaxis
output plane x-axis
ossim_uint32 numberOf(const char *str) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
bool hasNans() const
ossim_float64 theArpTime
Aperture Reference/Center Point (ARP) time in seconds.
ossimEcefPoint theOrpPosition
Output/Ground Reference Point (ORP) position.
const char * find(const char *key) const
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
static ossimString toString(bool aValue)
Numeric to string methods.
vector< ossim_float64 > theTimeCoeff
Time Coefficients.
void toPoint(const std::string &s)
Initializes this point from string.
void toPoint(const std::string &s)
Initializes this point from string.
void setAcquisitionMode(const ossimString &mode)
Sets the acquisition mode from string.
ossimDpt theOrpCenter
sample (x)/line(y) image coordinates of ORP
unsigned int ossim_uint32
void toPoint(const std::string &s)
Initializes this point from string.
Definition: ossimDpt.cpp:192
ossim_float64 toFloat64() const
virtual void updateModel()
Compute other parameters & update the model.
bool hasNans() const
Definition: ossimDpt.h:67
vector< ossim_float64 > theArpXPolCoeff
Aperture Reference Point (ARP) Polynomials.
ossimEcefVector theOutputPlaneNormal
output plane normal
AcquisitionMode theAcquisitionMode
acquisition mode
bool hasNans() 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
ossim_float64 thePixelSize
pixel size
vector< ossim_float64 > theArpYPolCoeff
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void makeNan()
Definition: ossimDpt.h:65
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ print()

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

print method.

Reimplemented from ossimSensorModel.

Definition at line 508 of file ossimSarModel.cpp.

References ossimSensorModel::print(), ossimKeywordlist::print(), and saveState().

509 {
510  out << "// ossimSarModel::print:" << std::endl;
511 
512  ossimKeywordlist kwl;
513  if (saveState(kwl))
514  {
515  kwl.print(out);
516  }
517  else
518  {
519  out << "// ossimSarModel::saveState failed!" << std::endl;
520  }
521  return ossimSensorModel::print(out);
522 }
virtual std::ostream & print(std::ostream &os) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
Represents serializable keyword/value map.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of this object to a keyword list.
virtual std::ostream & print(std::ostream &out) const

◆ projEllipsoidToOP()

bool ossimSarModel::projEllipsoidToOP ( const ossimEcefPoint ellPt,
ossimEcefPoint opPt 
) const
protectedvirtual

Method to project ellipsoid coordinates to output plane.

Parameters
ellPtECF ellipsoid position.
opPtECF output plane position of point.
Returns
true on success, false on error.

Definition at line 1180 of file ossimSarModel.cpp.

References computeImageFromOP(), ossimEcefVector::cross(), ossimEcefVector::dot(), getArpPos(), getArpTime(), getArpVel(), ossimEcefVector::length(), ossimEcefVector::magnitude(), theOPZ, theOrpCenter, theOrpPosition, and ossimEcefVector::unitVector().

Referenced by getForwardDeriv(), and worldToLineSample().

1182 {
1183  ossimDpt currentImagePt;
1184  ossimEcefPoint selPt;
1185 
1186  // Initialize at ORP image point
1187  currentImagePt = theOrpCenter;
1188 
1189  ossim_float64 checkTime = 1.0;
1190  ossim_float64 lTime=10000.0;
1191  ossim_int32 iter = 0;
1192 
1193 
1194  // Iterate on imaging time
1195  while (checkTime > 10.0e-6 && iter<5)
1196  {
1197 
1198  // Get current time estimate
1199  ossim_float64 cTime = getArpTime(currentImagePt);
1200  checkTime = fabs(cTime-lTime)/cTime;
1201 
1202  // Get state vector at current time estimate
1203  ossimEcefPoint arpPos = getArpPos(cTime);
1204  ossimEcefVector arpVel = getArpVel(cTime);
1205  ossimEcefVector arpVelunit = arpVel.unitVector();
1206 
1207  // Define planes
1208  ossim_float64 constOP = theOPZ.dot(
1210  ossim_float64 constRD = arpVelunit.dot(
1211  ossimEcefVector(ellPt[0],ellPt[1],ellPt[2]));
1212 
1213  // Compute dot product of normals
1214  ossim_float64 ndot = theOPZ.dot(arpVelunit);
1215 
1216  // Compute line of intersection of OP and RD planes
1217  ossim_float64 det = 1.0 - ndot*ndot;
1218  ossim_float64 c1 = (constOP - ndot*constRD) / det;
1219  ossim_float64 c2 = (constRD - ndot*constOP) / det;
1220  ossimEcefPoint ori = (theOPZ*c1+arpVelunit*c2)+ossimEcefPoint(0.0,0.0,0.0);
1221  ossimEcefVector dir = theOPZ.cross(arpVelunit);
1222 
1223  // Solve for intersection points (RD circle and OP)
1224  ossimEcefVector delta = ori - arpPos;
1225  ossim_float64 a2 = dir.length()*dir.length();
1226  ossim_float64 a1 = delta.dot(dir);
1227  ossimEcefVector rng(ellPt-arpPos);
1228  ossim_float64 a0 = delta.length()*delta.length()-rng.length()*rng.length();
1229 
1230  ossim_float64 rootSqr = a1*a1-a0*a2;
1231  ossim_float64 root = sqrt(rootSqr);
1232  ossimEcefPoint p1 = ori - dir*((a1+root)/a2);
1233  ossimEcefPoint p2 = ori - dir*((a1-root)/a2);
1234 
1235  ossimEcefVector p1Delta = p1 - ellPt;
1236  ossimEcefVector p2Delta = p2 - ellPt;
1237 
1238  // Pick correct point
1239  if (p1Delta.magnitude()<p2Delta.magnitude())
1240  selPt = p1;
1241  else
1242  selPt = p2;
1243 
1244  // Compute OP image coordinates
1245  computeImageFromOP(selPt,currentImagePt);
1246 
1247  lTime = cTime;
1248  iter++;
1249  }
1250 
1251  opPt = selPt;
1252 
1253  return true;
1254 }
virtual ossim_float64 getArpTime() const
Get ARP time for SPOT mode (constant time).
ossimEcefVector unitVector() const
ossimEcefPoint theOrpPosition
Output/Ground Reference Point (ORP) position.
ossimEcefVector cross(const ossimEcefVector &) const
double dot(const ossimEcefVector &) const
double magnitude() const
virtual bool computeImageFromOP(const ossimEcefPoint &opPt, ossimDpt &imgPt) const
Method to compute image coordinates from output plane coordinates.
double ossim_float64
ossimDpt theOrpCenter
sample (x)/line(y) image coordinates of ORP
ossimEcefVector theOPZ
double length() const
virtual ossimEcefPoint getArpPos() const
Get ARP position for SPOT mode (constant time).
virtual ossimEcefVector getArpVel() const
Get ARP velocity for SPOT mode (constant time).
int ossim_int32

◆ projOPtoSurface()

bool ossimSarModel::projOPtoSurface ( const ossimEcefPoint opPt,
const ossim_float64 range,
const ossim_float64 doppler,
const ossimEcefPoint arpPos,
const ossimEcefVector arpVel,
const ossimHgtRef hgtRef,
ossimEcefPoint ellPt 
) const
protectedvirtual

Method to project output plane coordinates to surface.

Parameters
opPtECF output plane point coordinates.
rangerange.
arpVelDoppler.
arpPosECF ARP position.
arpVelECF ARP velocity.
hgtRefHeight reference defining intersection surface.
ellPtECF point coordinates.
Returns
true on success, false on error.

Definition at line 1077 of file ossimSarModel.cpp.

References computeRangeDoppler(), ossimEcefVector::dot(), ossimHgtRef::getRefHeight(), ossimGpt::height(), ossimLsrSpace::lsrToEcefRotMatrix(), theOipr, and ossimEcefVector::unitVector().

Referenced by lineSampleHeightToWorld(), and lineSampleToWorld().

1084 {
1085  // Set slopes for tangent plane
1086  ossim_float64 sx = 0.0;
1087  ossim_float64 sy = 0.0;
1088 
1089  // Set tangent plane normal vector in ENU
1090  ossimColumnVector3d tpn(sx, sy, 1.0);
1091  ossimColumnVector3d tpnn(-sx, -sy, 1.0);
1092 
1093  // Initialize at OP point
1094  ossimEcefPoint rg(opPt);
1095 
1096  // Matrices
1097  NEWMAT::SymmetricMatrix BtB(3);
1098  NEWMAT::ColumnVector BtF(3);
1099  NEWMAT::ColumnVector F(3);
1100  NEWMAT::ColumnVector dR(3);
1101 
1102  // Initialize criteria
1103  F(1)=theOipr;
1104 
1105  ossim_int32 iter = 0;
1106 
1107  while ((F(1)>=theOipr || F(2)>=0.0003048 || F(3)>=0.5) && iter<5)
1108  {
1109  // Compute current latitude/longitude estimate
1110  ossimGpt pg(rg);
1111 
1112  // Set reference point @ desired elevation
1113  ossim_float64 atHgt = hgtRef->getRefHeight(pg);
1114  pg.height(atHgt);
1115  ossimEcefPoint rt(pg);
1116 
1117  // Define ENU space at reference point
1118  ossimLsrSpace enu(pg);
1119 
1120  // Rotate normal vector to ECF
1121  ossimEcefVector st = enu.lsrToEcefRotMatrix()*tpn;
1122 
1123  // Compute current range & Doppler estimate
1124  ossim_float64 rngComp;
1125  ossim_float64 dopComp;
1126  computeRangeDoppler(rg, arpPos, arpVel, rngComp, dopComp);
1127 
1128  // Compute current height estimate
1129  ossim_float64 diffHgt = st.dot(rg-rt);
1130 
1131  // Compute current fr, fd, ft
1132  F(1) = rngComp - range;
1133  F(2) = dopComp - doppler;
1134  F(3) = diffHgt;
1135 
1136  // Compute fr partials
1137  ossimEcefVector delta = rg - arpPos;
1138  ossimEcefVector deltaUv = delta.unitVector();
1139  ossimEcefVector p_fr = -deltaUv;
1140 
1141  // Compute fd partials
1142  ossim_float64 vDotr = arpVel.dot(deltaUv);
1143  ossimEcefVector p_fd = (arpVel - deltaUv*vDotr)/rngComp;
1144 
1145  // Compute ft partials
1146  ossimColumnVector3d p_ft = enu.lsrToEcefRotMatrix()*tpnn;
1147 
1148  // Form B-matrix
1149  NEWMAT::Matrix B = ossimMatrix3x3::create(p_fr[0], p_fr[1], p_fr[2],
1150  p_fd[0], p_fd[1], p_fd[2],
1151  p_ft[0], p_ft[1], p_ft[2]);
1152 
1153  // Form coefficient matrix & discrepancy vector
1154  BtF << B.t()*F;
1155  BtB << B.t()*B;
1156 
1157  // Solve system
1158  dR = solveLeastSquares(BtB, BtF);
1159 
1160  // Update estimate
1161  for (ossim_int32 k=0; k<3; k++)
1162  rg[k] -= dR(k+1);
1163 
1164  iter++;
1165  }
1166 
1167  // Set intersection for return
1168  ellPt = rg;
1169 
1170  return true;
1171 }
ossim_float64 theOipr
output impulse response
ossimEcefVector unitVector() const
virtual ossim_float64 getRefHeight(const ossimGpt &pg) const
Method to get height reference.
Definition: ossimHgtRef.cpp:90
double dot(const ossimEcefVector &) const
double ossim_float64
static NEWMAT::Matrix create()
NEWMAT::ColumnVector solveLeastSquares(NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &r) 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.
int ossim_int32

◆ saveState()

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

Method to save the state of this object to a keyword list.

Parameters
kwlKeyword list to save to.
prefixPrefix for keywords, like "image01.".
Returns
true on success, false on error.

Reimplemented from ossimSensorModel.

Definition at line 425 of file ossimSarModel.cpp.

References ossimKeywordlist::add().

Referenced by print().

426 {
427  kwl.add(prefix, ACQ_MODE_KW, getAcquistionModeString());
428  kwl.add(prefix, ORP_POS_KW, theOrpPosition.toString(15).c_str());
429  kwl.add(prefix, ORP_CENTER_KW, theOrpCenter.toString(15).c_str());
430  kwl.add(prefix, OPNORM_KW, theOutputPlaneNormal.toString(15).c_str());
431  kwl.add(prefix, OP_X_AXIS_KW, theOutputPlaneXaxis.toString(15).c_str());
432  kwl.add(prefix, OIPR_KW, theOipr);
433  kwl.add(prefix, PIX_SIZE_KW, thePixelSize);
434  kwl.add(prefix, ARP_TIME_KW, theArpTime);
435 
436  ossim_uint32 i;
437  for (i = 0; i < theArpXPolCoeff.size(); ++i)
438  {
439  ossimString kw = ARP_POLY_COEFF_X_KW;
440  kw += ossimString::toString(i);
441  kwl.add(prefix, kw, theArpXPolCoeff[i]);
442  }
443  for (i = 0; i < theArpYPolCoeff.size(); ++i)
444  {
445  ossimString kw = ARP_POLY_COEFF_Y_KW;
446  kw += ossimString::toString(i);
447  kwl.add(prefix, kw, theArpYPolCoeff[i]);
448  }
449  for (i = 0; i < theArpZPolCoeff.size(); ++i)
450  {
451  ossimString kw = ARP_POLY_COEFF_Z_KW;
452  kw += ossimString::toString(i);
453  kwl.add(prefix, kw, theArpZPolCoeff[i]);
454  }
455  for (i = 0; i < theTimeCoeff.size(); ++i)
456  {
457  ossimString kw = TIME_COEFF;
458  kw += ossimString::toString(i);
459  kwl.add(prefix, kw, theTimeCoeff[i]);
460  }
461 
462  return ossimSensorModel::saveState(kwl, prefix);
463 }
ossim_float64 theOipr
output impulse response
vector< ossim_float64 > theArpZPolCoeff
ossimEcefVector theOutputPlaneXaxis
output plane x-axis
ossimString getAcquistionModeString() const
Returns the acquisition mode as a string.
ossim_float64 theArpTime
Aperture Reference/Center Point (ARP) time in seconds.
ossimEcefPoint theOrpPosition
Output/Ground Reference Point (ORP) position.
ossimString toString(ossim_uint32 precision=15) const
To string method.
static ossimString toString(bool aValue)
Numeric to string methods.
vector< ossim_float64 > theTimeCoeff
Time Coefficients.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimDpt theOrpCenter
sample (x)/line(y) image coordinates of ORP
unsigned int ossim_uint32
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
vector< ossim_float64 > theArpXPolCoeff
Aperture Reference Point (ARP) Polynomials.
ossimEcefVector theOutputPlaneNormal
output plane normal
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimDpt.cpp:160
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
ossim_float64 thePixelSize
pixel size
vector< ossim_float64 > theArpYPolCoeff
ossimString toString(ossim_uint32 precision=15) const
To string method.

◆ sensorAzimuth()

double ossimSarModel::sensorAzimuth ( const ossimDpt image_point) const
virtual

Definition at line 1404 of file ossimSarModel.cpp.

References ossimGpt::azimuthTo(), getArpPos(), getArpTime(), and lineSampleToWorld().

1405 {
1406  ossimGpt ground;
1407  lineSampleToWorld(image_point, ground);
1408 
1409  // Get image time
1410  ossim_float64 iTime = getArpTime(image_point);
1411 
1412  // Get ARP position
1413  ossimEcefPoint arpPos = getArpPos(iTime);
1414 
1415  ossimGpt sensor(arpPos);
1416 
1417  return ground.azimuthTo(sensor);
1418 }
virtual ossim_float64 getArpTime() const
Get ARP time for SPOT mode (constant time).
double azimuthTo(const ossimGpt &arg_gpt) const
METHOD: azimuthTo(ossimGpt) Computes the great-circle starting azimuth (i.e., at this gpt) to the arg...
Definition: ossimGpt.cpp:446
virtual void lineSampleToWorld(const ossimDpt &image_point, ossimGpt &world_point) const
double ossim_float64
virtual ossimEcefPoint getArpPos() const
Get ARP position for SPOT mode (constant time).

◆ setAcquisitionMode()

void ossimSarModel::setAcquisitionMode ( const ossimString mode)
protected

Sets the acquisition mode from string.

Parameters
modeThe string representing mode.

Definition at line 1386 of file ossimSarModel.cpp.

References ossimString::downcase(), SCAN, SPOT, theAcquisitionMode, and UNKNOWN.

1387 {
1388  ossimString os = mode;
1389  os.downcase();
1390  if (os == "scan")
1391  {
1393  }
1394  else if (os == "spot")
1395  {
1397  }
1398  else
1399  {
1401  }
1402 }
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
AcquisitionMode theAcquisitionMode
acquisition mode

◆ updateModel()

void ossimSarModel::updateModel ( )
virtual

Compute other parameters & update the model.

Reimplemented from ossimSensorModel.

Definition at line 752 of file ossimSarModel.cpp.

References ossimEcefVector::cross(), ossimEcefVector::normalize(), theOPX, theOPY, theOPZ, theOutputPlaneNormal, theOutputPlaneXaxis, thePixelSize, thePixelSpacing, and ossimEcefVector::unitVector().

753 {
754  // Set the pixel size
756 
757  // Define the output(focus) plane
758  // Ref[1], eq. 11-29 -> 11-31
761 
763  theOPY.normalize();
764 
766 
767  if (traceDebug())
768  {
770  << "DEBUG updateModel:\n OP vectors...";
772  << "\n OPX: "<<theOPX
773  << "\n OPY: "<<theOPY
774  << "\n OPZ: "<<theOPZ<<endl;
775  ossimGpt orpg(theOrpPosition);
777  <<" ORPgeo: "<<orpg<<endl;
778  }
779  // Update geometry
786 
787  // Set base class members
793 
794 }
ossimEcefVector unitVector() const
ossimEcefVector theOutputPlaneXaxis
output plane x-axis
double z() const
ossimEcefPoint theOrpPosition
Output/Ground Reference Point (ORP) position.
ossimEcefVector cross(const ossimEcefVector &) const
double samp
Definition: ossimDpt.h:164
ossimEcefVector theOPX
Output/slant plane unit vectors.
ossim_float64 thePixelSpacing
Other computed parameters.
double line
Definition: ossimDpt.h:165
ossimDpt theOrpCenter
sample (x)/line(y) image coordinates of ORP
ossimEcefVector theOPZ
ossimEcefVector theOutputPlaneNormal
output plane normal
double x() const
double y() const
ossimEcefVector theLsrOffset
Adjustable parameters.
ossimEcefVector theOPY
ossim_float64 thePixelSize
pixel size
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_float64 theMeanGSD

◆ useForward()

virtual bool ossimSarModel::useForward ( ) const
inlinevirtual

ossimOptimizableProjection

image to ground faster

Implements ossimOptimizableProjection.

Definition at line 131 of file ossimSarModel.h.

132  {
133  return false;
134  }

◆ worldToLineSample()

void ossimSarModel::worldToLineSample ( const ossimGpt worldPoint,
ossimDpt lineSampPt 
) const
virtual

METHOD: worldToLineSample() Performs the forward projection from ground point to line, sample.

Reimplemented from ossimSensorModel.

Definition at line 610 of file ossimSarModel.cpp.

References computeImageFromOP(), and projEllipsoidToOP().

612 {
613  ossimEcefPoint pt(world_point);
614 
615  // Project to OP plane
616  ossimEcefPoint opPt;
617  projEllipsoidToOP(pt, opPt);
618 
619  // Compute image coordinates from OP position
620  computeImageFromOP(opPt,image_point);
621 }
virtual bool computeImageFromOP(const ossimEcefPoint &opPt, ossimDpt &imgPt) const
Method to compute image coordinates from output plane coordinates.
virtual bool projEllipsoidToOP(const ossimEcefPoint &ellPt, ossimEcefPoint &opPt) const
Method to project ellipsoid coordinates to output plane.

◆ writeGeomTemplate()

void ossimSarModel::writeGeomTemplate ( ostream &  os)
static

Writes a template of geom keywords processed by loadState and saveState to output stream.

Definition at line 473 of file ossimSarModel.cpp.

474 {
475  if (traceExec())
476  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSarModel::writeGeomTemplate: entering..." << std::endl;
477 
478  os <<
479  "//************************************\n"
480  "// Template for SAR model keywordlist\n"
481  "//************************************\n";
482 
484  os << "//***\n"
485  << "// Base-class SAR Keywords:\n"
486  << "//***\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";
499  }
static void writeGeomTemplate(ostream &os)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Data Documentation

◆ theAcquisitionMode

AcquisitionMode ossimSarModel::theAcquisitionMode
protected

acquisition mode

Definition at line 275 of file ossimSarModel.h.

Referenced by getAcquistionModeString(), and setAcquisitionMode().

◆ theArpTime

ossim_float64 ossimSarModel::theArpTime
protected

Aperture Reference/Center Point (ARP) time in seconds.

Definition at line 296 of file ossimSarModel.h.

◆ theArpXPolCoeff

vector<ossim_float64> ossimSarModel::theArpXPolCoeff
protected

Aperture Reference Point (ARP) Polynomials.

Note: Size is derived dependent.

Definition at line 302 of file ossimSarModel.h.

Referenced by getArpPos(), and getArpVel().

◆ theArpYPolCoeff

vector<ossim_float64> ossimSarModel::theArpYPolCoeff
protected

Definition at line 303 of file ossimSarModel.h.

Referenced by getArpPos(), and getArpVel().

◆ theArpZPolCoeff

vector<ossim_float64> ossimSarModel::theArpZPolCoeff
protected

Definition at line 304 of file ossimSarModel.h.

Referenced by getArpPos(), and getArpVel().

◆ theLsrOffset

ossimEcefVector ossimSarModel::theLsrOffset
protected

Adjustable parameters.

Definition at line 340 of file ossimSarModel.h.

Referenced by getArpPos().

◆ theObsArpPos

ossimEcefPoint ossimSarModel::theObsArpPos
protected

Definition at line 331 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ theObsArpVel

ossimEcefVector ossimSarModel::theObsArpVel
protected

Definition at line 332 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ theObsArpVel_Mag

ossim_float64 ossimSarModel::theObsArpVel_Mag
protected

Definition at line 334 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ theObsArpVel_U

ossimEcefVector ossimSarModel::theObsArpVel_U
protected

Definition at line 333 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ theObsDop

ossim_float64 ossimSarModel::theObsDop
protected

Definition at line 327 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ theObsOP

ossimEcefPoint ossimSarModel::theObsOP
protected

Definition at line 330 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ theObsPosition

ossimEcefPoint ossimSarModel::theObsPosition
protected

Definition at line 329 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ theObsRng

ossim_float64 ossimSarModel::theObsRng
protected

Adjustment-related data used and set by getForwardDeriv.

Observations for current point

Definition at line 326 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ theObsTime

ossim_float64 ossimSarModel::theObsTime
protected

Definition at line 328 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ theOipr

ossim_float64 ossimSarModel::theOipr
protected

output impulse response

Definition at line 290 of file ossimSarModel.h.

Referenced by projOPtoSurface().

◆ theOPX

ossimEcefVector ossimSarModel::theOPX
protected

Output/slant plane unit vectors.

Definition at line 317 of file ossimSarModel.h.

Referenced by computeImageFromOP(), computeOPfromImage(), and updateModel().

◆ theOPY

ossimEcefVector ossimSarModel::theOPY
protected

Definition at line 318 of file ossimSarModel.h.

Referenced by computeImageFromOP(), computeOPfromImage(), and updateModel().

◆ theOPZ

ossimEcefVector ossimSarModel::theOPZ
protected

Definition at line 319 of file ossimSarModel.h.

Referenced by projEllipsoidToOP(), and updateModel().

◆ theOrpCenter

ossimDpt ossimSarModel::theOrpCenter
protected

sample (x)/line(y) image coordinates of ORP

Definition at line 281 of file ossimSarModel.h.

Referenced by computeImageFromOP(), computeOPfromImage(), and projEllipsoidToOP().

◆ theOrpPosition

ossimEcefPoint ossimSarModel::theOrpPosition
protected

Output/Ground Reference Point (ORP) position.

Definition at line 278 of file ossimSarModel.h.

Referenced by computeImageFromOP(), computeOPfromImage(), lineSampleHeightToWorld(), and projEllipsoidToOP().

◆ theOutputPlaneNormal

ossimEcefVector ossimSarModel::theOutputPlaneNormal
protected

output plane normal

Definition at line 284 of file ossimSarModel.h.

Referenced by updateModel().

◆ theOutputPlaneXaxis

ossimEcefVector ossimSarModel::theOutputPlaneXaxis
protected

output plane x-axis

Definition at line 287 of file ossimSarModel.h.

Referenced by updateModel().

◆ theParDopWRTaz

ossim_float64 ossimSarModel::theParDopWRTaz
protected

Partials for current point.

Definition at line 337 of file ossimSarModel.h.

Referenced by getForwardDeriv().

◆ thePixelSize

ossim_float64 ossimSarModel::thePixelSize
protected

pixel size

Definition at line 293 of file ossimSarModel.h.

Referenced by updateModel().

◆ thePixelSpacing

ossim_float64 ossimSarModel::thePixelSpacing
protected

Other computed parameters.

Pixel spacing

Definition at line 314 of file ossimSarModel.h.

Referenced by computeImageFromOP(), computeOPfromImage(), and updateModel().

◆ theTimeCoeff

vector<ossim_float64> ossimSarModel::theTimeCoeff
protected

Time Coefficients.

Note: Size is derived dependent.

Definition at line 307 of file ossimSarModel.h.

Referenced by getArpTime().


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