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
ossimSpot5Model Class Reference

#include <ossimSpot5Model.h>

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

Public Types

enum  AdjustParamIndex {
  ROLL_OFFSET = 0, PITCH_OFFSET, YAW_OFFSET, ROLL_RATE,
  PITCH_RATE, YAW_RATE, FOCAL_LEN_OFFSET, 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

 ossimSpot5Model ()
 
 ossimSpot5Model (ossimSpotDimapSupportData *sd)
 
 ossimSpot5Model (const ossimFilename &init_file)
 
 ossimSpot5Model (const ossimKeywordlist &geom_kwl)
 
 ossimSpot5Model (const ossimSpot5Model &rhs)
 
virtual ~ossimSpot5Model ()
 
virtual ossimObjectdup () const
 
virtual std::ostream & print (std::ostream &out) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=NULL) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=NULL)
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const ossim_float64 &heightEllipsoid, ossimGpt &worldPoint) const
 
virtual void imagingRay (const ossimDpt &image_point, ossimEcefRay &image_ray) const
 
virtual void updateModel ()
 
virtual bool useForward () const
 
virtual bool setupOptimizer (const ossimString &init_file)
 image to ground faster More...
 
bool initFromMetadata (ossimSpotDimapSupportData *sd)
 uses file path to init model 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...
 
virtual void lineSampleToWorld (const ossimDpt &image_point, ossimGpt &world_point) const
 
virtual void worldToLineSample (const ossimGpt &world_point, ossimDpt &image_point) const
 
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 ossimDpt getForwardDeriv (int parmIdx, const ossimGpt &gpos, double hdelta=1e-11)
 
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 Public Member Functions inherited from ossimSensorModel
static void writeGeomTemplate (ostream &os)
 

Protected Member Functions

void initAdjustableParameters ()
 
void loadGeometry (FILE *)
 
void loadSupportData ()
 
void computeSatToOrbRotation (NEWMAT::Matrix &result, ossim_float64 t) 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

ossimRefPtr< ossimSpotDimapSupportDatatheSupportData
 
ossimFilename theMetaDataFile
 
ossim_float64 theIllumAzimuth
 
ossim_float64 theIllumElevation
 
ossim_float64 thePositionError
 
ossim_float64 theRefImagingTime
 
ossim_float64 theRefImagingTimeLine
 relative to full image More...
 
ossim_float64 theLineSamplingPeriod
 
ossimDpt theSpotSubImageOffset
 
ossim_float64 theRollOffset
 
ossim_float64 thePitchOffset
 
ossim_float64 theYawOffset
 
ossim_float64 theRollRate
 
ossim_float64 thePitchRate
 
ossim_float64 theYawRate
 
ossim_float64 theFocalLenOffset
 
- 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 31 of file ossimSpot5Model.h.

Member Enumeration Documentation

◆ AdjustParamIndex

Enumerator
ROLL_OFFSET 
PITCH_OFFSET 
YAW_OFFSET 
ROLL_RATE 
PITCH_RATE 
YAW_RATE 
FOCAL_LEN_OFFSET 
NUM_ADJUSTABLE_PARAMS 

Definition at line 45 of file ossimSpot5Model.h.

Constructor & Destructor Documentation

◆ ossimSpot5Model() [1/5]

ossimSpot5Model::ossimSpot5Model ( )

CONSTRUCTORS:

Definition at line 68 of file ossimSpot5Model.cpp.

References initAdjustableParameters().

Referenced by dup().

69  :
71  theSupportData (NULL),
72  theMetaDataFile ("NOT ASSIGNED"),
73  theIllumAzimuth (0.0),
74  theIllumElevation (0.0),
75  thePositionError (0.0),
76  theRefImagingTime (0.0),
79 // theSatToOrbRotation (3, 3),
80 // theOrbToEcfRotation (3, 3),
81  theRollOffset (0.0),
82  thePitchOffset (0.0),
83  theYawOffset (0.0),
84  theRollRate (0.0),
85  thePitchRate (0.0),
86  theYawRate (0.0),
87  theFocalLenOffset (0.0)
88 {
90 }
ossim_float64 theRefImagingTime
ossim_float64 theYawOffset
ossim_float64 thePositionError
ossim_float64 theIllumElevation
ossim_float64 theRefImagingTimeLine
relative to full image
ossimFilename theMetaDataFile
ossim_float64 theRollRate
ossim_float64 theFocalLenOffset
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
ossim_float64 theIllumAzimuth
ossim_float64 theRollOffset
ossim_float64 theYawRate
ossim_float64 theLineSamplingPeriod
ossim_float64 thePitchOffset
ossim_float64 thePitchRate
void initAdjustableParameters()

◆ ossimSpot5Model() [2/5]

ossimSpot5Model::ossimSpot5Model ( ossimSpotDimapSupportData sd)

