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

#include <ossimLandSatModel.h>

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

Public Types

enum  ProjectionType {
  UNKNOWN_PROJECTION = 0, UTM_MAP, UTM_ORBIT, SOM_MAP,
  SOM_ORBIT
}
 
enum  AdjustParamIndex {
  INTRACK_OFFSET = 0, CRTRACK_OFFSET, LINE_GSD_CORR, SAMP_GSD_CORR,
  ROLL_OFFSET, YAW_OFFSET, YAW_RATE, MAP_ROTATION,
  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

 ossimLandSatModel ()
 
 ossimLandSatModel (const ossimFfL7 &head)
 
 ossimLandSatModel (const ossimFilename &init_file)
 
 ossimLandSatModel (const ossimKeywordlist &geom_kwl)
 
 ossimLandSatModel (const ossimLandSatModel &rhs)
 
virtual ossimObjectdup () const
 
virtual std::ostream & print (std::ostream &out) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const double &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...
 
- 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

virtual ~ossimLandSatModel ()
 uses file path to init model More...
 
void initFromHeader (const ossimFfL7 &head)
 
virtual void initAdjustableParameters ()
 
void initMapProjection ()
 
- 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

double theIllumAzimuth
 
double theIllumElevation
 
double theOrbitAltitude
 
double theOrbitInclination
 
int theMapZone
 
ossimDpt theMapOffset
 
int theWrsPathNumber
 
int theWrsRowNumber
 
double theMeridianalAngle
 
double thePositionError
 
ProjectionType theProjectionType
 
ossimRefPtr< ossimMapProjectiontheMapProjection
 
double theMapAzimAngle
 
double theMapAzimCos
 
double theMapAzimSin
 
double theMap2IcRotAngle
 
double theMap2IcRotCos
 
double theMap2IcRotSin
 
double theIntrackOffset
 
double theCrtrackOffset
 
double theLineGsdCorr
 
double theSampGsdCorr
 
double theRollOffset
 
double theYawOffset
 
double theYawRate
 
double theMapRotation
 
NEWMAT::Matrix theRollRotMat
 
- 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 39 of file ossimLandSatModel.h.

Member Enumeration Documentation

◆ AdjustParamIndex

◆ ProjectionType

Enumerator
UNKNOWN_PROJECTION 
UTM_MAP 
UTM_ORBIT 
SOM_MAP 
SOM_ORBIT 

Definition at line 52 of file ossimLandSatModel.h.

Constructor & Destructor Documentation

◆ ossimLandSatModel() [1/5]

ossimLandSatModel::ossimLandSatModel ( )

CONSTRUCTORS:

Definition at line 104 of file ossimLandSatModel.cpp.

Referenced by dup().

105  :
107  theIntrackOffset (0.0),
108  theCrtrackOffset (0.0),
109  theLineGsdCorr (0.0),
110  theSampGsdCorr (0.0),
111  theRollOffset (0.0),
112  theYawOffset (0.0),
113  theYawRate (0.0),
114  theMapRotation (0.0)
115 
116 {
117  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel: entering..." << std::endl;
118 
120 
121  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel: returning..." << std::endl;
122 }
virtual void initAdjustableParameters()
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimLandSatModel() [2/5]

ossimLandSatModel::ossimLandSatModel ( const ossimFfL7 head)

Definition at line 128 of file ossimLandSatModel.cpp.

129  :
131  theIntrackOffset (0.0),
132  theCrtrackOffset (0.0),
133  theLineGsdCorr (0.0),
134  theSampGsdCorr (0.0),
135  theRollOffset (0.0),
136  theYawOffset (0.0),
137  theYawRate (0.0),
138  theMapRotation (0.0)
139 {
140  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(head): entering..." << std::endl;
141 
142  initFromHeader(head);
143 
144  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(head): Exited..." << std::endl;
145 }
void initFromHeader(const ossimFfL7 &head)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimLandSatModel() [3/5]

ossimLandSatModel::ossimLandSatModel ( const ossimFilename init_file)

Definition at line 155 of file ossimLandSatModel.cpp.

157 {
158  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(init_file): entering..." << std::endl;
159 
160  setupOptimizer(init_file);
161 
162  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(init_file): Exited..." << std::endl;
163 }
virtual bool setupOptimizer(const ossimString &init_file)
image to ground faster
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimLandSatModel() [4/5]

ossimLandSatModel::ossimLandSatModel ( const ossimKeywordlist geom_kwl)

Definition at line 173 of file ossimLandSatModel.cpp.

174  :
176  theIntrackOffset (0.0),
177  theCrtrackOffset (0.0),
178  theLineGsdCorr (0.0),
179  theSampGsdCorr (0.0),
180  theRollOffset (0.0),
181  theYawOffset (0.0),
182  theYawRate (0.0),
183  theMapRotation (0.0)
184 {
185  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(geom_kwl): entering..." << std::endl;
186 
188 
189  //***
190  // Parse keywordlist for geometry:
191  //***
192  loadState(geom_kwl);
193 
194  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(geom_kwl): Exited..." << std::endl;
195 }
virtual void initAdjustableParameters()
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimLandSatModel() [5/5]

ossimLandSatModel::ossimLandSatModel ( const ossimLandSatModel rhs)

Definition at line 200 of file ossimLandSatModel.cpp.

201  :
202  ossimSensorModel (rhs),
207  theMapZone (rhs.theMapZone),
216  (ossimMapProjection*)0),
229  theYawRate (rhs.theYawRate),
232 {
233  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(rhs): entering..." << std::endl;
234 
236 
237  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(rhs): returning..." << std::endl;
238 }
virtual void initAdjustableParameters()
virtual ossimObject * dup() const =0
bool valid() const
Definition: ossimRefPtr.h:75
NEWMAT::Matrix theRollRotMat
ProjectionType theProjectionType
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimRefPtr< ossimMapProjection > theMapProjection

◆ ~ossimLandSatModel()

ossimLandSatModel::~ossimLandSatModel ( )
protectedvirtual

uses file path to init model

Definition at line 247 of file ossimLandSatModel.cpp.

