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::ossimAlosPalsarModel Class Reference

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

#include <ossimAlosPalsarModel.h>

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

Public Member Functions

 ossimAlosPalsarModel ()
 Constructor. More...
 
virtual ~ossimAlosPalsarModel ()
 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 isAlosPalsarLeader (const ossimFilename &file) const
 
virtual ossimFilename findAlosPalsarLeader (const ossimFilename &file) const
 
virtual bool isAlosPalsarData (const ossimFilename &file) const
 
virtual ossimFilename findAlosPalsarData (const ossimFilename &file) const
 

Private Attributes

double thePixelSpacing
 Pixel spacing. More...
 
AlosPalsarLeadertheAlosPalsarLeader
 List of metadata contained in the Leader file. More...
 
AlosPalsarDatatheAlosPalsarData
 List of metadata contained in the Data 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 AlosPalsar sensor model.

It support at least level 1.1 data (SLC).

Definition at line 43 of file ossimAlosPalsarModel.h.

Constructor & Destructor Documentation

◆ ossimAlosPalsarModel()

ossimplugins::ossimAlosPalsarModel::ossimAlosPalsarModel ( )

Constructor.

Definition at line 42 of file ossimAlosPalsarModel.cpp.

Referenced by dup().

42  :
43  thePixelSpacing(0),
44  theAlosPalsarLeader(NULL),
45  theAlosPalsarData(NULL)
46  {
47  }
AlosPalsarLeader * theAlosPalsarLeader
List of metadata contained in the Leader file.
AlosPalsarData * theAlosPalsarData
List of metadata contained in the Data file.

◆ ~ossimAlosPalsarModel()

ossimplugins::ossimAlosPalsarModel::~ossimAlosPalsarModel ( )
virtual

Destructor.

Definition at line 49 of file ossimAlosPalsarModel.cpp.

References theAlosPalsarData, and theAlosPalsarLeader.

50  {
51  if (theAlosPalsarLeader != NULL)
52  {
53  delete theAlosPalsarLeader;
54  theAlosPalsarLeader = NULL;
55  }
56  if (theAlosPalsarData != NULL)
57  {
58  delete theAlosPalsarData;
59  theAlosPalsarData = NULL;
60  }
61  }
AlosPalsarLeader * theAlosPalsarLeader
List of metadata contained in the Leader file.
AlosPalsarData * theAlosPalsarData
List of metadata contained in the Data file.

Member Function Documentation

◆ dup()

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

Returns pointer to a new instance, copy of this.

Implements ossimProjection.

Definition at line 68 of file ossimAlosPalsarModel.cpp.

References ossimAlosPalsarModel().

69  {
70  return new ossimAlosPalsarModel(*this);
71  }

◆ findAlosPalsarData()

ossimFilename ossimplugins::ossimAlosPalsarModel::findAlosPalsarData ( const ossimFilename file) const
privatevirtual

Definition at line 766 of file ossimAlosPalsarModel.cpp.

References ossimFilename::exists(), ossimFilename::fileNoExtension(), ossimString::replace(), ossimFilename::setFile(), ossimString::size(), and ossimString::substr().

Referenced by open().

767  {
768  ossimFilename dataFile = file;
769  ossimString imgPrefix("IMG-HH"); // Assume the ALOS data always has at least the HH
770  ossimString trlPrefix("TRL");
771  ossimString volPrefix("VOL");
772  ossimString leaPrefix("LED");
773 
774  ossimString filename = file.fileNoExtension();
775  ossimString prefix = filename.substr(0, 3);
776  if ((prefix == leaPrefix) ||
777  (prefix == trlPrefix) ||
778  (prefix == volPrefix))
779  {
780  // Find the 2nd dash from the end of the string
781  // since ALOS files are of the form
782  // <prefix>-ALPSRP<identifier>-H<n.n>__A
783  filename.replace(0, prefix.size(), imgPrefix);
784 
785  dataFile.setFile(filename);
786  if (dataFile.exists())
787  {
788  return dataFile;
789  }
790  }
791  return file;
792  }
ossimFilename & setFile(const ossimString &f)
bool exists() const
std::string::size_type size() const
Definition: ossimString.h:405
ossimFilename fileNoExtension() const
std::string & replace(std::string::size_type pos, std::string::size_type n, const std::string &s)
Replaces a substring of *this with the string s.
Definition: ossimString.h:870
std::string substr(std::string::size_type pos=0, std::string::size_type n=std::string::npos) const
Equivalent to basic_string(*this, pos, n).
Definition: ossimString.h:910