Definition at line 92 of file ossimSpot5Model.cpp.

93  :
95  theSupportData (sd),
96  theMetaDataFile ("NOT ASSIGNED"),
97  theIllumAzimuth (0.0),
98  theIllumElevation (0.0),
99  thePositionError (0.0),
100  theRefImagingTime (0.0),
101  theRefImagingTimeLine (0.0),
102  theLineSamplingPeriod (0.0),
103 // theSatToOrbRotation (3, 3),
104 // theOrbToEcfRotation (3, 3),
105  theRollOffset (0.0),
106  thePitchOffset (0.0),
107  theYawOffset (0.0),
108  theRollRate (0.0),
109  thePitchRate (0.0),
110  theYawRate (0.0),
111  theFocalLenOffset (0.0)
112 {
113  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model(dimap_file) Constructor: entering..." << std::endl;
114 
115  //---
116  // Instantiate the support data classes after establishing the filenames:
117  //---
118  loadSupportData();
120  {
121  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model(dimap_file) Constructor: returning with error..." << std::endl;
122  return;
123  }
124 
125  //---
126  // initialize remaining data members:
127  //---
129  updateModel();
130 
131  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model(dimap_file) Constructor: returning..." << std::endl;
132 }
ossim_float64 theRefImagingTime
ossim_float64 theYawOffset
ossim_float64 thePositionError
static const ossimErrorCode OSSIM_OK
ossim_float64 theIllumElevation
ossim_float64 theRefImagingTimeLine
relative to full image
ossimFilename theMetaDataFile
ossim_float64 theRollRate
ossim_float64 theFocalLenOffset
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
ossim_float64 theIllumAzimuth
ossim_float64 theRollOffset
ossim_float64 theYawRate
ossim_float64 theLineSamplingPeriod
ossim_float64 thePitchOffset
ossim_float64 thePitchRate
virtual void updateModel()
virtual ossimErrorCode getErrorStatus() const
void initAdjustableParameters()
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimSpot5Model() [3/5]

ossimSpot5Model::ossimSpot5Model ( const ossimFilename init_file)

◆ ossimSpot5Model() [4/5]

ossimSpot5Model::ossimSpot5Model ( const ossimKeywordlist geom_kwl)

◆ ossimSpot5Model() [5/5]

ossimSpot5Model::ossimSpot5Model ( const ossimSpot5Model rhs)

Definition at line 147 of file ossimSpot5Model.cpp.

References ossimSpotDimapSupportData::dup(), loadSupportData(), theSupportData, updateModel(), and ossimRefPtr< T >::valid().

