OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ossimplugins::ossimErsSarModel Class Reference

This class is able to direct localisation and indirect localisation using the ErsSar sensor model. More...

#include <ossimErsSarModel.h>

Inheritance diagram for ossimplugins::ossimErsSarModel:
ossimplugins::ossimGeometricSarSensorModel ossimSensorModel ossimProjection ossimOptimizableProjection ossimAdjustableParameterInterface ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimErsSarModel ()
 Constructor. More...
 
virtual ~ossimErsSarModel ()
 Destructor. More...
 
virtual ossimString getClassName () const
 Method to return the class name. More...
 
virtual ossimObjectdup () const
 Returns pointer to a new instance, copy of this. More...
 
virtual double getSlantRangeFromGeoreferenced (double col) const
 This function associates an image column number to a slant range when the image is georeferenced (ground projected) More...
 
bool open (const ossimFilename &file)
 Method to instantiate model from the leader file. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save object state to a keyword list. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of the object from a keyword list. More...
 
- Public Member Functions inherited from ossimplugins::ossimGeometricSarSensorModel
 ossimGeometricSarSensorModel ()
 default constructor More...
 
 ossimGeometricSarSensorModel (const ossimGeometricSarSensorModel &rhs)
 copy constructor More...
 
virtual ~ossimGeometricSarSensorModel ()
 Destructor. More...
 
virtual double getSlantRange (double col) const
 This function associates an image column number to a slant range. More...
 
virtual JSDDateTime getTime (double line) const
 This function associates an image line number to an azimuth time. More...
 
virtual bool getPlatformPositionAtLine (double line, vector< double > &position, vector< double > &speed)
 This function associates an image line number to a platform position and speed. More...
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
 This function is able to convert image coordinates into world coordinates the geometric model of SAR sensors. More...
 
virtual bool optimizeModel (const std::list< ossimGpt > &groundCoordinates, const std::list< ossimDpt > &imageCoordinates)
 This function optimizes the model according to a list of Ground Control Points. More...
 
virtual void clearGCPlist ()
 Clears _optimizationGCPsGroundCoordinates and _optimizationGCPsImageCoordinates attributes Updates the optimisation factors and bias. More...
 
virtual void getGCPlist (std::list< ossimGpt > &groundCoordinates, std::list< ossimDpt > &imageCoordinates)
 Returns _optimizationGCPsGroundCoordinates and _optimizationGCPsImageCoordinates attributes. More...
 
virtual bool useForward () const
 
virtual std::ostream & print (std::ostream &out) const
 
double get_optimizationFactorX () const
 Accessors to the optimization parameters. More...
 
double get_optimizationFactorY () const
 
double get_optimizationBiasX () const
 
double get_optimizationBiasY () const
 
ossimRefPtr< ossimCoarseGridModelgetReplacementOcgModel ()
 
virtual void lineSampleToWorld (const ossimDpt &image_point, ossimGpt &gpt) const
 
void set_platformPosition (PlatformPosition *platformPosition)
 Accessors to the plateform, sensor parameters and reference point. More...
 
void set_sensorParams (SensorParams *sensorParams)
 
void set_refPoint (RefPoint *refPoint)
 
PlatformPositionget_platformPosition () const
 
SensorParamsget_sensorParams () const
 
RefPointget_refPoint () const
 
- 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 worldToLineSample (const ossimGpt &world_point, ossimDpt &image_point) const
 
virtual void imagingRay (const ossimDpt &image_point, ossimEcefRay &image_ray) 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 void updateModel ()
 
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 RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
- Public Member Functions inherited from ossimOptimizableProjection
 ossimOptimizableProjection ()
 
 ossimOptimizableProjection (const ossimOptimizableProjection &source)
 
virtual ~ossimOptimizableProjection ()
 
virtual ossimOptimizableProjectionoperator= (const ossimOptimizableProjection &source)
 
virtual bool setupOptimizer (const ossimString &setup)
 setupFromString() Derived classes should implement as needed. Initialize parameters needed for optimizeFit and degreesOfFreedom More...
 
- Public Member Functions inherited from ossimAdjustableParameterInterface
 ossimAdjustableParameterInterface ()
 
 ossimAdjustableParameterInterface (const ossimAdjustableParameterInterface &rhs)
 
virtual ~ossimAdjustableParameterInterface ()
 
void newAdjustment (ossim_uint32 numberOfParameters=0)
 
void setAdjustmentDescription (const ossimString &description)
 
ossimString getAdjustmentDescription () const
 
ossimString getAdjustmentDescription (ossim_uint32 adjustmentIdx) const
 Returns adjustmentDescription of specific adjustmentInfo. More...
 
void setCurrentAdjustment (ossim_uint32 adjustmentIndex, bool notify=false)
 
bool setCurrentAdjustment (const ossimString &description, bool notify=false)
 Sets the current adjustment to the adjustment with a matching description. More...
 
void eraseAdjustment (bool notify)
 
void eraseAdjustment (ossim_uint32 idx, bool notify)
 