◆ findAlosPalsarLeader()

ossimFilename ossimplugins::ossimAlosPalsarModel::findAlosPalsarLeader ( const ossimFilename file) const
privatevirtual

Definition at line 704 of file ossimAlosPalsarModel.cpp.

References ossimFilename::exists(), ossimFilename::fileNoExtension(), ossimString::replace(), ossimFilename::setFile(), ossimString::size(), and ossimString::substr().

Referenced by open().

705  {
706  ossimFilename leaFile = file;
707  ossimString imgPrefix("IMG");
708  ossimString trlPrefix("TRL");
709  ossimString volPrefix("VOL");
710  ossimString leaPrefix("LED");
711 
712  ossimString filename = file.fileNoExtension();
713  ossimString prefix = filename.substr(0, 3);
714 
715  if ((prefix == imgPrefix) ||
716  (prefix == trlPrefix) ||
717  (prefix == volPrefix))
718  {
719  // Find the 2nd dash from the end of the string
720  // since ALOS files are of the form
721  // <prefix>-ALPSRP<identifier>-H<n.n>__A
722  filename.replace(0, prefix.size(), leaPrefix);
723 
724  leaFile.setFile(filename);
725  if (leaFile.exists())
726  {
727  return leaFile;
728  }
729  }
730  return file;
731  }
ossimFilename & setFile(const ossimString &f)
bool exists() const
std::string::size_type size() const
Definition: ossimString.h:405
ossimFilename fileNoExtension() const
std::string & replace(std::string::size_type pos, std::string::size_type n, const std::string &s)
Replaces a substring of *this with the string s.
Definition: ossimString.h:870
std::string substr(std::string::size_type pos=0, std::string::size_type n=std::string::npos) const
Equivalent to basic_string(*this, pos, n).
Definition: ossimString.h:910

◆ getClassName()

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

Method to return the class name.

Returns
The name of this class.

Reimplemented from ossimObject.

Definition at line 63 of file ossimAlosPalsarModel.cpp.

Referenced by loadState().

64  {
65  return ossimString("ossimAlosPalsarModel");
66  }

◆ getSlantRangeFromGeoreferenced()

double ossimplugins::ossimAlosPalsarModel::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 73 of file ossimAlosPalsarModel.cpp.

74  {
75  std::cout << "WARNING: getSlantRangeFromGeoreferenced not implemented for AlosPalsar" << std::endl;
76  return 0.0;
77  }

◆ InitPlatformPosition()

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

Initializes the Platform Position from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 394 of file ossimAlosPalsarModel.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().