248 {
249  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::~ossimLandSatModel: entering..." << std::endl;
250 
251  theMapProjection = 0;
252 
253  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::~ossimLandSatModel: returning..." << std::endl;
254 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimRefPtr< ossimMapProjection > theMapProjection

Member Function Documentation

◆ dup()

ossimObject * ossimLandSatModel::dup ( ) const
virtual

Implements ossimProjection.

Definition at line 239 of file ossimLandSatModel.cpp.

References ossimLandSatModel().

240 {
241  return new ossimLandSatModel(*this);
242 }

◆ imagingRay()

void ossimLandSatModel::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 459 of file ossimLandSatModel.cpp.

461 {
462 #if 0
463  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimLandSatModel::imagingRay: entering..." << std::endl;
464 
465  bool debug_flag = false; // setable by interactive debugger
466  if (traceDebug() || debug_flag)
467  {
468  ossimNotify(ossimNotifyLevel_DEBUG) << "inImgPt = " << inImgPt << std::endl;
469  }
470 #endif
471 
472  //***
473  // Get ground point for given map image point:
474  //***
475  ossimDpt rot_img_pt(-inImgPt.line*theMapAzimSin+inImgPt.samp*theMapAzimCos,
476  inImgPt.line*theMapAzimCos+inImgPt.samp*theMapAzimSin);
477  ossimDpt map_point
478  (theMapOffset.x + rot_img_pt.samp*(theGSD.samp+theSampGsdCorr),
479  theMapOffset.y - rot_img_pt.line*(theGSD.line+theLineGsdCorr));
480 
481  ossimGpt inGndPt (theMapProjection->inverse(map_point));
482 
483 #if 0
484  if (traceDebug() || debug_flag)
485  {
486  ossimNotify(ossimNotifyLevel_DEBUG) << "\t theMapOffset="<<theMapOffset<<endl;
487  ossimNotify(ossimNotifyLevel_DEBUG) << "\t rot_img_pt="<<rot_img_pt<<endl;
488  ossimNotify(ossimNotifyLevel_DEBUG) << "\t image point map_point="<<map_point<<endl;
489  ossimNotify(ossimNotifyLevel_DEBUG) << "\t inGndPt="<<inGndPt<<endl;
490  }
491 #endif
492  //***
493  // Rotate the image map coordinates by the map-to-IC rotation
494  // to arrive at intrack/crosstrack coordinate:
495  //***
496  ossimDpt offInMapPt (inImgPt - theRefImgPt);
497  ossimDpt icInPt
498  (offInMapPt.line*theMap2IcRotSin + offInMapPt.samp*theMap2IcRotCos,
499  offInMapPt.line*theMap2IcRotCos - offInMapPt.samp*theMap2IcRotSin);
500 
501 #if 0
502  if (traceDebug() || debug_flag)
503  {
504  ossimNotify(ossimNotifyLevel_DEBUG) << "\t offInMapPt="<<offInMapPt<<endl;
505  ossimNotify(ossimNotifyLevel_DEBUG) << "\t icInPt="<<icInPt<<endl;
506  }
507 #endif
508 
509  //***
510  // Establish an image map point at vehicle NADIR corresponding to imaging
511  // line:
512  //***
513  ossimDpt icNdrPt (0.0, icInPt.line);
514  ossimDpt offNdrMapPt
515  (-icNdrPt.line*theMap2IcRotSin + icNdrPt.samp*theMap2IcRotCos,
516  icNdrPt.line*theMap2IcRotCos + icNdrPt.samp*theMap2IcRotSin);
517  ossimDpt ndrMapPt(offNdrMapPt + theRefImgPt);
518  ossimDpt rotNdrMapPt
519  (-ndrMapPt.line*theMapAzimSin + ndrMapPt.samp*theMapAzimCos,
520  ndrMapPt.line*theMapAzimCos + ndrMapPt.samp*theMapAzimSin);
521 
522 #if 0
523  if (traceDebug() || debug_flag)
524  {
525  ossimNotify(ossimNotifyLevel_DEBUG) << "\t icNdrPt="<<icNdrPt<<endl;
526  ossimNotify(ossimNotifyLevel_DEBUG) << "\t offNdrMapPt="<<offNdrMapPt<<endl;
527  ossimNotify(ossimNotifyLevel_DEBUG) << "\t ndrMapPt="<<ndrMapPt<<endl;
528  ossimNotify(ossimNotifyLevel_DEBUG) << "\t rotNdrMapPt="<<rotNdrMapPt<<endl;
529  }
530 #endif
531 
532  //***
533  // Establish the vehicle position at time of line imaging:
534  //***
535  map_point.y =theMapOffset.y+rotNdrMapPt.x*(theGSD.x+theSampGsdCorr);
537  map_point.x = theMapOffset.x+rotNdrMapPt.y*(theGSD.y+theLineGsdCorr);
538  else
539  map_point.x = theMapOffset.x-rotNdrMapPt.y*(theGSD.y+theLineGsdCorr);
540 
541  ossimGpt vehiclePlhPos(theMapProjection->inverse(map_point));
542  vehiclePlhPos.hgt = theOrbitAltitude;
543 
544 #if 0
545  if (traceDebug() || debug_flag)
546  {
547  ossimNotify(ossimNotifyLevel_DEBUG) << "\t map_point="<<map_point<<endl;
548  ossimNotify(ossimNotifyLevel_DEBUG) << "\t vehiclePlhPos="<<vehiclePlhPos<<endl;
549  }
550 #endif
551 
552  //***
553  // Establish an LSR space at the vehicle with X along the intrack direction:
554  //***
555  ossimLsrSpace icrSpace (vehiclePlhPos, theMeridianalAngle-90.0);
556 
557 #if 0
558  if (traceDebug() || debug_flag)
559  {
560  ossimNotify(ossimNotifyLevel_DEBUG) << "\t icrSpace="<<icrSpace<<endl;
561  }
562 #endif
563 
564  //***
565  // Now establish a ray pointing to the imaged ground point from the vehicle
566  // in ICR space:
567  //***
568  ossimLsrPoint lsrInPt (inGndPt, icrSpace);
569  ossimLsrPoint vehicleLsrPos (0.0, 0.0, 0.0, icrSpace);
570  ossimLsrRay initLsrImgRay (vehicleLsrPos, lsrInPt);
571 
572 #if 0
573  if (traceDebug() || debug_flag)
574  {
575  ossimNotify(ossimNotifyLevel_DEBUG) << "\t initLsrImgRay="<<initLsrImgRay<<endl;
576  }
577 #endif
578 
579  //***
580  // Establish the attitude rotation matrix considering the attitude biases
581  // and rates:
582  //***
583  double cos, sin;
584  double norm_line = inImgPt.line/theImageSize.line;
585  double yaw = theYawOffset + theYawRate*norm_line;
586  cos = ossim::cosd(yaw);
587  sin = ossim::sind(yaw);
588  NEWMAT::Matrix T_yaw = ossimMatrix3x3::create( cos,-sin, 0.0,
589  sin, cos, 0.0,
590  0.0, 0.0, 1.0);
591  NEWMAT::Matrix attRotMat = T_yaw * theRollRotMat;
592 
593  //***
594  // Now apply the perturbation to the ray due to the adjustable parameters,
595  // and arrive at the ECF adjusted imaging ray:
596  //***
597  ossimLsrVector adjLsrImgRayDir (attRotMat*initLsrImgRay.direction().data(),
598  icrSpace);
599  ossimLsrPoint adjLsrImgRayOrg (theIntrackOffset,
601  0.0, // no radial adjustment of position
602  icrSpace);
603  ossimLsrRay adjLsrImgRay (adjLsrImgRayOrg, adjLsrImgRayDir);
604  image_ray = ossimEcefRay(adjLsrImgRay);
605 
606 #if 0
607  if (traceDebug() || debug_flag)
608  {
609  ossimNotify(ossimNotifyLevel_DEBUG) << "\t adjLsrImgRay="<<adjLsrImgRay<<endl;
610  ossimNotify(ossimNotifyLevel_DEBUG) << "\t image_ray="<<image_ray<<endl;
611  }
612 
613  if (traceExec())
614  {
615  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::imagingRay: Returning..." << std::endl;
616  }
617 #endif
618 }
double samp
Definition: ossimDpt.h:164
double y
Definition: ossimDpt.h:165
ossim_float64 hgt
Height in meters above the ellipsiod.
Definition: ossimGpt.h:274
double sind(double x)
Definition: ossimCommon.h:260
virtual ossimGpt inverse(const ossimDpt &projectedPoint) const =0
Will take a point in meters and convert it to ground.
NEWMAT::Matrix theRollRotMat
double line
Definition: ossimDpt.h:165
static NEWMAT::Matrix create()
double cosd(double x)
Definition: ossimCommon.h:259
ProjectionType theProjectionType
double x
Definition: ossimDpt.h:164
ossim_int32 line
Definition: ossimIpt.h:142
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimRefPtr< ossimMapProjection > theMapProjection

◆ initAdjustableParameters()

void ossimLandSatModel::initAdjustableParameters ( )
protectedvirtual

Reimplemented from ossimAdjustableParameterInterface.

Definition at line 1107 of file ossimLandSatModel.cpp.

1108 {
1109  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initAdjustableParameters: entering..." << std::endl;
1110 
1111  //
1112  // Allocate storage for adjustables and assign their names and units strings
1113  //
1115  int numParams = getNumberOfAdjustableParameters();
1116  //***
1117  // Initialize base-class adjustable parameter array:
1118  //***
1119  for (int i=0; i<numParams; i++)
1120  {
1121  setAdjustableParameter(i, 0.0);
1122  setParameterDescription(i, PARAM_NAMES[i]);
1123  setParameterUnit(i,PARAM_UNITS[i]);
1124  }
1125  //***
1126  // Initialize base-class parameter sigma array:
1127  //***
1128  setParameterSigma(INTRACK_OFFSET, 500.0); //change for Landsat 5
1129  setParameterSigma(CRTRACK_OFFSET, 500.0); //change for Landsat 5
1133  setParameterSigma(YAW_OFFSET, 0.01);
1134  setParameterSigma(YAW_RATE, 0.05);
1136  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initAdjustableParameters: returning..." << std::endl;
1137 }
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)