virtual void initAdjustableParameters ()
 
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...
 

Protected Member Functions

virtual bool InitPlatformPosition (const ossimKeywordlist &kwl, const char *prefix)
 Initializes the Platform Position from a projection keywordlist. More...
 
virtual bool InitSensorParams (const ossimKeywordlist &kwl, const char *prefix)
 Initializes the Sensor Params from a projection keywordlist. More...
 
virtual bool InitRefPoint (const ossimKeywordlist &kwl, const char *prefix)
 Initializes the Reference Point from a projection keywordlist. More...
 
virtual bool InitSRGR (const ossimKeywordlist &kwl, const char *prefix)
 Initializes the Slant Range for each Ground Range data sets : theNumberSRGR,theSRGRCoeffset,_srgr_update,thePixelSpacing,_isProductGeoreferenced. More...
 
- Protected Member Functions inherited from ossimplugins::ossimGeometricSarSensorModel
bool createReplacementOCG ()
 Creates replacement coarse grid model if user requested via ossim preferences keyword "geometric_sar_sensor_model.create_ocg: <bool>". More...
 
- Protected Member Functions inherited from ossimSensorModel
virtual ~ossimSensorModel ()
 
virtual ossimDpt extrapolate (const ossimGpt &gp) const
 
virtual ossimGpt extrapolate (const ossimDpt &ip, const double &height=ossim::nan()) const
 
void buildNormalEquation (const ossimTieGptSet &tieSet, NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &residue, NEWMAT::ColumnVector &projResidue, double pstep_scale)
 
NEWMAT::ColumnVector getResidue (const ossimTieGptSet &tieSet)
 
NEWMAT::ColumnVector solveLeastSquares (NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &r) const
 
NEWMAT::Matrix invert (const NEWMAT::Matrix &m) const
 stable invert stolen from ossimRpcSolver More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimAdjustableParameterInterface
bool paramChanged (ossim_uint32 param_idx) const
 Returns true if specified parameter has been modified since last setAllChangeFlag(false) call. More...
 
void setAllChangeFlags (bool areChanged)
 Sets all the change flags to the boolean indicated to indicate parameters are changed (TRUE) or not (FALSE). More...
 
void initChangeFlags ()
 Initializes the change flags to TRUE. More...
 

Private Member Functions

virtual bool isErsLeader (const ossimFilename &file) const
 
virtual ossimFilename findErsLeader (const ossimFilename &file) const
 

Private Attributes

int theNumberSRGR
 Slant Range for each Ground Range (SRGR) number of coefficients sets. More...
 
double theSRGRCoeffset [1][3]
 SRGR coefficient sets. More...
 
double thePixelSpacing
 Pixel spacing. More...
 
ErsSarLeadertheErsSarleader
 List of metadata contained in the Leader file. More...
 

Additional Inherited Members

- 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
}
 
- Static Public Member Functions inherited from ossimSensorModel
static void writeGeomTemplate (ostream &os)
 
- Static Public Attributes inherited from ossimplugins::ossimGeometricSarSensorModel
static const char * CREATE_OCG_PREF_KW = "geometric_sar_sensor_model.create_ocg"
 
- Protected Attributes inherited from ossimplugins::ossimGeometricSarSensorModel
PlatformPosition_platformPosition
 Handle the position of the platform. More...
 
SensorParams_sensor
 
RefPoint_refPoint
 
SarSensor_sarSensor
 
bool _isProductGeoreferenced
 True iff the product is ground range. More...
 
std::list< ossimGpt_optimizationGCPsGroundCoordinates
 List Ground Control Points used by the optimization. More...
 
std::list< ossimDpt_optimizationGCPsImageCoordinates
 
double _optimizationFactorX
 Optimization result : linear error correction in both dimensions. More...
 
double _optimizationFactorY
 
double _optimizationBiasX
 
double _optimizationBiasY
 
ossimFilename _imageFilename
 
ossimFilename _productXmlFile
 
ossimRefPtr< ossimCoarseGridModel_replacementOcgModel
 
- 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

This class is able to direct localisation and indirect localisation using the ErsSar sensor model.

Definition at line 37 of file ossimErsSarModel.h.

Constructor & Destructor Documentation

◆ ossimErsSarModel()

ossimplugins::ossimErsSarModel::ossimErsSarModel ( )

Constructor.

Definition at line 40 of file ossimErsSarModel.cpp.

References theSRGRCoeffset.

Referenced by dup().

40  :
41  theNumberSRGR(0),
42  thePixelSpacing(0),
43  theErsSarleader(NULL)
44  {
45  theSRGRCoeffset[0][0] = 0.0;
46  theSRGRCoeffset[0][1] = 0.0;
47  theSRGRCoeffset[0][2] = 0.0;
48  }
double thePixelSpacing
Pixel spacing.
ErsSarLeader * theErsSarleader
List of metadata contained in the Leader file.
double theSRGRCoeffset[1][3]
SRGR coefficient sets.
int theNumberSRGR
Slant Range for each Ground Range (SRGR) number of coefficients sets.