395  {
396  // const double PI = 3.14159265358979323846 ;
397  CivilDateTime ref_civil_date;
398  /*
399  * Ephemerisis reference date retrieval
400  */
401  const char* eph_year_str = kwl.find(prefix, "eph_year");
402  int eph_year = atoi(eph_year_str);
403  const char* eph_month_str = kwl.find(prefix, "eph_month");
404  int eph_month = atoi(eph_month_str);
405  const char* eph_day_str = kwl.find(prefix, "eph_day");
406  int eph_day = atoi(eph_day_str);
407  const char* eph_sec_str = kwl.find(prefix, "eph_sec");
408  double eph_sec = atof(eph_sec_str);
409 
410 
411  ref_civil_date.set_year(eph_year);
412  ref_civil_date.set_month(eph_month);
413  ref_civil_date.set_day(eph_day);
414  ref_civil_date.set_second((int)eph_sec);
415  ref_civil_date.set_decimal(eph_sec - (double)((int)eph_sec));
416 
417  JSDDateTime ref_jsd_date(ref_civil_date);
418 
419  /*
420  * Ephemerisis time interval retrieval
421  */
422  const char* eph_int_str = kwl.find(prefix, "eph_int");
423  double eph_int = atof(eph_int_str);
424  /*
425  * Ephemerisis number retrieval
426  */
427  const char* neph_str = kwl.find(prefix, "neph");
428  int neph = atoi(neph_str);
429 
430  Ephemeris** ephemeris = new Ephemeris*[neph];
431 
432  /*
433  * Ephemerisis retrieval
434  */
435  for (int i = 0; i < neph; i++)
436  {
437  double pos[3];
438  double vit[3];
439  char name[64];
440 
441 
442  sprintf(name, "eph%i_posX", i);
443  const char* px_str = kwl.find(prefix, name);
444  pos[0] = atof(px_str);
445 
446  sprintf(name, "eph%i_posY", i);
447  const char* py_str = kwl.find(prefix, name);
448  pos[1] = atof(py_str);
449 
450  sprintf(name, "eph%i_posZ", i);
451  const char* pz_str = kwl.find(prefix, name);
452  pos[2] = atof(pz_str);
453 
454 
455  sprintf(name, "eph%i_velX", i);
456  const char* vx_str = kwl.find(prefix, name);
457  vit[0] = atof(vx_str);
458 
459  sprintf(name, "eph%i_velY", i);
460  const char* vy_str = kwl.find(prefix, name);
461  vit[1] = atof(vy_str);
462 
463  sprintf(name, "eph%i_velZ", i);
464  const char* vz_str = kwl.find(prefix, name);
465  vit[2] = atof(vz_str);
466 
467  /*
468  * Ephemerisis date
469  */
470  JSDDateTime date(ref_jsd_date);
471  date.set_second(date.get_second() + i * eph_int);
472  date.NormDate();
473 
474  GeographicEphemeris* eph = new GeographicEphemeris(date, pos, vit);
475 
476  ephemeris[i] = eph;
477  }
478 
479  /*
480  * Antenna position interpolator creation
481  */
482  if (_platformPosition != NULL)
483  {
484  delete _platformPosition;
485  }
486  _platformPosition = new PlatformPosition(ephemeris, neph);
487 
488  /*
489  * Free of memory used by the ephemerisis list
490  */
491  for (int i = 0; i < neph; i++)
492  {
493  delete ephemeris[i];
494  }
495  delete[] ephemeris;
496 
497  return true;
498  }
const char * find(const char *key) const
PlatformPosition * _platformPosition
Handle the position of the platform.

◆ InitRefPoint()

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

Initializes the Reference Point from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 500 of file ossimAlosPalsarModel.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::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().