◆ initFromHeader()

void ossimLandSatModel::initFromHeader ( const ossimFfL7 head)
protected

Initializes the model given a fast format header.

Definition at line 260 of file ossimLandSatModel.cpp.

261 {
262  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initFromHeader: entering..." << std::endl;
263 
264  //***
265  // Initialize base-class data members:
266  //***
267  theRefGndPt = head.theCenterGP;
273  theGSD.samp = head.theGsd;
274  theGSD.line = head.theGsd;
277  theMapZone = head.theUsgsMapZone;
281  theMeanGSD = head.theGsd;
282 
283  //satellite orbit and accuracy
284  ossimString satname(head.theSatName);
285  if (satname.contains("7"))
286  {
287  theOrbitAltitude = L7_ORBIT_ALTITUDE;
288  theOrbitInclination = L7_ORBIT_INCLINATION;
289  theNominalPosError = L7_NOMINAL_POS_ERROR;
290  } else if (satname.contains("5"))
291  {
292  theOrbitAltitude = L5_ORBIT_ALTITUDE;
293  theOrbitInclination = L5_ORBIT_INCLINATION;
294  theNominalPosError = L5_NOMINAL_POS_ERROR;
295  } else {
296  theErrorStatus = 1; //MODEL_ERROR
297  if(traceDebug())
298  {
299  ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimLandSatModel::initFromHeader: " << "Unknown satellite name : " << satname << std::endl;
300  }
301  }
302 
303 
304  //***
305  // Assign the meridianal angle. The Meridianal angle is
306  // the angle between true north and the vehicles ground track. The
307  // orientation angle is the rotation of the raster image from north (this
308  // will be 0 for map-oriented imagery).
309  //
310  // Compute meridianal angle between the along-track direction
311  // and the meridian going through the scene center excluding earth rotation
312  // effects. The spherical triangle equation is Napier's rule for right-angle
313  // spherical triangles. This angle is a negative number from -8.2 to -90
314  // depending on scene latitude:
315  //***
316  double phi_c = ossim::atand(ossim::tand(theRefGndPt.lat)/
317  GEODETIC_2_GEOCENTRIC_FACTOR);
318  double cos_phi_c = ossim::cosd(phi_c);
321 
322  //***
323  // Fetch the corner points from the header:
324  //***
325  ossimDpt v[4]; // temporarily holds vertices for ground polygon
326  v[0] = head.theUL_Corner;
327  v[1] = head.theUR_Corner;
328  v[2] = head.theLR_Corner;
329  v[3] = head.theLL_Corner;
331 
332  //***
333  // Initialize map projection parameters:
334  // Determine the projection/orientation type:
335  //***
336  ossimString orient_type = head.theProductType;
337  ossimString proj_type = head.theMapProjectionName;
338  if (proj_type.contains("SOM"))
339  {
340  //***
341  // Inverse the line direction GSD for SOM, since projection "intrack"
342  // axis (x) is descending:
343  //***
344  if (orient_type.contains("ORBIT"))
346  else
348 
349  // this is a hack. After testing two it is consistently off
350  // by 90 degrees.
351  //
352  theMapAzimAngle -= 90.0;
353  }
354  else if (proj_type.contains("UTM"))
355  {
356  if (orient_type.contains("ORBIT"))
358  else
360  }
361  else
362  {
363  theErrorStatus = 1; //MODEL_ERROR
364  if(traceDebug())
365  {
366  ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimLandSatModel::initFromHeader: "
367  << "Unknown projection/orientation type." << std::endl;
368  }
369  return;
370  }
371 
372  //***
373  // Establish the map projection:
374  //***
376 
377 
379  if (traceDebug())
380  {
382  << "DEBUG ossimLandSatModel::initFromHeader:"
383  << "\ntheMapProjection:\n";
384 
386 
388  << "\nHeader upper left ground point: " << head.theUL_Corner
389  << std::endl;
390  }
391 
392  //***
393  // initialize remaining data members:
394  //***
396  updateModel();
397 
398  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initFromHeader: returning..." << std::endl;
399 }
virtual void initAdjustableParameters()
double asind(double x)
Definition: ossimCommon.h:265
ossimGpt theUL_Corner
Definition: ossimFfL7.h:167
int theRowNumber
Definition: ossimFfL7.h:137
virtual void updateModel()
double theSunAzimuth
Definition: ossimFfL7.h:178
ossimGpt theUR_Corner
Definition: ossimFfL7.h:168
ossimString theImageID
double samp
Definition: ossimDpt.h:164
char theProductType[19]
Definition: ossimFfL7.h:143
bool contains(char aChar) const
Definition: ossimString.h:58
ossimIpt theCenterImagePoint
Definition: ossimFfL7.h:173
int theLinesPerBand
Definition: ossimFfL7.h:148
char theSatName[11]
Definition: ossimFfL7.h:139
double theSunElevation
Definition: ossimFfL7.h:177
double tand(double x)
Definition: ossimCommon.h:261
char theMapProjectionName[5]
Definition: ossimFfL7.h:161
double line
Definition: ossimDpt.h:165
ossimGpt theLR_Corner
Definition: ossimFfL7.h:169
ossim_float64 theNominalPosError
ossimPolygon theBoundGndPolygon
double cosd(double x)
Definition: ossimCommon.h:259
ossimGpt theCenterGP
Definition: ossimFfL7.h:171
ossimGpt theLL_Corner
Definition: ossimFfL7.h:170
virtual ossimDpt forward(const ossimGpt &worldPoint) const =0
All map projections will convert the world coordinate to an easting northing (Meters).
int theUsgsMapZone
Definition: ossimFfL7.h:165
int thePathNumber
Definition: ossimFfL7.h:136
ossimDrect theImageClipRect
ossim_int32 y
Definition: ossimIpt.h:142
double atand(double x)
Definition: ossimCommon.h:266
ProjectionType theProjectionType
double theOffNadirAngle
Definition: ossimFfL7.h:142
ossim_int32 x
Definition: ossimIpt.h:141
double theGsd
Definition: ossimFfL7.h:150
ossim_float64 lat
Definition: ossimGpt.h:265
int thePixelsPerLine
Definition: ossimFfL7.h:147
virtual std::ostream & print(std::ostream &out) const
Prints data members to stream.
char theRequestNumber[21]
Definition: ossimFfL7.h:134
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_float64 theMeanGSD
ossimRefPtr< ossimMapProjection > theMapProjection
double theOrientationAngle
Definition: ossimFfL7.h:176