◆ ~ossimErsSarModel()

ossimplugins::ossimErsSarModel::~ossimErsSarModel ( )
virtual

Destructor.

Definition at line 50 of file ossimErsSarModel.cpp.

References theErsSarleader.

51  {
52  if (theErsSarleader != NULL)
53  {
54  delete theErsSarleader;
55  theErsSarleader = NULL;
56  }
57  }
ErsSarLeader * theErsSarleader
List of metadata contained in the Leader file.

Member Function Documentation

◆ dup()

ossimObject * ossimplugins::ossimErsSarModel::dup ( ) const
virtual

Returns pointer to a new instance, copy of this.

Implements ossimProjection.

Definition at line 64 of file ossimErsSarModel.cpp.

References ossimErsSarModel().

65  {
66  return new ossimErsSarModel(*this);
67  }

◆ findErsLeader()

ossimFilename ossimplugins::ossimErsSarModel::findErsLeader ( const ossimFilename file) const
privatevirtual

Definition at line 665 of file ossimErsSarModel.cpp.

References ossimFilename::exists(), ossimFilename::fileNoExtension(), and ossimFilename::setFile().

Referenced by open().

666  {
667  ossimFilename leaFile = file;
668  ossimString datString("DAT_01");
669  ossimString nulString("NUL_DAT");
670  ossimString vdfString("VDF_DAT");
671  ossimString leaString("LEA_01");
672  if ((file.fileNoExtension() == datString)
673  || (file.fileNoExtension() == nulString)
674  || (file.fileNoExtension() == leaString))
675  {
676  leaFile.setFile(leaString);
677  if (leaFile.exists())
678  {
679  return leaFile;
680  }
681  }
682  return file;
683  }
ossimFilename & setFile(const ossimString &f)
bool exists() const
ossimFilename fileNoExtension() const

◆ getClassName()

ossimString ossimplugins::ossimErsSarModel::getClassName ( ) const
virtual

Method to return the class name.

Returns
The name of this class.

Reimplemented from ossimObject.

Definition at line 59 of file ossimErsSarModel.cpp.

Referenced by loadState().

60  {
61  return ossimString("ossimErsSarModel");
62  }

◆ getSlantRangeFromGeoreferenced()

double ossimplugins::ossimErsSarModel::getSlantRangeFromGeoreferenced ( double  col) const
virtual

This function associates an image column number to a slant range when the image is georeferenced (ground projected)

Parameters
colColumn coordinate of the image point

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 69 of file ossimErsSarModel.cpp.

References theSRGRCoeffset.

70  {
71  const double c = 2.99792458e+8;
72  double tn = theSRGRCoeffset[0][0] + theSRGRCoeffset[0][1] * col + theSRGRCoeffset[0][2] * col * col ;
73  return tn *(c / 2.0);
74  }
double theSRGRCoeffset[1][3]
SRGR coefficient sets.

◆ InitPlatformPosition()

bool ossimplugins::ossimErsSarModel::InitPlatformPosition ( const ossimKeywordlist kwl,
const char *  prefix 
)
protectedvirtual

Initializes the Platform Position from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 334 of file ossimErsSarModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_platformPosition, ossimKeywordlist::find(), ossimplugins::JSDDateTime::get_second(), ossimplugins::JSDDateTime::NormDate(), ossimplugins::CivilDateTime::set_day(), ossimplugins::CivilDateTime::set_decimal(), ossimplugins::CivilDateTime::set_month(), ossimplugins::JSDDateTime::set_second(), ossimplugins::CivilDateTime::set_second(), and ossimplugins::CivilDateTime::set_year().

Referenced by loadState().