148  :ossimSensorModel(rhs)
149 {
150  if(rhs.theSupportData.valid())
151  {
153  }
154  loadSupportData();
155  updateModel();
156 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
virtual void updateModel()
virtual ossimObject * dup() const

◆ ~ossimSpot5Model()

ossimSpot5Model::~ossimSpot5Model ( )
virtual

Definition at line 138 of file ossimSpot5Model.cpp.

139 {
140  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimSpot5Model(): entering..." << std::endl;
141 
142  theSupportData = 0;
143 
144  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimSpot5Model(): returning..." << std::endl;
145 }
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Function Documentation

◆ computeSatToOrbRotation()

void ossimSpot5Model::computeSatToOrbRotation ( NEWMAT::Matrix &  result,
ossim_float64  t 
) const
protected

Definition at line 159 of file ossimSpot5Model.cpp.

160 {
161  if (traceExec())
162  {
164  << "DEBUG ossimSpot5Model::computeSatToOrbRotation(): entering..."
165  << std::endl;
166  }
167  //---
168  // Linearly interpolate attitudes angles:
169  //---
170  ossimDpt3d att;
171  theSupportData->getAttitude(t, att);
172 
173  //---
174  // Apply the attitude adjustable parameters:
175  //---
176  double dt = theRefImagingTime - t;
177  att.x += thePitchOffset + dt*thePitchRate;
178  att.y += theRollOffset + dt*theRollRate;
179  att.z += theYawOffset + dt*theYawRate;
180 
181  //---
182  // Compute trig functions to populate rotation matrices: ANGLES IN RADIANS
183  //---
184  double cp = cos(att.x);
185  double sp = sin(att.x);
186  double cr = cos(att.y);
187  double sr = sin(att.y);
188  double cy = cos(att.z);
189  double sy = sin(att.z);
190 
191  //---
192  // Populate rotation matrix:
193  //---
194  result = NEWMAT::Matrix(3,3);
195  result << (cr*cy) << (-cr*sy) << (-sr)
196  << (cp*sy+sp*sr*cy) << (cp*cy-sp*sr*sy) << (sp*cr)
197  << (-sp*sy+cp*sr*cy) << (-sp*cy-cp*sr*sy) << cp*cr;
198 
199 
200  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::computeSatToOrbRotation(): returning..." << std::endl;
201 }
ossim_float64 theRefImagingTime
ossim_float64 theYawOffset
ossim_float64 theRollRate
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
void getAttitude(ossim_uint32 sample, ossimDpt3d &at) const
ossim_float64 theRollOffset
ossim_float64 theYawRate
double z
Definition: ossimDpt3d.h:145
ossim_float64 thePitchOffset
ossim_float64 thePitchRate
double x
Definition: ossimDpt3d.h:143
double y
Definition: ossimDpt3d.h:144
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ dup()

ossimObject * ossimSpot5Model::dup ( ) const
virtual

Returns pointer to a new instance, copy of this. Not implemented yet! Returns NULL...

Implements ossimProjection.

Definition at line 443 of file ossimSpot5Model.cpp.

References ossimSpot5Model().

444 {
445  return new ossimSpot5Model(*this);
446 }

◆ imagingRay()

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

Given an image point, returns a ray originating at some arbitrarily high point (ideally at the sensor position) and pointing towards the target.

Reimplemented from ossimSensorModel.

Definition at line 527 of file ossimSpot5Model.cpp.

References ossimDpt::line, ossimDpt::samp, theLineSamplingPeriod, theRefImagingTime, theRefImagingTimeLine, and theSpotSubImageOffset.

529 {
530  bool runtime_dbflag = 0;
531  NEWMAT::Matrix satToOrbit;
532  ossimDpt iPt = image_point;
535 
536  //
537  // 1. Establish time of line imaging:
538  //
539  double t_line = theRefImagingTime +
541  if (traceDebug() || runtime_dbflag)
542  {
543  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG Spot5Model::imagingRay():------------ BEGIN DEBUG PASS ---------------" << std::endl;
544  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG Spot5Model::imagingRay(): t_line = " << t_line << std::endl;
545  }
546 
547  //
548  // 2. Interpolate ephemeris position and velocity (in ECF):
549  //
550  ossimEcefPoint tempEcefPoint;
551  ossimEcefPoint P_ecf;
552  theSupportData->getPositionEcf(t_line, P_ecf);
553  theSupportData->getVelocityEcf(t_line, tempEcefPoint);
554  ossimEcefVector V_ecf(tempEcefPoint.x(),
555  tempEcefPoint.y(),
556  tempEcefPoint.z());
557  if (traceDebug() || runtime_dbflag)
558  {
560  << "DEBUG:\n\tP_ecf = " << P_ecf
561  << "\n\t V_ecf = " << V_ecf << std::endl;
562  }
563 
564  //
565  // 3. Establish the look direction in Vehicle LSR space (S_sat).
566  // ANGLES IN RADIANS
567  //
568  ossim_float64 Psi_x;
570  ossim_float64 Psi_y;
572  if (traceDebug() || runtime_dbflag)
573  {
575  << "DEBUG:\n\t Psi_x = " << Psi_x
576  << "\n\t Psi_y = " << Psi_y << endl;
577  }
578 
579  ossimColumnVector3d u_sat (-tan(Psi_y), tan(Psi_x), -(1.0 + theFocalLenOffset));
580  if (traceDebug() || runtime_dbflag)
581  {
583  << "DEBUG \n\t u_sat = " << u_sat << endl;
584  }
585 
586  //
587  // 4. Transform vehicle LSR space look direction vector to orbital LSR space
588  // (S_orb):
589  //
590  computeSatToOrbRotation(satToOrbit, t_line);
591 
592  ossimColumnVector3d u_orb = (satToOrbit*u_sat).unit();
593  if (traceDebug() || runtime_dbflag)
594  {
596  << "DEBUG:\n\t theSatToOrbRotation = " << satToOrbit
597  << "\n\t u_orb = " << u_orb << endl;
598  }
599 
600  //
601  // 5. Transform orbital LSR space look direction vector to ECF.
602  //
603  // a. S_orb space Z-axis (Z_orb) is || to the ECF radial vector (P_ecf),
604  // b. X_orb axis is computed as cross-product between velocity and radial,
605  // c. Y_orb completes the orthogonal S_orb coordinate system.
606  //
607  ossimColumnVector3d Z_orb (P_ecf.x(),
608  P_ecf.y(),
609  P_ecf.z());
610  Z_orb = Z_orb.unit();
611 
612  ossimColumnVector3d X_orb = ossimColumnVector3d(V_ecf.x(),
613  V_ecf.y(),
614  V_ecf.z()).cross(Z_orb).unit();
615  ossimColumnVector3d Y_orb = Z_orb.cross(X_orb);
616 
617  NEWMAT::Matrix orbToEcfRotation = NEWMAT::Matrix(3, 3);
618  orbToEcfRotation << X_orb[0] << Y_orb[0] << Z_orb[0]
619  << X_orb[1] << Y_orb[1] << Z_orb[1]
620  << X_orb[2] << Y_orb[2] << Z_orb[2];
621 
622 
623  ossimColumnVector3d u_ecf = (orbToEcfRotation*u_orb);
624  if (traceDebug() || runtime_dbflag)
625  {
627  << "DEBUG:\n\t orbToEcfRotation = " << orbToEcfRotation
628  << "\n\t u_ecf = " << u_ecf << endl;
629  }
630 
631  //
632  // Establish the imaging ray given direction and origin:
633  //
634  image_ray = ossimEcefRay(P_ecf, ossimEcefVector(u_ecf[0], u_ecf[1], u_ecf[2]));
635 
636  if (traceExec())
637  {
639  << "DEBUG Spot5Model::imagingRay(): returning..." << std::endl;
640  }
641 }
ossim_float64 theRefImagingTime
void computeSatToOrbRotation(NEWMAT::Matrix &result, ossim_float64 t) const
ossimColumnVector3d cross(const ossimColumnVector3d &rhs) const
void getPixelLookAngleX(ossim_uint32 sample, ossim_float64 &pa) const
double samp
Definition: ossimDpt.h:164
ossimDpt theSpotSubImageOffset
ossim_float64 theRefImagingTimeLine
relative to full image
double x() const
ossimColumnVector3d unit() const
ossim_float64 theFocalLenOffset
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
void getVelocityEcf(ossim_uint32 sample, ossimEcefPoint &ve) const
void getPixelLookAngleY(ossim_uint32 sample, ossim_float64 &pa) const
double ossim_float64
double line
Definition: ossimDpt.h:165
ossim_float64 theLineSamplingPeriod
double y() const
void getPositionEcf(ossim_uint32 sample, ossimEcefPoint &pe) const
double z() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ initAdjustableParameters()

void ossimSpot5Model::initAdjustableParameters ( )
protectedvirtual

Sets adjustables to default values.

Reimplemented from ossimAdjustableParameterInterface.

Definition at line 310 of file ossimSpot5Model.cpp.

Referenced by ossimSpot5Model().

311 {
312  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::initAdjustableParameters(): entering..." << std::endl;
313 
314  //---
315  // Allocate storage for adjustables and assign their names and units
316  // strings.
317  //---
320 
321  //---
322  // Initialize base-class adjustable parameter array:
323  //---
324  for (ossim_uint32 i=0; i<numParams; ++i)
325  {
326  setAdjustableParameter(i, 0.0);
327  setParameterDescription(i, PARAM_NAMES[i]);
328  setParameterUnit(i,PARAM_UNITS[i]);
329  setParameterSigma(i, SIGMA[i]);
330  }
331 
332  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::initAdjustableParameters(): returning..." << std::endl;
333 }
void setParameterDescription(ossim_uint32 idx, const ossimString &descrption)
unsigned int ossim_uint32
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)