◆ initMapProjection()

void ossimLandSatModel::initMapProjection ( )
protected

Definition at line 1012 of file ossimLandSatModel.cpp.

1013 {
1014  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::writeGeomTemplate: entering... " << std::endl;
1015 
1016  theMapProjection = 0;
1017  //***
1018  // Instantiate the proper map projection:
1019  //***
1021  {
1024  (double)theWrsPathNumber);
1025  }
1026  else
1027  {
1029  theMapProjection = utm;
1030  if(theRefGndPt.latd() < 0.0)
1031  {
1032  utm->setHemisphere('S');
1033  }
1034  else
1035  {
1036  utm->setHemisphere('N');
1037  }
1038  }
1039 
1040  //***
1041  // Initialize angle sines/cosines used in phiLambda projection:
1042  //***
1046 
1047  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::writeGeomTemplate: returning... " << std::endl;
1048  return;
1049 }
double sind(double x)
Definition: ossimCommon.h:260
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
double cosd(double x)
Definition: ossimCommon.h:259
ProjectionType theProjectionType
void setHemisphere(const ossimGpt &ground)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimRefPtr< ossimMapProjection > theMapProjection

◆ lineSampleHeightToWorld()

void ossimLandSatModel::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 409 of file ossimLandSatModel.cpp.

412 {
413  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::lineSampleHeightToWorld: entering..." << std::endl;
414 
415 #if 0
416  //***
417  // Extrapolate if point is outside image:
418  //***
419  if (!insideImage(image_point))
420  {
421  gpt = extrapolate(image_point, height);
422  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::lineSampleHeightToWorld: returning..." << std::endl;
423  return;
424  }
425 #endif
426 
427  //***
428  // First establish imaging ray from image point:
429  //***
430  ossimEcefRay imaging_ray;
431  imagingRay(image_point, imaging_ray);
432  ossimEcefPoint Pecf (imaging_ray.intersectAboveEarthEllipsoid(height));
433  gpt = ossimGpt(Pecf);
434 }
ossimEcefPoint intersectAboveEarthEllipsoid(const double &heightAboveEllipsoid, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84()) const
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const
virtual ossimDpt extrapolate(const ossimGpt &gp) const
virtual bool insideImage(const ossimDpt &p) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ loadState()