335  {
336  // const double PI = 3.14159265358979323846 ;
337  CivilDateTime ref_civil_date;
338  /*
339  * Ephemerisis reference date retrieval
340  */
341  const char* eph_year_str = kwl.find(prefix, "eph_year");
342  int eph_year = atoi(eph_year_str);
343  const char* eph_month_str = kwl.find(prefix, "eph_month");
344  int eph_month = atoi(eph_month_str);
345  const char* eph_day_str = kwl.find(prefix, "eph_day");
346  int eph_day = atoi(eph_day_str);
347  const char* eph_sec_str = kwl.find(prefix, "eph_sec");
348  double eph_sec = atof(eph_sec_str);
349 
350  ref_civil_date.set_year(eph_year);
351  ref_civil_date.set_month(eph_month);
352  ref_civil_date.set_day(eph_day);
353  ref_civil_date.set_second((int)eph_sec);
354  ref_civil_date.set_decimal(eph_sec - (double)((int)eph_sec));
355 
356  JSDDateTime ref_jsd_date(ref_civil_date);
357 
358  /*
359  * Ephemerisis time interval retrieval
360  */
361  const char* eph_int_str = kwl.find(prefix, "eph_int");
362  double eph_int = atof(eph_int_str);
363  /*
364  * Ephemerisis number retrieval
365  */
366  const char* neph_str = kwl.find(prefix, "neph");
367  int neph = atoi(neph_str);
368 
369  Ephemeris** ephemeris = new Ephemeris*[neph];
370 
371  /*
372  * Ephemerisis retrieval
373  */
374  for (int i = 0; i < neph; i++)
375  {
376  double pos[3];
377  double vit[3];
378  char name[64];
379 
380 
381  sprintf(name, "eph%i_posX", i);
382  const char* px_str = kwl.find(prefix, name);
383  pos[0] = atof(px_str);
384 
385  sprintf(name, "eph%i_posY", i);
386  const char* py_str = kwl.find(prefix, name);
387  pos[1] = atof(py_str);
388 
389  sprintf(name, "eph%i_posZ", i);
390  const char* pz_str = kwl.find(prefix, name);
391  pos[2] = atof(pz_str);
392 
393 
394  sprintf(name, "eph%i_velX", i);
395  const char* vx_str = kwl.find(prefix, name);
396  vit[0] = atof(vx_str);
397 
398  sprintf(name, "eph%i_velY", i);
399  const char* vy_str = kwl.find(prefix, name);
400  vit[1] = atof(vy_str);
401 
402  sprintf(name, "eph%i_velZ", i);
403  const char* vz_str = kwl.find(prefix, name);
404  vit[2] = atof(vz_str);
405 
406  /*
407  * Ephemerisis date
408  */
409  JSDDateTime date(ref_jsd_date);
410  date.set_second(date.get_second() + i * eph_int);
411  date.NormDate();
412 
413  GeographicEphemeris* eph = new GeographicEphemeris(date, pos, vit);
414 
415  ephemeris[i] = eph;
416  }
417 
418  /*
419  * Antenna position interpolator creation
420  */
421  if (_platformPosition != NULL)
422  {
423  delete _platformPosition;
424  }
425  _platformPosition = new PlatformPosition(ephemeris, neph);
426 
427  /*
428  * Free of memory used by the ephemerisis list
429  */
430  for (int i = 0; i < neph; i++)
431  {
432  delete ephemeris[i];
433  }
434  delete[] ephemeris;
435 
436  return true;
437  }
const char * find(const char *key) const
PlatformPosition * _platformPosition
Handle the position of the platform.

◆ InitRefPoint()

bool ossimplugins::ossimErsSarModel::InitRefPoint ( const ossimKeywordlist kwl,
const char *  prefix 
)
protectedvirtual

Initializes the Reference Point from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 439 of file ossimErsSarModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_platformPosition, ossimplugins::ossimGeometricSarSensorModel::_refPoint, ossimplugins::ossimGeometricSarSensorModel::_sensor, distance(), ossimKeywordlist::find(), ossimplugins::SensorParams::get_nRangeLook(), ossimplugins::SensorParams::get_sf(), ossimplugins::PlatformPosition::Interpolate(), min, ossimplugins::ossimGeometricSarSensorModel::optimizeModel(), ossimplugins::RefPoint::set_distance(), ossimplugins::RefPoint::set_ephemeris(), ossimplugins::RefPoint::set_pix_col(), ossimplugins::RefPoint::set_pix_line(), ossimSensorModel::theImageClipRect, ossimSensorModel::theImageSize, ossimIpt::x, and ossimIpt::y.

Referenced by loadState().