◆ initFromMetadata()

bool ossimSpot5Model::initFromMetadata ( ossimSpotDimapSupportData sd)

uses file path to init model

Definition at line 751 of file ossimSpot5Model.cpp.

References ossimErrorStatusInterface::getErrorStatus(), loadSupportData(), ossimErrorCodes::OSSIM_OK, theFocalLenOffset, theIllumAzimuth, theIllumElevation, theLineSamplingPeriod, theMetaDataFile, thePitchOffset, thePitchRate, thePositionError, theRefImagingTime, theRollOffset, theRollRate, theSupportData, theYawOffset, and theYawRate.

Referenced by setupOptimizer().

752 {
753  // init parms
754  theSupportData = sd;
755  theMetaDataFile = "NOT ASSIGNED";
756  theIllumAzimuth = 0.0;
757  theIllumElevation = 0.0;
758  thePositionError = 0.0;
759  theRefImagingTime = 0.0;
760  theLineSamplingPeriod = 0.0;
761 // theSatToOrbRotation = 0.0; //matrix
762 // theOrbToEcfRotation = 0.0; //matrix
763  theRollOffset = 0.0;
764  thePitchOffset = 0.0;
765  theYawOffset = 0.0;
766  theRollRate = 0.0;
767  thePitchRate = 0.0;
768  theYawRate = 0.0;
769  theFocalLenOffset = 0.0;
770 
771  //---
772  // Instantiate the support data classes after establishing the filenames:
773  //---
774  loadSupportData();
776  {
777  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::initFromMetadata(dimap_file): returning with error..." << std::endl;
778  return false;
779  }
780 
781  //---
782  // initialize remaining data members:
783  //---
785  updateModel();
786  return true;
787 }
ossim_float64 theRefImagingTime
ossim_float64 theYawOffset
ossim_float64 thePositionError
static const ossimErrorCode OSSIM_OK
ossim_float64 theIllumElevation
ossimFilename theMetaDataFile
ossim_float64 theRollRate
ossim_float64 theFocalLenOffset
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
ossim_float64 theIllumAzimuth
ossim_float64 theRollOffset
ossim_float64 theYawRate
ossim_float64 theLineSamplingPeriod
ossim_float64 thePitchOffset
ossim_float64 thePitchRate
virtual void updateModel()
virtual ossimErrorCode getErrorStatus() const
void initAdjustableParameters()
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ lineSampleHeightToWorld()