bool ossimLandSatModel::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
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 718 of file ossimLandSatModel.cpp.

720 {
721  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::loadState: entering..." << std::endl;
722 
723  if (traceDebug())
724  {
725  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::loadState:"
726  << "\nInput kwl: " << kwl
727  << std::endl;
728  }
729 
730  const char* value = NULL;
731  const char* keyword =NULL;
732  bool success;
733 
734  //***
735  // Assure this keywordlist contains correct type info:
736  //***
737  value = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
738  if (!value || (strcmp(value, TYPE_NAME(this))))
739  {
740  theErrorStatus = 1;
741  return false;
742  }
743 
744  //
745  // Clear out any existing adjustable params:
746  //
748  {
750  }
751 
752  //***
753  // Pass on to the base-class for parsing first:
754  //***
755  success = ossimSensorModel::loadState(kwl, prefix);
756  if (!success)
757  {
758  theErrorStatus++;
759  return false;
760  }
761 
762  keyword = PROJECTION_TYPE_KW;
763  value = kwl.find(prefix, keyword);
764  if (!value)
765  {
766  theErrorStatus++;
767  return false;
768  }
769 
770  theProjectionType = (ProjectionType) atoi(value);
771 
772  keyword = MAP_ZONE_KW;
773  value = kwl.find(prefix, keyword);
774  if (!value)
775  {
776  theErrorStatus++;
777  return false;
778  }
779  theMapZone = atoi(value);
780 
781  keyword = MAP_OFFSET_X_KW;
782  value = kwl.find(prefix, keyword);
783  if (!value)
784  {
785  theErrorStatus++;
786  return false;
787  }
788  theMapOffset.x = atof(value);
789 
790  keyword = MAP_OFFSET_Y_KW;
791  value = kwl.find(prefix, keyword);
792  if (!value)
793  {
794  theErrorStatus++;
795  return false;
796  }
797  theMapOffset.y = atof(value);
798 
799  keyword = WRS_PATH_NUMBER_KW;
800  value = kwl.find(prefix, keyword);
801  if (!value)
802  {
803  theErrorStatus++;
804  return false;
805  }
806  theWrsPathNumber = atoi(value);
807 
808  keyword = ROW_NUMBER_KW;
809  value = kwl.find(prefix, keyword);
810  if (!value)
811  {
812  theErrorStatus++;
813  return false;
814  }
815  theWrsRowNumber = atoi(value);
816 
817  keyword = ILLUM_AZIMUTH_KW;
818  value = kwl.find(prefix, keyword);
819  if (!value)
820  {
821  theErrorStatus++;
822  return false;
823  }
824  theIllumAzimuth = atof(value);
825 
826  keyword = ILLUM_ELEVATION_KW;
827  value = kwl.find(prefix, keyword);
828  if (!value)
829  {
830  theErrorStatus++;
831  return false;
832  }
833  theIllumElevation = atof(value);
834 
835  keyword = MERIDIANAL_ANGLE_KW;
836  value = kwl.find(prefix, keyword);
837  if (!value)
838  {
839  theErrorStatus++;
840  return false;
841  }
842  theMeridianalAngle = atof(value);
843 
844  keyword = ORBIT_ALTITUDE_KW;
845  value = kwl.find(prefix, keyword);
846  if (!value)
847  {
848  theErrorStatus++;
849  return false;
850  }
851  theOrbitAltitude = atof(value);
852 
853  keyword = ORBIT_INCLINATION_KW;
854  value = kwl.find(prefix, keyword);
855  if (!value)
856  {
857  theErrorStatus++;
858  return false;
859  }
860  theOrbitInclination = atof(value);
861 
862  keyword = MAP_AZIM_ANGLE_KW;
863  value = kwl.find(prefix, keyword);
864  if (!value)
865  {
866  theErrorStatus++;
867  return false;
868  }
869  theMapAzimAngle = atof(value);
870 
871  keyword = MAP_2Ic_ROT_ANGLE_KW;
872  value = kwl.find(prefix, keyword);
873  if (!value)
874  {
875  theErrorStatus++;
876  return false;
877  }
878  theMap2IcRotAngle = atof(value);
879 
880  theIntrackOffset = 0.0;
881  theCrtrackOffset = 0.0;
882  theLineGsdCorr = 0.0;
883  theSampGsdCorr = 0.0;
884  theRollOffset = 0.0;
885  theYawOffset = 0.0;
886  theYawRate = 0.0;
887  theMapRotation = 0.0;
888 
889  //***
890  // Adjustable parameters are optional keywords:
891  //***
892 // keyword = INTRACK_OFFSET_KW;
893 // value = kwl.find(prefix, keyword);
894 // if(value)
895 // theIntrackOffset = ossimString(value).toDouble();
896 // else
897 // theIntrackOffset = 0.0;
898 
899 // keyword = CRTRACK_OFFSET_KW;
900 // value = kwl.find(prefix, keyword);
901 // if(value)
902 // theCrtrackOffset = ossimString(value).toDouble();
903 // else
904 // theCrtrackOffset = 0.0;
905 
906 // keyword = LINE_GSD_CORR_KW;
907 // value = kwl.find(prefix, keyword);
908 // if(value)
909 // theLineGsdCorr = ossimString(value).toDouble();
910 // else
911 // theLineGsdCorr = 0.0;
912 
913 // keyword = SAMP_GSD_CORR_KW;
914 // value = kwl.find(prefix, keyword);
915 // if(value)
916 // theSampGsdCorr = ossimString(value).toDouble();
917 // else
918 // theSampGsdCorr = 0.0;
919 
920 // keyword = ROLL_OFFSET_KW;
921 // value = kwl.find(prefix, keyword);
922 // if(value)
923 // theRollOffset = ossimString(value).toDouble();
924 // else
925 // theRollOffset = 0.0;
926 
927 // keyword = YAW_OFFSET_KW;
928 // value = kwl.find(prefix, keyword);
929 // if(value)
930 // theYawOffset = ossimString(value).toDouble();
931 // else
932 // theYawOffset = 0.0;
933 
934 // keyword = YAW_RATE_KW;
935 // value = kwl.find(prefix, keyword);
936 // if(value)
937 // theYawRate = ossimString(value).toDouble();
938 // else
939 // theYawRate = 0.0;
940 
941 // keyword = MAP_ROTATION_KW;
942 // value = kwl.find(prefix, keyword);
943 // if(value)
944 // theMapRotation = ossimString(value).toDouble();
945 // else
946 // theMapRotation = 0.0;
947 
948  //***
949  // Initialize given parameters read:
950  //***
952  updateModel();
953 
954  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::loadState: returning..." << std::endl;
955  return true;
956 }
virtual void initAdjustableParameters()
#define TYPE_NAME(p)
Definition: ossimRtti.h:326
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual void updateModel()
const char * find(const char *key) const
double y
Definition: ossimDpt.h:165
static const char * TYPE_KW
ProjectionType theProjectionType
double x
Definition: ossimDpt.h:164
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ print()

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

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