440  {
441  const char* sc_lin_str = kwl.find(prefix, "sc_lin");
442  double sc_lin = atof(sc_lin_str);
443 
444  const char* sc_pix_str = kwl.find(prefix, "sc_pix");
445  double sc_pix = atof(sc_pix_str);
446 
447  const char* inp_sctim_str = kwl.find(prefix, "inp_sctim");
448 
449  const char* rng_gate_str = kwl.find(prefix, "zero_dop_range_time_f_pixel");
450  double rng_gate = atof(rng_gate_str);
451 
452  if (_refPoint == NULL)
453  {
454  _refPoint = new RefPoint();
455  }
456 
457  _refPoint->set_pix_col(sc_pix);
458  _refPoint->set_pix_line(sc_lin);
459 
460  char year_str[5];
461  for (int i = 0; i < 4; i++)
462  {
463  year_str[i] = inp_sctim_str[i];
464  }
465  year_str[4] = '\0';
466 
467  char month_str[3];
468  for (int i = 4; i < 6; i++)
469  {
470  month_str[i-4] = inp_sctim_str[i];
471  }
472  month_str[2] = '\0';
473 
474  char day_str[3];
475  for (int i = 6; i < 8; i++)
476  {
477  day_str[i-6] = inp_sctim_str[i];
478  }
479  day_str[2] = '\0';
480 
481  char hour_str[3];
482  for (int i = 8; i < 10; i++)
483  {
484  hour_str[i-8] = inp_sctim_str[i];
485  }
486  hour_str[2] = '\0';
487 
488  char min_str[3];
489  for (int i = 10; i < 12; i++)
490  {
491  min_str[i-10] = inp_sctim_str[i];
492  }
493  min_str[2] = '\0';
494 
495  char sec_str[3];
496  for (int i = 12; i < 14; i++)
497  {
498  sec_str[i-12] = inp_sctim_str[i];
499  }
500  sec_str[2] = '\0';
501 
502  char mili_str[4];
503  for (int i = 14; i < 17; i++)
504  {
505  mili_str[i-14] = inp_sctim_str[i];
506  }
507  mili_str[3] = '\0';
508 
509  int year = atoi(year_str);
510  int month = atoi(month_str);
511  int day = atoi(day_str);
512  int hour = atoi(hour_str);
513  int min = atoi(min_str);
514  int sec = atoi(sec_str);
515  double mili = atof(mili_str);
516 
517 
518  CivilDateTime date(year, month, day, hour * 3600 + min * 60 + sec, mili / 1000.0);
519 
520  if (_platformPosition != NULL)
521  {
522  Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)date);
523  if (ephemeris == NULL) return false ;
524  _refPoint->set_ephemeris(ephemeris);
525 
526  delete ephemeris;
527  }
528  else
529  {
530  return false;
531  }
532 
533  double c = 2.99792458e+8;
534 
535  double distance = (rng_gate * 1e-3 + ((double)sc_pix) * _sensor->get_nRangeLook() / _sensor->get_sf()) * (c / 2.0);
536 
538 
539  // in order to use ossimSensorModel::lineSampleToWorld
540  const char* nbCol_str = kwl.find(prefix, "num_pix");
541  const char* nbLin_str = kwl.find(prefix, "num_lines");
542  theImageSize.x = atoi(nbCol_str);
543  theImageSize.y = atoi(nbLin_str);
545 
546  // Ground Control Points extracted from the model : corner points
547  std::list<ossimGpt> groundGcpCoordinates ;
548  std::list<ossimDpt> imageGcpCoordinates ;
549  // first line first pix
550  const char* lon_str = kwl.find("first_line_first_pixel_lon");
551  double lon = atof(lon_str);
552  const char* lat_str = kwl.find("first_line_first_pixel_lat");
553  double lat = atof(lat_str);
554  if (lon > 180.0) lon -= 360.0;
555  ossimDpt imageGCP1(0, 0);
556  ossimGpt groundGCP1(lat, lon, 0.0);
557  groundGcpCoordinates.push_back(groundGCP1) ;
558  imageGcpCoordinates.push_back(imageGCP1) ;
559  // first line last pix
560  lon_str = kwl.find("first_line_last_pixel_lon");
561  lon = atof(lon_str);
562  lat_str = kwl.find("first_line_last_pixel_lat");
563  lat = atof(lat_str);
564  if (lon > 180.0) lon -= 360.0;
565  ossimDpt imageGCP2(theImageSize.x - 1, 0);
566  ossimGpt groundGCP2(lat, lon, 0.0);
567  groundGcpCoordinates.push_back(groundGCP2) ;
568  imageGcpCoordinates.push_back(imageGCP2) ;
569  // last line last pix
570  lon_str = kwl.find("last_line_last_pixel_lon");
571  lon = atof(lon_str);
572  lat_str = kwl.find("last_line_last_pixel_lat");
573  lat = atof(lat_str);
574  if (lon > 180.0) lon -= 360.0;
575  ossimDpt imageGCP3(theImageSize.x - 1, theImageSize.y - 1);
576  ossimGpt groundGCP3(lat, lon, 0.0);
577  groundGcpCoordinates.push_back(groundGCP3) ;
578  imageGcpCoordinates.push_back(imageGCP3) ;
579  // last line first pix
580  lon_str = kwl.find("last_line_first_pixel_lon");
581  lon = atof(lon_str);
582  lat_str = kwl.find("last_line_first_pixel_lat");
583  lat = atof(lat_str);
584  if (lon > 180.0) lon -= 360.0;
585  ossimDpt imageGCP4(0, theImageSize.y - 1);
586  ossimGpt groundGCP4(lat, lon, 0.0);
587  groundGcpCoordinates.push_back(groundGCP4) ;
588  imageGcpCoordinates.push_back(imageGCP4) ;
589 
590  // Default optimization
591  optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ;
592 
593  return true;
594  }
const char * find(const char *key) const
double get_nRangeLook() const
Definition: SensorParams.h:118
Ephemeris * Interpolate(JSDDateTime date) const
This function interpolates its ephemeris to create a new ephemeris at the given date and time...
void set_pix_line(double pix_line)
Definition: RefPoint.cpp:80
void set_pix_col(double pix_col)
Definition: RefPoint.cpp:85
ossimDrect theImageClipRect
PlatformPosition * _platformPosition
Handle the position of the platform.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
virtual bool optimizeModel(const std::list< ossimGpt > &groundCoordinates, const std::list< ossimDpt > &imageCoordinates)
This function optimizes the model according to a list of Ground Control Points.
void set_ephemeris(Ephemeris *ephemeris)
Definition: RefPoint.cpp:65
float distance(double lat1, double lon1, double lat2, double lon2, int units)
void set_distance(double distance)
Definition: RefPoint.cpp:75
#define min(a, b)
Definition: auxiliary.h:75