void ossimSpot5Model::lineSampleHeightToWorld ( const ossimDpt image_point,
const ossim_float64 heightEllipsoid,
ossimGpt worldPoint 
) const
virtual

Given an image point and height, initializes worldPoint.

Implements ossimSensorModel.

Definition at line 643 of file ossimSpot5Model.cpp.

References ossimSensorModel::extrapolate(), FLT_EPSILON, ossimProjection::lineSampleToWorld(), ossimDrect::pointWithin(), ossimSensorModel::theImageClipRect, ossimSensorModel::theSeedFunction, and ossimRefPtr< T >::valid().

646 {
647 // if (!insideImage(image_point))
648  if ( !theImageClipRect.pointWithin(image_point, 1.0-FLT_EPSILON) )
649  {
650  if(theSeedFunction.valid())
651  {
652  theSeedFunction->lineSampleToWorld(image_point, worldPoint);
653  }
654  else
655  {
656  worldPoint = extrapolate(image_point, heightEllipsoid);
657  }
658  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::lineSampleHeightToWorld(): returning..." << std::endl;
659  return;
660  }
661  //***
662  // First establish imaging ray from image point:
663  //***
664  ossimEcefRay imaging_ray;
665  imagingRay(image_point, imaging_ray);
666  ossimEcefPoint Pecf (imaging_ray.intersectAboveEarthEllipsoid(heightEllipsoid));
667  worldPoint = ossimGpt(Pecf);
668 }
bool pointWithin(const ossimDpt &pt, double epsilon=0.0) const
Definition: ossimDrect.h:781
ossimEcefPoint intersectAboveEarthEllipsoid(const double &heightAboveEllipsoid, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84()) const
bool valid() const
Definition: ossimRefPtr.h:75
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const
#define FLT_EPSILON
virtual ossimDpt extrapolate(const ossimGpt &gp) const
ossimRefPtr< ossimProjection > theSeedFunction
Used as an initial guess for iterative solutions and a guess for points outside the support bounds...
ossimDrect theImageClipRect
virtual void lineSampleToWorld(const ossimDpt &lineSampPt, ossimGpt &worldPt) const =0
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ loadGeometry()

void ossimSpot5Model::loadGeometry ( FILE *  )
protected

◆ loadState()

bool ossimSpot5Model::loadState ( const ossimKeywordlist kwl,
const char *  prefix = NULL 
)
virtual

Method to the load (recreate) the state of the object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimSensorModel.

Definition at line 499 of file ossimSpot5Model.cpp.

References ossimErrorStatusInterface::getErrorStatus(), ossimSpotDimapSupportData::loadState(), ossimSensorModel::loadState(), loadSupportData(), ossimErrorCodes::OSSIM_OK, theSupportData, and updateModel().

Referenced by setupOptimizer().