Reimplemented from ossimSensorModel.

Definition at line 626 of file ossimLandSatModel.cpp.

References ossimString::chars(), ossimDpt::line, ossimDpt::samp, ossimSensorModel::theGSD, ossimSensorModel::theImageID, ossimSensorModel::theImageSize, ossimSensorModel::theRefGndPt, and ossimSensorModel::theRefImgPt.

627 {
628  os << "\nDump of ossimLandSatModel object at "
629  << hex << this << ":\n"
630  << "\nLandSatModel -- Dump of all data members: "
631  << "\n theImageID: " << theImageID.chars()
632  << "\n theImageSize: " << theImageSize
633  << "\n theRefImgPt: " << theRefImgPt
634  << "\n theRefGndPt: " << theRefGndPt
635  << "\n theGSD.line: " << theGSD.line
636  << "\n theGSD.samp: " << theGSD.samp
637  << "\n theProjectionType: " << PROJ_TYPE[theProjectionType]
638  << "\n theMapZone: " << theMapZone
639  << "\n theMapOffset: " << theMapOffset
640  << "\n theWrsPathNumber: " << theWrsPathNumber
641  << "\n theWrsRowNumber: " << theWrsRowNumber
642  << "\n theIllumAzimuth: " << theIllumAzimuth
643  << "\n theIllumElevation: " << theIllumElevation
644  << "\n thePositionError: " << thePositionError
645  << "\n theMeridianalAngle: " << theMeridianalAngle
646  << "\n theOrbitAltitude: " << theOrbitAltitude
647  << "\ntheOrbitInclination: " << theOrbitInclination
648  << "\n theMapAzimAngle: " << theMapAzimAngle
649  << "\n theMap2IcRotAngle: " << theMap2IcRotAngle
650  << "\n theIntrackOffset: " << theIntrackOffset
651  << "\n theCrtrackOffset: " << theCrtrackOffset
652  << "\n theLineGsdCorr: " << theLineGsdCorr
653  << "\n theSampGsdCorr: " << theSampGsdCorr
654  << "\n theRollOffset: " << theRollOffset
655  << "\n theYawOffset: " << theYawOffset
656  << "\n theYawRate: " << theYawRate
657  << "\n theMapRotation: " << theMapRotation
658  << endl;
659 
660  return ossimSensorModel::print(os);
661 }
ossimString theImageID
double samp
Definition: ossimDpt.h:164
double line
Definition: ossimDpt.h:165
const char * chars() const
For backward compatibility.
Definition: ossimString.h:77
virtual std::ostream & print(std::ostream &out) const
ProjectionType theProjectionType

◆ saveState()

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

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

Reimplemented from ossimSensorModel.

Definition at line 669 of file ossimLandSatModel.cpp.

671 {
672  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::saveState: entering..." << std::endl;
673 
674  kwl.add(prefix, ossimKeywordNames::TYPE_KW, TYPE_NAME(this));
675 
676  //***
677  // Hand off to base class for common stuff:
678  //***
679  ossimSensorModel::saveState(kwl, prefix);
680 
681  //***
682  // Save off data members:
683  //***
684  kwl.add(prefix, PROJECTION_TYPE_KW, theProjectionType, true);
685  kwl.add(prefix, MAP_ZONE_KW, theMapZone, true);
686  kwl.add(prefix, MAP_OFFSET_X_KW, theMapOffset.x, true);
687  kwl.add(prefix, MAP_OFFSET_Y_KW, theMapOffset.y, true);
688  kwl.add(prefix, WRS_PATH_NUMBER_KW, theWrsPathNumber, true);
689  kwl.add(prefix, ROW_NUMBER_KW, theWrsRowNumber, true);
690  kwl.add(prefix, ILLUM_AZIMUTH_KW, theIllumAzimuth, true);
691  kwl.add(prefix, ILLUM_ELEVATION_KW, theIllumElevation, true);
692  kwl.add(prefix, MERIDIANAL_ANGLE_KW, theMeridianalAngle, true);
693  kwl.add(prefix, ORBIT_ALTITUDE_KW, theOrbitAltitude, true);
694  kwl.add(prefix, ORBIT_INCLINATION_KW, theOrbitInclination, true);
695  kwl.add(prefix, MAP_AZIM_ANGLE_KW, theMapAzimAngle, true);
696  kwl.add(prefix, MAP_2Ic_ROT_ANGLE_KW, theMap2IcRotAngle, true);
697 
698 // kwl.add(prefix, INTRACK_OFFSET_KW , theIntrackOffset, true);
699 // kwl.add(prefix, CRTRACK_OFFSET_KW, theCrtrackOffset, true);
700 // kwl.add(prefix, LINE_GSD_CORR_KW, theLineGsdCorr, true);
701 // kwl.add(prefix, SAMP_GSD_CORR_KW, theSampGsdCorr, true);
702 // kwl.add(prefix, ROLL_OFFSET_KW, theRollOffset, true);
703 // kwl.add(prefix, YAW_OFFSET_KW, theYawOffset, true);
704 // kwl.add(prefix, YAW_RATE_KW, theYawRate, true);
705 // kwl.add(prefix, MAP_ROTATION_KW, theMapRotation, true);
706 
707  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::saveState: returning..." << std::endl;
708  return true;
709 }
#define TYPE_NAME(p)
Definition: ossimRtti.h:326
double y
Definition: ossimDpt.h:165
static const char * TYPE_KW
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
ProjectionType theProjectionType
double x
Definition: ossimDpt.h:164
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ setupOptimizer()