◆ InitSensorParams()

bool ossimplugins::ossimErsSarModel::InitSensorParams ( const ossimKeywordlist kwl,
const char *  prefix 
)
protectedvirtual

Initializes the Sensor Params from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 76 of file ossimErsSarModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_sensor, ossimString::c_str(), ossimKeywordlist::find(), ossimplugins::SensorParams::Right, ossimplugins::SensorParams::set_col_direction(), ossimplugins::SensorParams::set_lin_direction(), ossimplugins::SensorParams::set_nAzimuthLook(), ossimplugins::SensorParams::set_nRangeLook(), ossimplugins::SensorParams::set_prf(), ossimplugins::SensorParams::set_rwl(), ossimplugins::SensorParams::set_semiMajorAxis(), ossimplugins::SensorParams::set_semiMinorAxis(), ossimplugins::SensorParams::set_sf(), ossimplugins::SensorParams::set_sightDirection(), and ossimString::upcase().

Referenced by loadState().

77  {
78  const char* wave_length_str = kwl.find(prefix, "wave_length");
79  double wave_length = atof(wave_length_str);
80  const char* fr_str = kwl.find(prefix, "fr");
81  double fr = atof(fr_str) * 1e6;
82  const char* fa_str = kwl.find(prefix, "fa");
83  double fa = atof(fa_str);
84 
85  ossimString time_dir_pix = kwl.find(prefix, "time_dir_pix");
86  time_dir_pix.upcase();
87  //std::transform(time_dir_pix.begin(), time_dir_pix.end(), time_dir_pix.begin(), toupper);
88  ossimString time_dir_lin = kwl.find(prefix, "time_dir_lin");
89  time_dir_lin.upcase();
90  //std::transform(time_dir_lin.begin(), time_dir_lin.end(), time_dir_lin.begin(), toupper);
91 
92  //ellipsoid parameters
93  const char* ellip_maj_str = kwl.find(prefix, "ellip_maj");
94  double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m
95  const char* ellip_min_str = kwl.find(prefix, "ellip_min");
96  double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m
97 
98  if (_sensor != NULL)
99  {
100  delete _sensor;
101  }
102 
103  _sensor = new SensorParams();
104 
105  if (strcmp(time_dir_pix.c_str(), "INCREASE") == 0)
106  {
108  }
109  else
110  {
112  }
113 
114  if (strcmp(time_dir_lin.c_str(), "INCREASE") == 0)
115  {
117  }
118  else
119  {
121  }
122 
124 
125  double nlooks_az = atof(kwl.find(prefix, "nlooks_az"));
126  _sensor->set_nAzimuthLook(nlooks_az);
127  double n_rnglok = atof(kwl.find(prefix, "n_rnglok"));
128  _sensor->set_nRangeLook(n_rnglok);
129 
130  _sensor->set_prf(fa);
131  _sensor->set_sf(fr);
132  _sensor->set_rwl(wave_length);
133 
134  _sensor->set_semiMajorAxis(ellip_maj) ;
135  _sensor->set_semiMinorAxis(ellip_min) ;
136 
137  return true;
138  }
void set_sightDirection(SightDirection sight)
Definition: SensorParams.h:93
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
void set_rwl(double rwl)
Definition: SensorParams.h:83
const char * find(const char *key) const
void set_lin_direction(int dir)
Definition: SensorParams.h:128
void set_semiMinorAxis(double value)
Definition: SensorParams.h:158
void set_semiMajorAxis(double value)
Definition: SensorParams.h:153
void set_nRangeLook(double look)
Definition: SensorParams.h:138
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
void set_nAzimuthLook(double look)
Definition: SensorParams.h:133
void set_prf(double prf)
Definition: SensorParams.h:73
void set_col_direction(int dir)
Definition: SensorParams.h:123
void set_sf(double sf)
Definition: SensorParams.h:78

◆ InitSRGR()

bool ossimplugins::ossimErsSarModel::InitSRGR ( const ossimKeywordlist kwl,
const char *  prefix 
)
protectedvirtual

Initializes the Slant Range for each Ground Range data sets : theNumberSRGR,theSRGRCoeffset,_srgr_update,thePixelSpacing,_isProductGeoreferenced.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 596 of file ossimErsSarModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_isProductGeoreferenced, ossimKeywordlist::find(), ossimString::find(), theNumberSRGR, theSRGRCoeffset, and ossimString::upcase().

Referenced by loadState().