501  {
502  const char* sc_lin_str = kwl.find(prefix, "sc_lin");
503  double sc_lin = atof(sc_lin_str);
504 
505  const char* sc_pix_str = kwl.find(prefix, "sc_pix");
506  double sc_pix = atof(sc_pix_str);
507 
508  const char* inp_sctim_str = kwl.find(prefix, "inp_sctim");
509 
510  // Not available for ALOS
511  //const char* rng_gate_str = kwl.find(prefix,"zero_dop_range_time_f_pixel");
512  //double rng_gate = atof(rng_gate_str);
513 
514  if (_refPoint == NULL)
515  {
516  _refPoint = new RefPoint();
517  }
518 
519  _refPoint->set_pix_col(sc_pix);
520  _refPoint->set_pix_line(sc_lin);
521 
522  char year_str[5];
523  for (int i = 0; i < 4; i++)
524  {
525  year_str[i] = inp_sctim_str[i];
526  }
527  year_str[4] = '\0';
528 
529  char month_str[3];
530  for (int i = 4; i < 6; i++)
531  {
532  month_str[i-4] = inp_sctim_str[i];
533  }
534  month_str[2] = '\0';
535 
536  char day_str[3];
537  for (int i = 6; i < 8; i++)
538  {
539  day_str[i-6] = inp_sctim_str[i];
540  }
541  day_str[2] = '\0';
542 
543  char hour_str[3];
544  for (int i = 8; i < 10; i++)
545  {
546  hour_str[i-8] = inp_sctim_str[i];
547  }
548  hour_str[2] = '\0';
549 
550  char min_str[3];
551  for (int i = 10; i < 12; i++)
552  {
553  min_str[i-10] = inp_sctim_str[i];
554  }
555  min_str[2] = '\0';
556 
557  char sec_str[3];
558  for (int i = 12; i < 14; i++)
559  {
560  sec_str[i-12] = inp_sctim_str[i];
561  }
562  sec_str[2] = '\0';
563 
564  char mili_str[4];
565  for (int i = 14; i < 17; i++)
566  {
567  mili_str[i-14] = inp_sctim_str[i];
568  }
569  mili_str[3] = '\0';
570 
571  int year = atoi(year_str);
572  int month = atoi(month_str);
573  int day = atoi(day_str);
574  int hour = atoi(hour_str);
575  int min = atoi(min_str);
576  int sec = atoi(sec_str);
577  double mili = atof(mili_str);
578 
579 
580  CivilDateTime date(year, month, day, hour * 3600 + min * 60 + sec, mili / 1000.0);
581 
582  if (_platformPosition != NULL)
583  {
584  Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)date);
585  if (ephemeris == NULL) return false ;
586  _refPoint->set_ephemeris(ephemeris);
587 
588  delete ephemeris;
589  }
590  else
591  {
592  return false;
593  }
594 
595  const double c = 2.99792458e+8;
596 
597  const char* slantRange = kwl.find(prefix, "slant_range_to_1st_data_sample");
598  double distance = atof(slantRange) + static_cast<double>(sc_pix) * _sensor->get_nRangeLook() / _sensor->get_sf() * c / 2.0;
599 
601 
602  // in order to use ossimSensorModel::lineSampleToWorld
603  const char* nbCol_str = kwl.find(prefix, "num_pix_in_line");
604  const char* nbLin_str = kwl.find(prefix, "num_lines");
605  theImageSize.x = atoi(nbCol_str);
606  theImageSize.y = atoi(nbLin_str);
608 
609 // AlosPalsarModel currently does not handle GCPs
610  /* Do not use GCPs for now
611  // Ground Control Points extracted from the model : corner points
612  std::list<ossimGpt> groundGcpCoordinates ;
613  std::list<ossimDpt> imageGcpCoordinates ;
614  // first line first pix
615  const char* lon_str = kwl.find("first_line_first_pixel_lon");
616  double lon = atof(lon_str);
617  const char* lat_str = kwl.find("first_line_first_pixel_lat");
618  double lat = atof(lat_str);
619  if (lon > 180.0) lon -= 360.0;
620  ossimDpt imageGCP1(0,0);
621  ossimGpt groundGCP1(lat, lon, 0.0);
622  groundGcpCoordinates.push_back(groundGCP1) ;
623  imageGcpCoordinates.push_back(imageGCP1) ;
624  // first line last pix
625  lon_str = kwl.find("first_line_last_pixel_lon");
626  lon = atof(lon_str);
627  lat_str = kwl.find("first_line_last_pixel_lat");
628  lat = atof(lat_str);
629  if (lon > 180.0) lon -= 360.0;
630  ossimDpt imageGCP2(theImageSize.x-1, 0);
631  ossimGpt groundGCP2(lat, lon, 0.0);
632  groundGcpCoordinates.push_back(groundGCP2) ;
633  imageGcpCoordinates.push_back(imageGCP2) ;
634  // last line last pix
635  lon_str = kwl.find("last_line_last_pixel_lon");
636  lon = atof(lon_str);
637  lat_str = kwl.find("last_line_last_pixel_lat");
638  lat = atof(lat_str);
639  if (lon > 180.0) lon -= 360.0;
640  ossimDpt imageGCP3(theImageSize.x-1,theImageSize.y-1);
641  ossimGpt groundGCP3(lat, lon, 0.0);
642  groundGcpCoordinates.push_back(groundGCP3) ;
643  imageGcpCoordinates.push_back(imageGCP3) ;
644  // last line first pix
645  lon_str = kwl.find("last_line_first_pixel_lon");
646  lon = atof(lon_str);
647  lat_str = kwl.find("last_line_first_pixel_lat");
648  lat = atof(lat_str);
649  if (lon > 180.0) lon -= 360.0;
650  ossimDpt imageGCP4(0,theImageSize.y-1);
651  ossimGpt groundGCP4(lat, lon, 0.0);
652  groundGcpCoordinates.push_back(groundGCP4) ;
653  imageGcpCoordinates.push_back(imageGCP4) ;
654 
655  // Default optimization
656  optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ;
657  */
658 
659  return true;
660  }
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
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::ossimAlosPalsarModel::InitSensorParams ( const ossimKeywordlist kwl,
const char *  prefix 
)
protectedvirtual