bool ossimLandSatModel::setupOptimizer ( const ossimString init_file)
virtual

image to ground faster

Reimplemented from ossimOptimizableProjection.

Definition at line 1140 of file ossimLandSatModel.cpp.

1141 {
1142  //init model using file path
1143  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::setupOptimizer(init_file): entering..." << std::endl;
1144 
1145  theMapProjection = 0;
1146  theIntrackOffset = 0.0;
1147  theCrtrackOffset = 0.0;
1148  theLineGsdCorr = 0.0;
1149  theSampGsdCorr = 0.0;
1150  theRollOffset = 0.0;
1151  theYawOffset = 0.0;
1152  theYawRate = 0.0;
1153  theMapRotation = 0.0;
1154 
1155  ossimRefPtr<ossimFfL7> ff_headerp;
1156  if (ossimString::downcase(init_file).contains("header.dat"))
1157  {
1158  ossimRefPtr<ossimFfL5> h = new ossimFfL5(init_file);
1159  ff_headerp = h.get();
1160 
1161  if (!ff_headerp->getErrorStatus())
1162  {
1163  double d = fabs(h->revb()->theUlEasting - h->revb()->theCenterEasting)/h->theGsd;
1164  h->theCenterImagePoint.x = static_cast<ossim_int32>(d); // d + 0.5 ???
1165 
1166  d = fabs(h->revb()->theUlNorthing - h->revb()->theCenterNorthing)/h->theGsd;
1167  h->theCenterImagePoint.y = static_cast<ossim_int32>(d); // d + 0.5 ???
1168  initFromHeader(*ff_headerp);
1169 
1170  theMapOffset.x = h->revb()->theUlEasting;
1171  theMapOffset.y = h->revb()->theUlNorthing;
1172 
1173  }
1174  else
1175  {
1176  ff_headerp = 0;
1177  }
1178  }
1179  else
1180  {
1181  ff_headerp=new ossimFfL7(init_file);
1182  if (!ff_headerp->getErrorStatus())
1183  {
1184  initFromHeader(*ff_headerp);
1185  }
1186  else
1187  {
1188  ff_headerp = 0;
1189  }
1190  }
1191  if(!ff_headerp.valid())
1192  {
1193  //
1194  // If not header, then check for possible KWL file. The loadState sets the
1195  // error status:
1196  //
1197  ossimFilename init_filename(init_file);
1198  ossimKeywordlist kwl(init_filename);
1199  loadState(kwl);
1200  }
1201 
1202  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::setupOptimizer(init_file): Exited..." << std::endl;
1203  return true;
1204 }
double theUlNorthing
Definition: ossimFfRevb.h:250
double theUlEasting
Definition: ossimFfRevb.h:249
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
double y
Definition: ossimDpt.h:165
void initFromHeader(const ossimFfL7 &head)
ossimIpt theCenterImagePoint
Definition: ossimFfL7.h:173
double theCenterNorthing
Definition: ossimFfRevb.h:276
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
ossimRefPtr< ossimFfRevb > revb()
Definition: ossimFfL5.cpp:173
virtual ossimErrorCode getErrorStatus() const
ossim_int32 y
Definition: ossimIpt.h:142
double x
Definition: ossimDpt.h:164
ossim_int32 x
Definition: ossimIpt.h:141
double theCenterEasting
Definition: ossimFfRevb.h:275
double theGsd
Definition: ossimFfL7.h:150
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimRefPtr< ossimMapProjection > theMapProjection
ossimString & downcase()
Downcases this string.
Definition: ossimString.cpp:81

◆ updateModel()

void ossimLandSatModel::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 1054 of file ossimLandSatModel.cpp.

References ossimAdjustableParameterInterface::computeParameterOffset(), ossim::cosd(), ossimMatrix3x3::create(), CRTRACK_OFFSET, INTRACK_OFFSET, LINE_GSD_CORR, MAP_ROTATION, ROLL_OFFSET, SAMP_GSD_CORR, ossim::sind(), theCrtrackOffset, theIntrackOffset, theLineGsdCorr, theMapAzimAngle, theMapAzimCos, theMapAzimSin, theMapRotation, theProjectionType, theRollOffset, theRollRotMat, theSampGsdCorr, theYawOffset, theYawRate, UTM_ORBIT, YAW_OFFSET, and YAW_RATE.

1055 {
1056  //***
1057  // Update the geometry...
1058  // Adjusted = Initial + adj_parm[i]*adj_sigma[i]
1059  // Some parameters have a zero initial value and that term is not included.
1060  //***
1069 
1070 // int numParams = getNumberOfAdjustableParameters();
1071  //***
1072  // Now the initial values have been updated, zero out the adjustment:
1073  //***
1074 // for (int i=0; i<numParams; i++)
1075 // setAdjustableParameter(i, 0.0);
1076 
1077  //***
1078  // Compute image-common values dependent on adjustable parameters:
1079  //***
1081  {
1084  }
1085  else
1086  {
1089  }
1090 
1091  double cos = ossim::cosd(theRollOffset);
1092  double sin = ossim::sind(theRollOffset);
1093  theRollRotMat = ossimMatrix3x3::create( 1.0, 0.0, 0.0,
1094  0.0, cos,-sin,
1095  0.0, sin, cos);
1096 
1097 
1098 }
double sind(double x)
Definition: ossimCommon.h:260
NEWMAT::Matrix theRollRotMat
static NEWMAT::Matrix create()
double cosd(double x)
Definition: ossimCommon.h:259
ProjectionType theProjectionType

◆ useForward()