597  {
598  // Product type = PRI
599  ossimString filename(kwl.find("filename"));
600  filename.upcase();
601  //std::transform(filename.begin(), filename.end(), filename.begin(), toupper);
602  string::size_type loc = filename.find("PRI");
603  if (loc != string::npos)
604  {
606  }
607  else
608  {
609  _isProductGeoreferenced = false;
610  }
611 
612  // Number of SRGR Coef
613  theNumberSRGR = 3;
614 
615  // Range time for first mid and last pixel
616  double t1 = atof(kwl.find("zero_dop_range_time_f_pixel")) * 1e-3;
617  double t2 = atof(kwl.find("zero_dop_range_time_c_pixel")) * 1e-3;
618  double t3 = atof(kwl.find("zero_dop_range_time_l_pixel")) * 1e-3;
619 
620  // Range pixels numbers corresponding
621  // Todo : check if it works with "DECREASING LINE TIME"
622  // double x1 = 0.0;
623  double x2 = atof(kwl.find("sc_pix")) - 1.0;
624  double x3 = 2.0 * (x2 + 1.0) - 1.0 ;
625 
626  theSRGRCoeffset[0][0] = t1;
627  theSRGRCoeffset[0][1] = ((t2 - t1) / (x2 * x2) + (t1 - t3) / (x3 * x3)) / ((1.0 / x2) - (1.0 / x3));
628  theSRGRCoeffset[0][2] = ((t2 - t1) / x2 + (t1 - t3) / x3) / (x2 - x3);
629 
630  return true;
631  }
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
const char * find(const char *key) const
double theSRGRCoeffset[1][3]
SRGR coefficient sets.
bool _isProductGeoreferenced
True iff the product is ground range.
int theNumberSRGR
Slant Range for each Ground Range (SRGR) number of coefficients sets.
std::string::size_type find(const std::string &s, std::string::size_type pos=0) const
Searches for s as a substring of *this, beginning at character pos of *this.
Definition: ossimString.h:753

◆ isErsLeader()

bool ossimplugins::ossimErsSarModel::isErsLeader ( const ossimFilename file) const
privatevirtual

Definition at line 633 of file ossimErsSarModel.cpp.

References ossimString::c_str(), and ossimString::find().

Referenced by open().

634  {
635  std::ifstream candidate(file.c_str(), ios::in | ios::binary);
636  char ersFileName[16];
637 
638  candidate.seekg(48);
639  if (candidate.bad() || candidate.eof())
640  {
641  return false;
642  }
643  candidate.read(ersFileName, 16);
644  if (candidate.bad() || candidate.eof())
645  {
646  return false;
647  }
648  candidate.close();
649 
650  ossimString ersString(ersFileName);
651 
652  if ((ersString.find("ERS") == 0) &&
653  (ersString.find(".SAR.") == 4) &&
654  (ersString.find("LEAD") == 12))
655  {
656  return true;
657  }
658  else
659  {
660  return false;
661  }
662 
663  }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
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

◆ loadState()

bool ossimplugins::ossimErsSarModel::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.

Returns
true if load OK, false on error

Reimplemented from ossimplugins::ossimGeometricSarSensorModel.

Definition at line 252 of file ossimErsSarModel.cpp.