Initializes the Sensor Params from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 79 of file ossimAlosPalsarModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_sensor, ossimKeywordlist::find(), ossimplugins::SensorParams::Right, ossimplugins::SensorParams::set_col_direction(), ossimplugins::SensorParams::set_dopcen(), ossimplugins::SensorParams::set_dopcenLinear(), 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().

80  {
81  const char* wave_length_str = kwl.find(prefix, "wave_length");
82  double wave_length = atof(wave_length_str);
83  const char* fr_str = kwl.find(prefix, "fr");
84  double fr = atof(fr_str) * 1e6;
85  const char* fa_str = kwl.find(prefix, "fa");
86  double fa = atof(fa_str);
87 
88  ossimString time_dir_pix = kwl.find(prefix, "time_dir_pix");
89  time_dir_pix.upcase();
90  //std::transform(time_dir_pix.begin(), time_dir_pix.end(), time_dir_pix.begin(), toupper);
91  ossimString time_dir_lin = kwl.find(prefix, "time_dir_lin");
92  time_dir_lin.upcase();
93  //std::transform(time_dir_lin.begin(), time_dir_lin.end(), time_dir_lin.begin(), toupper);
94 
95  //ellipsoid parameters
96  const char* ellip_maj_str = kwl.find(prefix, "ellip_maj");
97  double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m
98  const char* ellip_min_str = kwl.find(prefix, "ellip_min");
99  double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m
100 
101  const char* dopcen_str = kwl.find(prefix, "dopcen_range[0]");
102  double dopcen = atof(dopcen_str);
103  const char* dopcenLinear_str = kwl.find(prefix, "dopcen_range[1]");
104  double dopcenLinear = atof(dopcenLinear_str);
105 
106  if (_sensor != NULL)
107  {
108  delete _sensor;
109  }
110 
111  _sensor = new SensorParams();
112 
113  /*
114  if(strcmp(time_dir_pix.c_str(), "INCREASE") == 0)
115  {
116  _sensor->set_col_direction(1);
117  }
118  else
119  {
120  _sensor->set_col_direction(-1);
121  }
122  */
123  // WARNING: _col_direction hard-coded to 1, as level 1.0 image is not flipped.
125 
126  // TODO: Have to verify whether the time direction indicator should be always positive
127  /*
128  if(strcmp(time_dir_lin.c_str(), "INCREASE") == 0)
129  {
130  _sensor->set_lin_direction(1);
131  }
132  else
133  {
134  _sensor->set_lin_direction(-1);
135  }
136  */
138 
140 
141  double nlooks_az = atof(kwl.find(prefix, "nlooks_az"));
142  _sensor->set_nAzimuthLook(nlooks_az);
143  double n_rnglok = atof(kwl.find(prefix, "n_rnglok"));
144  _sensor->set_nRangeLook(n_rnglok);
145 
146  _sensor->set_prf(fa / 1000.); // For ALOS, the fa value in the leader file is in units of mHz
147  _sensor->set_sf(fr);
148  _sensor->set_rwl(wave_length);
149 
150  _sensor->set_semiMajorAxis(ellip_maj) ;
151  _sensor->set_semiMinorAxis(ellip_min) ;
152 
153  _sensor->set_dopcen(dopcen);
154  _sensor->set_dopcenLinear(dopcenLinear);
155 
156  return true;
157  }
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
void set_dopcen(double value)
Definition: SensorParams.h:173
void set_dopcenLinear(double value)
Definition: SensorParams.h:178
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
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::ossimAlosPalsarModel::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 664 of file ossimAlosPalsarModel.cpp.