virtual bool ossimLandSatModel::useForward ( ) const
inlinevirtual

ossimOptimizableProjection

Implements ossimOptimizableProjection.

Definition at line 120 of file ossimLandSatModel.h.

120 {return false;}

◆ writeGeomTemplate()

void ossimLandSatModel::writeGeomTemplate ( ostream &  os)
static

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

Definition at line 964 of file ossimLandSatModel.cpp.

965 {
966  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::writeGeomTemplate: entering..." << std::endl;
967 
968  os <<
969  "//**************************************************************\n"
970  "// Template for LandSat model keywordlist\n"
971  "//**************************************************************\n"
972  << ossimKeywordNames::TYPE_KW << ": " << "ossimLandSatModel" << endl;
973 
975 
976  os << "//\n"
977  << "// Derived-class ossimLandSatModel Keywords:\n"
978  << "//\n"
979  << PROJECTION_TYPE_KW << ": <float>\n"
980  << MAP_ZONE_KW << ": <float>\n"
981  << MAP_OFFSET_X_KW << ": <float>\n"
982  << MAP_OFFSET_Y_KW << ": <float>\n"
983  << WRS_PATH_NUMBER_KW << ": <float>\n"
984  << ROW_NUMBER_KW << ": <float>\n"
985  << ILLUM_AZIMUTH_KW << ": <float>\n"
986  << ILLUM_ELEVATION_KW << ": <float>\n"
987  << MERIDIANAL_ANGLE_KW << ": <float>\n"
988  << ORBIT_ALTITUDE_KW << ": <float>\n"
989  << ORBIT_INCLINATION_KW << ": <float>\n"
990  << MAP_AZIM_ANGLE_KW << ": <float>\n"
991  << MAP_2Ic_ROT_ANGLE_KW << ": <float>\n"
992  << INTRACK_OFFSET_KW << ": <float> [optional]\n"
993  << CRTRACK_OFFSET_KW << ": <float> [optional]\n"
994  << LINE_GSD_CORR_KW << ": <float> [optional]\n"
995  << SAMP_GSD_CORR_KW << ": <float> [optional]\n"
996  << ROLL_OFFSET_KW << ": <float> [optional]\n"
997  << YAW_OFFSET_KW << ": <float> [optional]\n"
998  << YAW_RATE_KW << ": <float> [optional]\n"
999  << MAP_ROTATION_KW << ": <float> [optional]\n"
1000  << endl;
1001  os << "\n" <<endl;
1002 
1003  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::writeGeomTemplate: returning..." << std::endl;
1004  return;
1005 }
static const char * TYPE_KW
static void writeGeomTemplate(ostream &os)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Data Documentation

◆ theCrtrackOffset

double ossimLandSatModel::theCrtrackOffset
protected

Definition at line 162 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theIllumAzimuth

double ossimLandSatModel::theIllumAzimuth
protected

Definition at line 137 of file ossimLandSatModel.h.

◆ theIllumElevation

double ossimLandSatModel::theIllumElevation
protected

Definition at line 138 of file ossimLandSatModel.h.

◆ theIntrackOffset

double ossimLandSatModel::theIntrackOffset
protected

Definition at line 161 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theLineGsdCorr

double ossimLandSatModel::theLineGsdCorr
protected

Definition at line 163 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theMap2IcRotAngle

double ossimLandSatModel::theMap2IcRotAngle
protected

Definition at line 154 of file ossimLandSatModel.h.

◆ theMap2IcRotCos

double ossimLandSatModel::theMap2IcRotCos
protected

Definition at line 155 of file ossimLandSatModel.h.

◆ theMap2IcRotSin

double ossimLandSatModel::theMap2IcRotSin
protected

Definition at line 156 of file ossimLandSatModel.h.

◆ theMapAzimAngle

double ossimLandSatModel::theMapAzimAngle
protected

Definition at line 151 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theMapAzimCos

double ossimLandSatModel::theMapAzimCos
protected

Definition at line 152 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theMapAzimSin

double ossimLandSatModel::theMapAzimSin
protected

Definition at line 153 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theMapOffset

ossimDpt ossimLandSatModel::theMapOffset
protected

Definition at line 142 of file ossimLandSatModel.h.

◆ theMapProjection

ossimRefPtr<ossimMapProjection> ossimLandSatModel::theMapProjection
protected

Definition at line 149 of file ossimLandSatModel.h.

◆ theMapRotation

double ossimLandSatModel::theMapRotation
protected

Definition at line 168 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theMapZone

int ossimLandSatModel::theMapZone
protected

Definition at line 141 of file ossimLandSatModel.h.

◆ theMeridianalAngle

double ossimLandSatModel::theMeridianalAngle
protected

Definition at line 145 of file ossimLandSatModel.h.

◆ theOrbitAltitude

double ossimLandSatModel::theOrbitAltitude
protected

Definition at line 139 of file ossimLandSatModel.h.

◆ theOrbitInclination

double ossimLandSatModel::theOrbitInclination
protected

Definition at line 140 of file ossimLandSatModel.h.

◆ thePositionError

double ossimLandSatModel::thePositionError
protected

Definition at line 146 of file ossimLandSatModel.h.

◆ theProjectionType

ProjectionType ossimLandSatModel::theProjectionType
protected

Definition at line 148 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theRollOffset

double ossimLandSatModel::theRollOffset
protected

Definition at line 165 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theRollRotMat

NEWMAT::Matrix ossimLandSatModel::theRollRotMat
protected

Definition at line 173 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theSampGsdCorr

double ossimLandSatModel::theSampGsdCorr
protected

Definition at line 164 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theWrsPathNumber

int ossimLandSatModel::theWrsPathNumber
protected

Definition at line 143 of file ossimLandSatModel.h.

◆ theWrsRowNumber

int ossimLandSatModel::theWrsRowNumber
protected

Definition at line 144 of file ossimLandSatModel.h.

◆ theYawOffset

double ossimLandSatModel::theYawOffset
protected

Definition at line 166 of file ossimLandSatModel.h.

Referenced by updateModel().

◆ theYawRate

double ossimLandSatModel::theYawRate
protected

Definition at line 167 of file ossimLandSatModel.h.

Referenced by updateModel().


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