501 {
502  ossimString supportPrefix = ossimString(prefix) + "support_data.";
503 
504  if(!theSupportData)
505  {
507  }
508 
509  if(theSupportData->loadState(kwl, supportPrefix))
510  {
511  if(!ossimSensorModel::loadState(kwl, prefix))
512  {
513  return false;
514  }
515  }
516  else
517  {
518  return false;
519  }
520 
521  loadSupportData();
522  updateModel();
523 
525 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static const ossimErrorCode OSSIM_OK
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual void updateModel()
virtual ossimErrorCode getErrorStatus() const

◆ loadSupportData()

void ossimSpot5Model::loadSupportData ( )
protected

Definition at line 335 of file ossimSpot5Model.cpp.

Referenced by initFromMetadata(), loadState(), and ossimSpot5Model().

336 {
337  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSpot5Model::loadSupportData(): entering..." << std::endl;
338 
339  //---
340  // Check for good support data:
341  //---
342  if (!theSupportData)
343  {
344  setErrorStatus();
345  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimSpot5Model::loadSupportData(): Null SpotDimapSupportData pointer passed to"
346  << " constructor! Aborting..." << std::endl;
347  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::loadSupportData(): returning..." << std::endl;
348  return;
349  }
350 
352  {
353  setErrorStatus();
354  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimSpot5Model::loadSupportData(): Bad SpotDimapSupportData detected. Aborting..."
355  << std::endl;
356  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::loadSupportData(): returning..." << std::endl;
357  return;
358  }
359 
360  //---
361  // Initialize some member variables from the support data:
362  //---
366 
367  // Center of frame, sub image if we have one.
369 
372  ossimDpt sz;
374  theImageSize = sz;
377 
380 
381  //---
382  // We make this zero base as the base ossimSensorModel does not know about
383  // any sub image we have.
384  //---
387 
388  ossimGpt p1;
389  ossimGpt p2;
390  ossimGpt p3;
391  ossimGpt p4;
392 
393 
394  // I need to find the nominal scale of the spot 5 dataset
395 
396  //---
397  // Position error is a function of whether star tracker information was
398  // available:
399  //---
401  {
402  thePositionError = 50.0;
403  }
404  else
405  {
406  thePositionError = 200.0; // meters
407  }
408  updateModel();
413 
414 // theSupportData->getUlCorner(p1);
415 // theSupportData->getUrCorner(p2);
416 // theSupportData->getLrCorner(p3);
417 // theSupportData->getLlCorner(p4);
418 
419  ossimDpt v[4]; // temporarily holds vertices for ground polygon
420  v[0] = p1;
421  v[1] = p2;
422  v[2] = p3;
423  v[3] = p4;
425 
426 
427  ossimGpt cgpt, hgpt, vgpt;
428  // ossimEcefPoint hVector, vVector;
430 
431  lineSampleToWorld(midpt, cgpt);
432  lineSampleToWorld(midpt + ossimDpt(1,0), hgpt);
433  lineSampleToWorld(midpt + ossimDpt(0,1), vgpt);
434 
435  theGSD = ossimDpt((ossimEcefPoint(cgpt) - ossimEcefPoint(hgpt)).magnitude(),
436  (ossimEcefPoint(cgpt) - ossimEcefPoint(vgpt)).magnitude());
437 
438  theMeanGSD = (theGSD.x+theGSD.y)/2.0;
439 
440  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::loadSupportData(): returning..." << std::endl;
441 }
ossim_float64 theRefImagingTime
ossimString theSensorID
ossim_float64 thePositionError
static const ossimErrorCode OSSIM_OK
ossimString theImageID
ossim_float64 theIllumElevation
void getImageRect(ossimDrect &rect) const
Zero based image rectangle, sub image if there is one.
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
ossimDpt theSpotSubImageOffset
ossim_float64 theRefImagingTimeLine
relative to full image
ossimFilename theMetaDataFile
void getSunAzimuth(ossim_float64 &az) const
virtual void lineSampleToWorld(const ossimDpt &image_point, ossimGpt &world_point) const
void getRefImagePoint(ossimDpt &rp) const
zero base center point
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
void getImageSize(ossimDpt &sz) const
ossim_float64 theIllumAzimuth
ossim_float64 theLineSamplingPeriod
void getSunElevation(ossim_float64 &el) const
ossimPolygon theBoundGndPolygon
void getRefLineTimeLine(ossim_float64 &rtl) const
relative to full frame.
void getRefGroundPoint(ossimGpt &gp) const
Center of frame, sub image if there is one.
void getLineSamplingPeriod(ossim_float64 &pe) const
ossimDrect theImageClipRect
virtual void updateModel()
virtual ossimErrorCode getErrorStatus() const
ossimDpt midPoint() const
Definition: ossimDrect.h:817
const ossimDpt & ur() const
Definition: ossimDrect.h:340
double x
Definition: ossimDpt.h:164
const ossimDpt & ll() const
Definition: ossimDrect.h:342
const ossimDpt & lr() const
Definition: ossimDrect.h:341
void getSubImageOffset(ossimDpt &offset) const
void getRefLineTime(ossim_float64 &rt) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_float64 theMeanGSD

◆ print()

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

Extends base-class implementation. Dumps contents of object to ostream.

Reimplemented from ossimSensorModel.

Definition at line 448 of file ossimSpot5Model.cpp.

References ossimSensorModel::print(), theFocalLenOffset, theIllumAzimuth, theIllumElevation, ossimSensorModel::theImageID, ossimSensorModel::theImageSize, theLineSamplingPeriod, theMetaDataFile, thePitchOffset, thePitchRate, thePositionError, ossimSensorModel::theRefGndPt, theRefImagingTime, theRefImagingTimeLine, ossimSensorModel::theRefImgPt, theRollOffset, theRollRate, theYawOffset, and theYawRate.

449 {
450  // Capture stream flags since we are going to mess with them.
451  std::ios_base::fmtflags f = out.flags();
452 
453  out << "\nDump of ossimSpot5Model at address " << (hex) << this
454  << (dec)
455  << "\n------------------------------------------------"
456  << "\n theImageID = " << theImageID
457  << "\n theMetadataFile = " << theMetaDataFile
458  << "\n theIllumAzimuth = " << theIllumAzimuth
459  << "\n theIllumElevation = " << theIllumElevation
460  << "\n thePositionError = " << thePositionError
461  << "\n theImageSize = " << theImageSize
462  << "\n theRefGndPt = " << theRefGndPt
463  << "\n theRefImgPt = " << theRefImgPt
464  << "\n theRefImagingTime = " << theRefImagingTime
465  << "\n theRefImagingTimeLine = " << theRefImagingTimeLine
466  << "\n theLineSamplingPeriod = " << theLineSamplingPeriod
467  << "\n theRollOffset = " << theRollOffset
468  << "\n thePitchOffset = " << thePitchOffset
469  << "\n theYawOffset = " << theYawOffset
470  << "\n theRollRate = " << theRollRate
471  << "\n thePitchRate = " << thePitchRate
472  << "\n theYawRate = " << theYawRate
473  << "\n theFocalLenOffset = " << theFocalLenOffset
474  << "\n------------------------------------------------"
475  << "\n " << endl;
476 
477  // Set the flags back.
478  out.flags(f);
479 
480  return ossimSensorModel::print(out);
481 }
ossim_float64 theRefImagingTime
ossim_float64 theYawOffset
ossim_float64 thePositionError
ossimString theImageID
ossim_float64 theIllumElevation
ossim_float64 theRefImagingTimeLine
relative to full image
ossimFilename theMetaDataFile
ossim_float64 theRollRate
ossim_float64 theFocalLenOffset
ossim_float64 theIllumAzimuth
ossim_float64 theRollOffset
ossim_float64 theYawRate
ossim_float64 theLineSamplingPeriod
ossim_float64 thePitchOffset
virtual std::ostream & print(std::ostream &out) const
ossim_float64 thePitchRate

◆ saveState()

bool ossimSpot5Model::saveState ( ossimKeywordlist kwl,
const char *  prefix = NULL 
) const
virtual

Fulfills ossimObject base-class pure virtuals. Loads and saves geometry KWL files. Returns true if successful.

Reimplemented from ossimSensorModel.

Definition at line 483 of file ossimSpot5Model.cpp.

References ossimSpotDimapSupportData::saveState(), ossimSensorModel::saveState(), theSupportData, and ossimRefPtr< T >::valid().

485 {
486  if(theSupportData.valid())
487  {
488  ossimString supportPrefix = ossimString(prefix) + "support_data.";
489  theSupportData->saveState(kwl, supportPrefix);
490  }
491  else
492  {
493  return false;
494  }
495 
496  return ossimSensorModel::saveState(kwl, prefix);
497 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimSpotDimapSupportData > theSupportData
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const

◆ setupOptimizer()

bool ossimSpot5Model::setupOptimizer ( const ossimString init_file)
virtual

image to ground faster

Reimplemented from ossimOptimizableProjection.

Definition at line 700 of file ossimSpot5Model.cpp.

References ossimKeywordlist::addFile(), ossimString::c_str(), ossimFilename::dirCat(), ossimFilename::exists(), ossimRefPtr< T >::get(), ossimErrorStatusInterface::getErrorStatus(), initFromMetadata(), loadState(), ossimSpotDimapSupportData::loadXmlFile(), ossimFilename::path(), and ossimFilename::setExtension().

701 {
702  ossimFilename spot5Test = init_file;
703  ossimFilename geomFile = init_file;
704  geomFile = geomFile.setExtension("geom");
705  bool tryKwl = false;
706 
707  if(!spot5Test.exists())
708  {
709  spot5Test = geomFile.path();
710  spot5Test = spot5Test.dirCat(ossimFilename("METADATA.DIM"));
711  if(spot5Test.exists() == false)
712  {
713  spot5Test = geomFile.path();
714  spot5Test = spot5Test.dirCat(ossimFilename("metadata.dim"));
715  }
716  }
717  if(spot5Test.exists())
718  {
720  if(meta->loadXmlFile(spot5Test))
721  {
722  initFromMetadata(meta.get());
723  if (getErrorStatus())
724  {
725  tryKwl = true;
726  meta=0;
727  }
728  else
729  {
730  return true;
731  }
732  }
733  else
734  {
735  meta=0;
736  tryKwl = true;
737  }
738  }
739  if(tryKwl)
740  {
741  ossimKeywordlist kwl;
742  if(kwl.addFile(init_file.c_str()))
743  {
744  return loadState(kwl);
745  }
746  }
747  return false;
748 }
bool loadXmlFile(const ossimFilename &file, bool processSwir=false)
Represents serializable keyword/value map.
bool addFile(const char *file)
bool initFromMetadata(ossimSpotDimapSupportData *sd)
uses file path to init model
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
bool exists() const
virtual ossimErrorCode getErrorStatus() const
ossimFilename dirCat(const ossimFilename &file) 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
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
ossimFilename path() const

◆ updateModel()

void ossimSpot5Model::updateModel ( )
virtual

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 259 of file ossimSpot5Model.cpp.

References ossimErrorStatusInterface::clearErrorStatus().

Referenced by loadState(), and ossimSpot5Model().

260 {
262 
263  try
264  {
265  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::updateModel(): entering..." << std::endl;
266 
268  {
269  theRollOffset = 0;
270  thePitchOffset = 0;
271  theYawOffset = 0;
272  theRollRate = 0;
273  thePitchRate = 0;
274  theYawRate = 0;
275  theFocalLenOffset = 0;
276  }
277  else
278  {
286  }
287  theSeedFunction = 0;
288  ossimGpt ulg, urg, lrg, llg;
297  ulg,
298  urg,
299  lrg,
300  llg);
301 
302  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::updateModel(): returning..." << std::endl;
303  }
304  catch(...)
305  {
307  }
308 }
ossim_float64 theYawOffset
const ossimDpt & ul() const
Definition: ossimDrect.h:339
ossim_float64 theRollRate
static const ossimErrorCode OSSIM_ERROR
virtual void lineSampleToWorld(const ossimDpt &image_point, ossimGpt &world_point) const
ossim_float64 theFocalLenOffset
ossim_float64 theRollOffset
ossim_float64 theYawRate
ossim_float64 thePitchOffset
ossimRefPtr< ossimProjection > theSeedFunction
Used as an initial guess for iterative solutions and a guess for points outside the support bounds...
ossim_float64 thePitchRate
ossimDrect theImageClipRect
const ossimDpt & ur() const
Definition: ossimDrect.h:340
const ossimDpt & ll() const
Definition: ossimDrect.h:342
const ossimDpt & lr() const
Definition: ossimDrect.h:341
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ useForward()

virtual bool ossimSpot5Model::useForward ( ) const
inlinevirtual

ossimOptimizableProjection

Implements ossimOptimizableProjection.

Definition at line 108 of file ossimSpot5Model.h.

108 {return false;}

◆ writeGeomTemplate()

static void ossimSpot5Model::writeGeomTemplate ( ostream &  os)
static

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

Member Data Documentation

◆ theFocalLenOffset

ossim_float64 ossimSpot5Model::theFocalLenOffset
protected

Definition at line 156 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ theIllumAzimuth

ossim_float64 ossimSpot5Model::theIllumAzimuth
protected

Definition at line 134 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ theIllumElevation

ossim_float64 ossimSpot5Model::theIllumElevation
protected

Definition at line 135 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ theLineSamplingPeriod

ossim_float64 ossimSpot5Model::theLineSamplingPeriod
protected

Definition at line 142 of file ossimSpot5Model.h.

Referenced by imagingRay(), initFromMetadata(), and print().

◆ theMetaDataFile

ossimFilename ossimSpot5Model::theMetaDataFile
protected

Definition at line 133 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ thePitchOffset

ossim_float64 ossimSpot5Model::thePitchOffset
protected

Definition at line 151 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ thePitchRate

ossim_float64 ossimSpot5Model::thePitchRate
protected

Definition at line 154 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ thePositionError

ossim_float64 ossimSpot5Model::thePositionError
protected

Definition at line 136 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ theRefImagingTime

ossim_float64 ossimSpot5Model::theRefImagingTime
protected

Definition at line 137 of file ossimSpot5Model.h.

Referenced by imagingRay(), initFromMetadata(), and print().

◆ theRefImagingTimeLine

ossim_float64 ossimSpot5Model::theRefImagingTimeLine
protected

relative to full image

Definition at line 140 of file ossimSpot5Model.h.

Referenced by imagingRay(), and print().

◆ theRollOffset

ossim_float64 ossimSpot5Model::theRollOffset
protected

Definition at line 150 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ theRollRate

ossim_float64 ossimSpot5Model::theRollRate
protected

Definition at line 153 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ theSpotSubImageOffset

ossimDpt ossimSpot5Model::theSpotSubImageOffset
protected

Definition at line 143 of file ossimSpot5Model.h.

Referenced by imagingRay().

◆ theSupportData

ossimRefPtr<ossimSpotDimapSupportData> ossimSpot5Model::theSupportData
protected

Definition at line 128 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), loadState(), ossimSpot5Model(), and saveState().

◆ theYawOffset

ossim_float64 ossimSpot5Model::theYawOffset
protected

Definition at line 152 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().

◆ theYawRate

ossim_float64 ossimSpot5Model::theYawRate
protected

Definition at line 155 of file ossimSpot5Model.h.

Referenced by initFromMetadata(), and print().


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