665  {
666  // TODO Add user warning and reference to ERS Model
667  return false;
668  }

◆ isAlosPalsarData()

bool ossimplugins::ossimAlosPalsarModel::isAlosPalsarData ( const ossimFilename file) const
privatevirtual

Definition at line 733 of file ossimAlosPalsarModel.cpp.

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

Referenced by open().

734  {
735  std::ifstream candidate(file.c_str(), ios::in | ios::binary);
736  char alosFileName[16];
737 
738  candidate.seekg(48);
739  if (candidate.bad() || candidate.eof())
740  {
741  return false;
742  }
743  candidate.read(alosFileName, 16);
744  if (candidate.bad() || candidate.eof())
745  {
746  return false;
747  }
748  candidate.close();
749 
750  ossimString ersString(alosFileName);
751 
752  if ((ersString.find("AL1 ") == 0) &&
753  (ersString.find("PSR") == 4) &&
754  (ersString.find("IMOP") == 8))
755  {
756  return true;
757  }
758  else
759  {
760  return false;
761  }
762 
763  return true;
764  }
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

◆ isAlosPalsarLeader()

bool ossimplugins::ossimAlosPalsarModel::isAlosPalsarLeader ( const ossimFilename file) const
privatevirtual

Definition at line 670 of file ossimAlosPalsarModel.cpp.

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

Referenced by open().

671  {
672  std::ifstream candidate(file.c_str(), ios::in | ios::binary);
673  char alosFileName[16];
674 
675  candidate.seekg(48);
676  if (candidate.bad() || candidate.eof())
677  {
678  return false;
679  }
680  candidate.read(alosFileName, 16);
681  if (candidate.bad() || candidate.eof())
682  {
683  return false;
684  }
685  candidate.close();
686 
687  ossimString ersString(alosFileName);
688 
689  if ((ersString.find("AL1 ") == 0) &&
690  (ersString.find("PSR") == 4) &&
691  (ersString.find("SARL") == 8))
692  {
693  return true;
694  }
695  else
696  {
697  return false;
698  }
699 
700  return true;
701 
702  }
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::ossimAlosPalsarModel::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 308 of file ossimAlosPalsarModel.cpp.

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

Referenced by open().