References ossimKeywordlist::find(), getClassName(), InitPlatformPosition(), InitRefPoint(), InitSensorParams(), InitSRGR(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimNotifyLevel_WARN, and ossimKeywordNames::TYPE_KW.

Referenced by open().

253  {
254  static const char MODULE[] = "ossimErsSarModel::loadState";
255 
256  if (traceDebug())
257  {
258  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
259  }
260 
261  const char* lookup = 0;
262  ossimString s;
263 
264  // Check the type first.
265  lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
266  if (lookup)
267  {
268  s = lookup;
269  if (s != getClassName())
270  {
271  return false;
272  }
273  }
274 
275  // Load the base class.
276 // bool result = ossimGeometricSarSensorModel::loadState(kwl, prefix);
277  bool result = false;
278  result = InitPlatformPosition(kwl, prefix);
279  if (!result)
280  {
281  if (traceDebug())
282  {
284  << MODULE
285  << "\nCan't init platform position \n";
286  }
287  }
288 
289  if (result)
290  {
291  result = InitSensorParams(kwl, prefix);
292  if (!result)
293  {
294  if (traceDebug())
295  {
297  << MODULE
298  << "\nCan't init sensor parameters \n";
299  }
300  }
301  }
302 
303  if (result)
304  {
305  result = InitRefPoint(kwl, prefix);
306  if (!result)
307  {
308  if (traceDebug())
309  {
311  << MODULE
312  << "\nCan't init ref point \n";
313  }
314  }
315  }
316 
317  if (result)
318  {
319  result = InitSRGR(kwl, prefix);
320  if (!result)
321  {
322  if (traceDebug())
323  {
325  << MODULE
326  << "\nCan't init ref point \n";
327  }
328  }
329  }
330 
331  return result;
332  }
const char * find(const char *key) const
virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Reference Point from a projection keywordlist.
static const char * TYPE_KW
virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Slant Range for each Ground Range data sets : theNumberSRGR,theSRGRCoeffset,_srgr_update,thePixelSpacing,_isProductGeoreferenced.
virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Platform Position from a projection keywordlist.
virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Sensor Params from a projection keywordlist.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual ossimString getClassName() const
Method to return the class name.

◆ open()

bool ossimplugins::ossimErsSarModel::open ( const ossimFilename file)

Method to instantiate model from the leader file.

Parameters
file
Returns
true on success, false on error.

Definition at line 140 of file ossimErsSarModel.cpp.

References ossimString::c_str(), ossimFilename::exists(), findErsLeader(), isErsLeader(), loadState(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimplugins::ossimGeometricSarSensorModel::print(), saveState(), and theErsSarleader.

141  {
142  static const char MODULE[] = "ossimErsSarModel::open";
143 
144  if (traceDebug())
145  {
147  << MODULE << " entered...\n"
148  << "file: " << file << "\n";
149  }
150 
151  bool result = false;
152  ossimFilename leaFilename = file;
153 
154  /*
155  * Creation of the class allowing to store Leader file metadata
156  */
157  if (theErsSarleader != NULL)
158  {
159  delete theErsSarleader;
160  theErsSarleader = NULL;
161  }
162 
163  theErsSarleader = new ErsSarLeader();
164 
165  if (leaFilename.exists())
166  {
167  result = isErsLeader(leaFilename);
168  if (result == false)
169  {
170  leaFilename = findErsLeader(file);
171  }
172  result = isErsLeader(leaFilename);
173 
174  if (result == true)
175  {
176  if (traceDebug())
177  {
178  ossimNotify(ossimNotifyLevel_DEBUG) << "is ERS leader file..."
179  << "Begin reading Leader file" << std::endl;
180  }
181  /*
182  * Leader file data reading
183  */
184  std::ifstream leaderFile(leaFilename.c_str(), ios::in | ios::binary);
185  leaderFile >> *theErsSarleader;
186  leaderFile.close();
187 
188  if (traceDebug())
189  {
191  << "End reading Leader file" << std::endl;
192  }
193 
194  //To initialize the whole state, reusing saveState/loadState
195  //FIXME: This could be at the superclass level instead
196  ossimKeywordlist kwl;
197  saveState(kwl);
198  loadState(kwl);
199 
200  } // matches: if ( result=isErsLeader(file) == True )
201 
202  } // matches: if ( file.exists() )
203 
204  if (traceDebug())
205  {
207 
209  << MODULE << " exit status = " << (result ? "true" : "false\n")
210  << std::endl;
211  }
212 
213 
214 
215  return result;
216 
217  }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
virtual bool isErsLeader(const ossimFilename &file) const
Represents serializable keyword/value map.
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
ErsSarLeader * theErsSarleader
List of metadata contained in the Leader file.
bool exists() const
virtual std::ostream & print(std::ostream &out) const
virtual ossimFilename findErsLeader(const ossimFilename &file) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
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
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ saveState()

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

Method to save object state to a keyword list.

Parameters
kwlKeyword list to save to.
prefixadded to keys when saved.
Returns
true on success, false on error.

Reimplemented from ossimplugins::ossimGeometricSarSensorModel.

Definition at line 220 of file ossimErsSarModel.cpp.

References ossimNotify(), ossimNotifyLevel_DEBUG, ossimplugins::ErsSarLeader::saveState(), and theErsSarleader.

Referenced by open().

222  {
223  static const char MODULE[] = "ossimErsSarModel::saveState";
224 
225  if (traceDebug())
226  {
227  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
228  }
229 
230  bool result(false);
231 
232  //kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimErsSarModel", true);
233 
234  if (theErsSarleader == NULL)
235  {
236  std::cout << "Error: ErsSarleader is NULL" << std::endl;
237  return false;
238  }
239 
240  result = theErsSarleader->saveState(kwl);
241 
242  if (traceDebug())
243  {
245  << MODULE << " exit status = " << (result ? "true" : "false\n")
246  << std::endl;
247  }
248 
249  return result;
250  }
ErsSarLeader * theErsSarleader
List of metadata contained in the Leader file.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Data Documentation

◆ theErsSarleader

ErsSarLeader* ossimplugins::ossimErsSarModel::theErsSarleader
private

List of metadata contained in the Leader file.

Definition at line 116 of file ossimErsSarModel.h.

Referenced by open(), saveState(), and ~ossimErsSarModel().

◆ theNumberSRGR

int ossimplugins::ossimErsSarModel::theNumberSRGR
private

Slant Range for each Ground Range (SRGR) number of coefficients sets.

Definition at line 103 of file ossimErsSarModel.h.

Referenced by InitSRGR().

◆ thePixelSpacing

double ossimplugins::ossimErsSarModel::thePixelSpacing
private

Pixel spacing.

Definition at line 111 of file ossimErsSarModel.h.

◆ theSRGRCoeffset

double ossimplugins::ossimErsSarModel::theSRGRCoeffset[1][3]
private

SRGR coefficient sets.

Definition at line 107 of file ossimErsSarModel.h.

Referenced by getSlantRangeFromGeoreferenced(), InitSRGR(), and ossimErsSarModel().


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