309  {
310  static const char MODULE[] = "ossimAlosPalsarModel::loadState";
311 
312  if (traceDebug())
313  {
314  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
315  }
316 
317  const char* lookup = 0;
318  ossimString s;
319 
320  // Check the type first.
321  lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
322  if (lookup)
323  {
324  s = lookup;
325  if (s != getClassName())
326  {
327  return false;
328  }
329  }
330 
331  // Load the base class.
332 // bool result = ossimGeometricSarSensorModel::loadState(kwl, prefix);
333  bool result = false;
334  result = InitPlatformPosition(kwl, prefix);
335  if (!result)
336  {
337  if (traceDebug())
338  {
340  << MODULE
341  << "\nCan't init platform position \n";
342  }
343  }
344 
345  if (result)
346  {
347  result = InitSensorParams(kwl, prefix);
348  if (!result)
349  {
350  if (traceDebug())
351  {
353  << MODULE
354  << "\nCan't init sensor parameters \n";
355  }
356  }
357  }
358 
359  if (result)
360  {
361  result = InitRefPoint(kwl, prefix);
362  if (!result)
363  {
364  if (traceDebug())
365  {
367  << MODULE
368  << "\nCan't init ref point \n";
369  }
370  }
371  }
372 
373 // Products georeferenced to ground range are not handled in AlosPalsarModel
374  _isProductGeoreferenced = false;
375  /*
376  if (result)
377  {
378  result = InitSRGR(kwl, prefix);
379  if (!result)
380  {
381  if (traceDebug())
382  {
383  ossimNotify(ossimNotifyLevel_WARN)
384  << MODULE
385  << "\nCan't init ref point \n";
386  }
387  }
388  }
389  */
390 
391  return result;
392  }
virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Sensor Params from a projection keywordlist.
virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Reference Point from a projection keywordlist.
const char * find(const char *key) const
static const char * TYPE_KW
virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Platform Position from a projection keywordlist.
bool _isProductGeoreferenced
True iff the product is ground range.
virtual ossimString getClassName() const
Method to return the class name.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ open()

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

Method to instantiate model from the leader file.

Parameters
file
Returns
true on success, false on error.

Definition at line 159 of file ossimAlosPalsarModel.cpp.

References ossimString::c_str(), ossimFilename::exists(), findAlosPalsarData(), findAlosPalsarLeader(), isAlosPalsarData(), isAlosPalsarLeader(), loadState(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimplugins::ossimGeometricSarSensorModel::print(), saveState(), theAlosPalsarData, and theAlosPalsarLeader.

160  {
161  static const char MODULE[] = "ossimAlosPalsarModel::open";
162 
163  if (traceDebug())
164  {
166  << MODULE << " entered...\n"
167  << "file: " << file << "\n";
168  }
169 
170  bool result = false;
171  ossimFilename leaFilename = file;
172  ossimFilename datFilename;
173 
174  /*
175  * Creation of the class allowing to store Leader file metadata
176  */
177  if (theAlosPalsarLeader != NULL)
178  {
179  delete theAlosPalsarLeader;
180  theAlosPalsarLeader = NULL;
181  }
182 
183  theAlosPalsarLeader = new AlosPalsarLeader();
184  theAlosPalsarData = new AlosPalsarData();
185 
186  if (leaFilename.exists())
187  {
188  result = isAlosPalsarLeader(leaFilename);
189  if (result == false)
190  {
191  leaFilename = findAlosPalsarLeader(file);
192  }
193  result = isAlosPalsarLeader(leaFilename);
194 
195  if (result == true)
196  {
197  if (traceDebug())
198  {
200  << leaFilename << " is AlosPalsar leader file..."
201  << std::endl
202  << "Begin reading Leader file" << std::endl;
203  }
204  /*
205  * Leader file data reading
206  */
207  std::ifstream leaderFile(leaFilename.c_str(), ios::in | ios::binary);
208  leaderFile >> *theAlosPalsarLeader;
209  leaderFile.close();
210 
211  if (traceDebug())
212  {
214  << "End reading Leader file" << std::endl;
215  }
216 
217  datFilename = findAlosPalsarData(leaFilename);
218  result = isAlosPalsarData(datFilename);
219  if (result == true)
220  {
221  if (traceDebug())
222  {
224  << datFilename << " is AlosPalsar data file..."
225  << std::endl
226  << "Begin reading Data file header" << std::endl;
227  }
228  /*
229  * Read header of data file for image size info
230  */
231  std::ifstream dataFile(datFilename.c_str(), ios::in | ios::binary);
232  dataFile >> *theAlosPalsarData;
233  dataFile.close();
234 
235  if (traceDebug())
236  {
238  << "End reading Data file header" << std::endl;
239  }
240  } // matches: if ( result=isAlosPalsarData(datFilename) == true )
241 
242  //To initialize the whole state, reusing saveState/loadState
243  //FIXME: This could be at the superclass level instead
244  ossimKeywordlist kwl;
245  saveState(kwl);
246  loadState(kwl);
247 
248  } // matches: if ( result=isAlosPalsarLeader(file) == True )
249 
250  } // matches: if ( file.exists() )
251 
252  if (traceDebug())
253  {
255 
257  << MODULE << " exit status = " << (result ? "true" : "false\n")
258  << std::endl;
259  }
260 
261  return result;
262 
263  }
AlosPalsarLeader * theAlosPalsarLeader
List of metadata contained in the Leader file.
AlosPalsarData * theAlosPalsarData
List of metadata contained in the Data file.
virtual ossimFilename findAlosPalsarLeader(const ossimFilename &file) const
virtual bool isAlosPalsarData(const ossimFilename &file) const
Represents serializable keyword/value map.
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
virtual ossimFilename findAlosPalsarData(const ossimFilename &file) const
bool exists() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
virtual std::ostream & print(std::ostream &out) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
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 isAlosPalsarLeader(const ossimFilename &file) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ saveState()

bool ossimplugins::ossimAlosPalsarModel::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 266 of file ossimAlosPalsarModel.cpp.

References ossimKeywordlist::add(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimplugins::AlosPalsarData::saveState(), ossimplugins::AlosPalsarLeader::saveState(), theAlosPalsarData, theAlosPalsarLeader, and ossimKeywordNames::TYPE_KW.

Referenced by open().

268  {
269  static const char MODULE[] = "ossimAlosPalsarModel::saveState";
270 
271  if (traceDebug())
272  {
273  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
274  }
275 
276  bool result;
277 
278  kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimAlosPalsarModel", true);
279 
280  if (theAlosPalsarLeader == NULL)
281  {
282  std::cout << "Error: AlosPalsarLeader is NULL" << std::endl;
283  return false;
284  }
285 
286  result = theAlosPalsarLeader->saveState(kwl);
287 
288  if (result == true)
289  {
290  if (theAlosPalsarData == NULL)
291  {
292  std::cout << "Error: AlosPalsarData is NULL" << std::endl;
293  return false;
294  }
295  result = theAlosPalsarData->saveState(kwl);
296  }
297 
298  if (traceDebug())
299  {
301  << MODULE << " exit status = " << (result ? "true" : "false\n")
302  << std::endl;
303  }
304 
305  return result;
306  }
AlosPalsarLeader * theAlosPalsarLeader
List of metadata contained in the Leader file.
AlosPalsarData * theAlosPalsarData
List of metadata contained in the Data file.
static const char * TYPE_KW
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
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

◆ theAlosPalsarData

AlosPalsarData* ossimplugins::ossimAlosPalsarModel::theAlosPalsarData
private

List of metadata contained in the Data file.

Definition at line 119 of file ossimAlosPalsarModel.h.

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

◆ theAlosPalsarLeader

AlosPalsarLeader* ossimplugins::ossimAlosPalsarModel::theAlosPalsarLeader
private

List of metadata contained in the Leader file.

Definition at line 114 of file ossimAlosPalsarModel.h.

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

◆ thePixelSpacing

double ossimplugins::ossimAlosPalsarModel::thePixelSpacing
private

Pixel spacing.

Definition at line 109 of file ossimAlosPalsarModel.h.


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