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

This class allows for direct localisation and indirect localisation using the TerraSar sensor model. More...

#include <ossimTerraSarModel.h>

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

Public Member Functions

 ossimTerraSarModel ()
 default constructor More...
 
 ossimTerraSarModel (const ossimTerraSarModel &rhs)
 copy constructor More...
 
virtual ~ossimTerraSarModel ()
 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 intantial model from a 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...
 
virtual std::ostream & print (std::ostream &out) const
 
void printInfo (ostream &os) const
 
- 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
 
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...
 

Private 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 to Ground Range data sets : _SrToGr_R0,_SrToGr_coeffs_number,_SrToGr_exponent,_SrToGr_coeffs,_nbCol. More...
 
bool initSRGR (const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &rsDoc)
 
bool initPlatformPosition (const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &rsDoc)
 
bool initSensorParams (const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &rsDoc)
 
bool initRefPoint (const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &rsDoc)
 Method to initialize RefPoint object from TerraSAR product xml file. More...
 
bool initAcquisitionInfo (const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &tsDoc)
 Method to initialize AcquisitionInfo parameters from TerraSAR product xml file. More...
 
bool initCalibration (const ossimXmlDocument *xmlDocument, const ossimTerraSarProductDoc &tsDoc)
 Method to initialize Calibration parameters from TerraSAR product xml file. More...
 
bool initSceneCoord (const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &tsDoc)
 Method to initialize InfoIncidenceAngle parameters from TerraSAR product xml file. More...
 
bool initNoise (const ossimXmlDocument *xmlDocument, const ossimTerraSarProductDoc &tsDoc)
 Method to initialize ImageNoise parameters from TerraSAR product xml file. More...
 
bool getNoiseAtGivenNode (const ossimRefPtr< ossimXmlNode > xmlDocument, ossimplugins::Noise &noise)
 Method to get ImageNoise parameters from TerraSAR product xml file at a given node. More...
 
bool findTSXLeader (const ossimFilename &file, ossimFilename &metadataFile)
 Method to find the metadata file TerraSAR file (image or xml). More...
 
bool getPolLayerFromImageFile (const ossimXmlDocument *xmlDocument, const ossimFilename &imageFilename)
 Method to find the polLayer from the image file. More...
 

Private Attributes

double _SrToGr_R0
 Slant Range TO Ground Range Projection reference point. More...
 
std::vector< int > _SrToGr_exponent
 Slant Range TO Ground Range Projection exponents. More...
 
std::vector< double > _SrToGr_coeffs
 Slant Range TO Ground Range Projection coefficients. More...
 
double _sceneCenterRangeTime
 Scene Center range time. More...
 
double _SrToGr_scaling_factor
 Slant Range TO Ground Range scaling factor at scene center. More...
 
std::vector< double > _alt_srgr_coefset
 alternative SRGR computation coefficients. More...
 
ossimString _productType
 ProductType. More...
 
ossimString _radiometricCorrection
 RadiometricCorrection. More...
 
ossimString _imagingMode
 ImagingMode (AcquisitionInfo node). More...
 
ossimString _acquisitionSensor
 Sensor (AcquisitionInfo node). More...
 
ossimString _lookDirection
 LookDirection (AcquisitionInfo node). More...
 
ossimString _polarisationMode
 PolarisationMode (AcquisitionInfo node). More...
 
ossimString _polLayer
 PolLayer (AcquisitionInfo node). More...
 
std::vector< ossimString_polLayerList
 
std::vector< Noise_noise
 Noise (Noise node). More...
 
SceneCoord_sceneCoord
 SceneCoord (SceneInfo node) More...
 
std::vector< double > _calFactor
 CalFactor (Calibration node). More...
 
double _radarFrequency
 centerFrequency (instrument node). More...
 
ossim_uint32 _numberOfLayers
 number of layer (ImageDataInfo node). More...
 
ossimString _azStartTime
 Azimuthal Start Time (Start acquisition time). More...
 
ossimString _azStopTime
 Azimuthal Stop Time (Start acquisition time). More...
 
ossimString _rgFirstPixelTime
 First pixel Range Time (Start acquisition time in range direction). More...
 
ossimString _rgLastPixelTime
 Last pixel Range Time (Start acquisition time in range direction). More...
 
ossimString _generationTime
 Generation time. More...
 
ossimFilename theProductXmlFile
 

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 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...
 
- 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 allows for direct localisation and indirect localisation using the TerraSar sensor model.

Definition at line 42 of file ossimTerraSarModel.h.

Constructor & Destructor Documentation

◆ ossimTerraSarModel() [1/2]

ossimplugins::ossimTerraSarModel::ossimTerraSarModel ( )

default constructor

Definition at line 74 of file ossimTerraSarModel.cpp.

76  _SrToGr_R0(0.0),
82  _productType(),
84  _imagingMode(),
88  _polLayer("UNDEFINED"),
89  _polLayerList(),
90  _noise(0),
91  _sceneCoord(0),
92  _calFactor(0.),
93  _radarFrequency(0.),
94  _numberOfLayers(0),
95  _azStartTime(),
96  _azStopTime(),
100 {
101 }
ossimString _rgLastPixelTime
Last pixel Range Time (Start acquisition time in range direction).
double _sceneCenterRangeTime
Scene Center range time.
double _radarFrequency
centerFrequency (instrument node).
ossimString _rgFirstPixelTime
First pixel Range Time (Start acquisition time in range direction).
ossim_uint32 _numberOfLayers
number of layer (ImageDataInfo node).
ossimString _acquisitionSensor
Sensor (AcquisitionInfo node).
ossimString _radiometricCorrection
RadiometricCorrection.
ossimString _generationTime
Generation time.
std::vector< double > _alt_srgr_coefset
alternative SRGR computation coefficients.
ossimString _azStartTime
Azimuthal Start Time (Start acquisition time).
ossimString _azStopTime
Azimuthal Stop Time (Start acquisition time).
double _SrToGr_scaling_factor
Slant Range TO Ground Range scaling factor at scene center.
ossimString _lookDirection
LookDirection (AcquisitionInfo node).
ossimString _productType
ProductType.
ossimString _polLayer
PolLayer (AcquisitionInfo node).
std::vector< double > _calFactor
CalFactor (Calibration node).
std::vector< ossimString > _polLayerList
std::vector< Noise > _noise
Noise (Noise node).
std::vector< int > _SrToGr_exponent
Slant Range TO Ground Range Projection exponents.
ossimString _imagingMode
ImagingMode (AcquisitionInfo node).
std::vector< double > _SrToGr_coeffs
Slant Range TO Ground Range Projection coefficients.
ossimString _polarisationMode
PolarisationMode (AcquisitionInfo node).
SceneCoord * _sceneCoord
SceneCoord (SceneInfo node)
double _SrToGr_R0
Slant Range TO Ground Range Projection reference point.

◆ ossimTerraSarModel() [2/2]

ossimplugins::ossimTerraSarModel::ossimTerraSarModel ( const ossimTerraSarModel rhs)

copy constructor

Definition at line 103 of file ossimTerraSarModel.cpp.

References _sceneCoord.

106  _SrToGr_R0(rhs._SrToGr_R0),
107  _SrToGr_exponent(rhs._SrToGr_exponent),
108  _SrToGr_coeffs(rhs._SrToGr_coeffs),
109  _sceneCenterRangeTime(rhs._sceneCenterRangeTime),
110  _SrToGr_scaling_factor(rhs._SrToGr_scaling_factor),
111  _alt_srgr_coefset(rhs._alt_srgr_coefset),
112  _productType(rhs._productType),
113  _radiometricCorrection(rhs._radiometricCorrection),
114  _imagingMode(rhs._imagingMode),
115  _acquisitionSensor(rhs._acquisitionSensor),
116  _lookDirection(rhs._lookDirection),
117  _polarisationMode(rhs._polarisationMode),
118  _polLayer(rhs._polLayer),
119  _polLayerList(rhs._polLayerList),
120  _noise(rhs._noise),
121  _sceneCoord( 0 ),
122  _calFactor(rhs._calFactor),
123  _radarFrequency(rhs._radarFrequency),
124  _numberOfLayers(rhs._numberOfLayers),
125  _azStartTime(rhs._azStartTime),
126  _azStopTime(rhs._azStopTime),
127  _rgFirstPixelTime(rhs._rgFirstPixelTime),
128  _rgLastPixelTime(rhs._rgLastPixelTime),
129  _generationTime(rhs._generationTime)
130 {
131  if ( rhs._sceneCoord )
132  {
133  _sceneCoord = new SceneCoord( *(rhs._sceneCoord) );
134  }
135 }
ossimString _rgLastPixelTime
Last pixel Range Time (Start acquisition time in range direction).
double _sceneCenterRangeTime
Scene Center range time.
double _radarFrequency
centerFrequency (instrument node).
ossimString _rgFirstPixelTime
First pixel Range Time (Start acquisition time in range direction).
ossim_uint32 _numberOfLayers
number of layer (ImageDataInfo node).
ossimString _acquisitionSensor
Sensor (AcquisitionInfo node).
ossimString _radiometricCorrection
RadiometricCorrection.
ossimString _generationTime
Generation time.
std::vector< double > _alt_srgr_coefset
alternative SRGR computation coefficients.
ossimString _azStartTime
Azimuthal Start Time (Start acquisition time).
ossimString _azStopTime
Azimuthal Stop Time (Start acquisition time).
double _SrToGr_scaling_factor
Slant Range TO Ground Range scaling factor at scene center.
ossimString _lookDirection
LookDirection (AcquisitionInfo node).
ossimString _productType
ProductType.
ossimString _polLayer
PolLayer (AcquisitionInfo node).
std::vector< double > _calFactor
CalFactor (Calibration node).
std::vector< ossimString > _polLayerList
std::vector< Noise > _noise
Noise (Noise node).
std::vector< int > _SrToGr_exponent
Slant Range TO Ground Range Projection exponents.
ossimString _imagingMode
ImagingMode (AcquisitionInfo node).
std::vector< double > _SrToGr_coeffs
Slant Range TO Ground Range Projection coefficients.
ossimString _polarisationMode
PolarisationMode (AcquisitionInfo node).
SceneCoord * _sceneCoord
SceneCoord (SceneInfo node)
double _SrToGr_R0
Slant Range TO Ground Range Projection reference point.

◆ ~ossimTerraSarModel()

ossimplugins::ossimTerraSarModel::~ossimTerraSarModel ( )
virtual

Destructor.

Definition at line 137 of file ossimTerraSarModel.cpp.

138 {
139  _noise.clear();
140 
141 /*
142  * if (_noise != 0)
143  {
144  delete _noise;
145  }
146 */
147  if (_sceneCoord)
148  {
149  delete _sceneCoord;
150  _sceneCoord = 0;
151  }
152 }
std::vector< Noise > _noise
Noise (Noise node).
SceneCoord * _sceneCoord
SceneCoord (SceneInfo node)

Member Function Documentation

◆ dup()

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

Returns pointer to a new instance, copy of this.

Implements ossimProjection.

Definition at line 159 of file ossimTerraSarModel.cpp.

160 {
161  return new ossimTerraSarModel(*this);
162 }
ossimTerraSarModel()
default constructor

◆ findTSXLeader()

bool ossimplugins::ossimTerraSarModel::findTSXLeader ( const ossimFilename file,
ossimFilename metadataFile 
)
private

Method to find the metadata file TerraSAR file (image or xml).

Parameters
fileimage or metadata path.
metadataFilematadata path.
Returns
ture if mateadata found, false otherwise.

Definition at line 2373 of file ossimTerraSarModel.cpp.

References ossimString::beforePos(), ossimString::downcase(), ossimString::empty(), ossimFilename::exists(), ossimFilename::ext(), ossimFilename::file(), ossimDirectory::findAllFilesThatMatch(), ossimEnvironmentUtility::getCurrentWorkingDir(), ossimEnvironmentUtility::instance(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimFilename::path(), and ossim_hdf5::print().

2375 {
2376  bool res = false;
2377 
2378  if ( file.exists() && (file.ext().downcase() == "xml") )
2379  {
2380  metadataFile = file;
2381  res = true;
2382  }
2383  else if (!file.exists())
2384  {
2385  res = false;
2386  }
2387  else
2388  {
2389  if (traceDebug())
2390  {
2392  << "ossimplugins::ossimTerraSarModel::findTSXLeader "
2393  << " directory scan turned off. This is killing the factory open."
2394  << " We should never scan a directory. Need to resolve. "
2395  << std::endl;
2396  }
2397 
2398 #if 0
2399  ossimFilename imagePath = file.path();
2400  if (imagePath.empty())
2402 
2403  ossimDirectory directory = ossimDirectory(imagePath.path());
2404  std::vector<ossimFilename> vectName;
2405  ossimString reg = ".xml";
2406  directory.findAllFilesThatMatch( vectName, reg, 1 );
2407 
2408  bool goodFileFound = false;
2409  unsigned int loop = 0;
2410  while(loop<vectName.size() && !goodFileFound)
2411  {
2412  ossimFilename curFile = vectName[loop];
2413  if(curFile.file().beforePos(3) == ossimString("TSX"))
2414  goodFileFound = true;
2415  else
2416  loop++;
2417  }
2418  if(goodFileFound)
2419  {
2420  metadataFile = vectName[loop];
2421  res = true;
2422  }
2423  else
2424  {
2425  if (traceDebug())
2426  {
2427  if (res)
2428  {
2430  }
2431 
2433  << "ossimplugins::ossimTerraSarModel::findTSXLeader "
2434  << " exit status = " << (res?"true":"false\n")
2435  << std::endl;
2436  }
2437  }
2438 #endif
2439  }
2440 
2441  return res;
2442 }
virtual std::ostream & print(std::ostream &out) const
void findAllFilesThatMatch(std::vector< ossimFilename > &result, const ossimString &regularExpressionPattern, int flags=OSSIM_DIR_DEFAULT)
ossimFilename getCurrentWorkingDir() const
bool exists() const
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
static ossimEnvironmentUtility * instance()
ossimString beforePos(std::string::size_type pos) const
bool empty() const
Definition: ossimString.h:411
ossimFilename file() const
ossimString ext() const
ossimFilename path() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getClassName()

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

Method to return the class name.

Returns
The name of this class.

Reimplemented from ossimObject.

Definition at line 154 of file ossimTerraSarModel.cpp.

155 {
156  return ossimString("ossimTerraSarModel");
157 }

◆ getNoiseAtGivenNode()

bool ossimplugins::ossimTerraSarModel::getNoiseAtGivenNode ( const ossimRefPtr< ossimXmlNode xmlDocument,
ossimplugins::Noise noise 
)
private

Method to get ImageNoise parameters from TerraSAR product xml file at a given node.

Parameters
xdocOpened product xml file.
Returns
true on success, false on error.

Definition at line 1889 of file ossimTerraSarModel.cpp.

References ossimString::begin(), ossimXmlNode::findChildNodes(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimplugins::Noise::set_imageNoise(), ossimplugins::Noise::set_numberOfNoiseRecords(), ossimplugins::ImageNoise::set_polynomialCoefficients(), ossimplugins::ImageNoise::set_polynomialDegree(), ossimplugins::ImageNoise::set_referencePoint(), ossimplugins::ImageNoise::set_timeUTC(), ossimplugins::ImageNoise::set_validityRangeMax(), and ossimplugins::ImageNoise::set_validityRangeMin().

1891 {
1892  ossimString xpath;
1893  std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1894  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
1895  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
1896 
1897  std::vector<ImageNoise> tabImageNoise;
1898  ImageNoise ev;
1899  tabImageNoise.clear();
1900 
1901  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::getNoise";
1902 
1903  if (traceDebug())
1904  {
1905  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entered...\n";
1906  }
1907 
1908  if ( !xmlDocument )
1909  {
1910  setErrorStatus();
1911  if(traceDebug())
1912  {
1914  << MODULE << " DEBUG: one of the getNoise parameter of the method is NULL" << std::endl;
1915  }
1916  return false;
1917  }
1918 
1919  xml_nodes.clear();
1920  xpath = "numberOfNoiseRecords";
1921  xmlDocument->findChildNodes(xpath, xml_nodes);
1922  if(xml_nodes.size() == 0)
1923  {
1924  setErrorStatus();
1925  if(traceDebug())
1926  {
1928  << MODULE << " DEBUG:"
1929  << "\nCould not find: " << xpath
1930  << std::endl;
1931  }
1932  return false;
1933  }
1934 
1935  noise.set_numberOfNoiseRecords( xml_nodes[0]->getText().toInt32() );
1936 
1937 
1938  xml_nodes.clear();
1939  xpath = "imageNoise";
1940  xmlDocument->findChildNodes(xpath, xml_nodes);
1941  if(xml_nodes.size() == 0)
1942  {
1943  setErrorStatus();
1944  if(traceDebug())
1945  {
1947  << MODULE << " DEBUG:"
1948  << "\nCould not find: " << xpath
1949  << std::endl;
1950  }
1951  return false;
1952  }
1953 
1954  node = xml_nodes.begin();
1955  while (node != xml_nodes.end())
1956  {
1957  sub_nodes.clear();
1958  xpath = "timeUTC";
1959  (*node)->findChildNodes(xpath, sub_nodes);
1960  if (sub_nodes.size() == 0)
1961  {
1962  setErrorStatus();
1963  if(traceDebug())
1964  {
1966  << MODULE << " DEBUG:"
1967  << "\nCould not find: " << xpath
1968  << std::endl;
1969  }
1970  return false;
1971  }
1972  ev.set_timeUTC(sub_nodes[0]->getText());
1973 
1974  sub_nodes.clear();
1975  xpath = "noiseEstimate/validityRangeMin";
1976  (*node)->findChildNodes(xpath, sub_nodes);
1977  if (sub_nodes.size() == 0)
1978  {
1979  setErrorStatus();
1980  if(traceDebug())
1981  {
1983  << MODULE << " DEBUG:"
1984  << "\nCould not find: " << xpath
1985  << std::endl;
1986  }
1987  return false;
1988  }
1989  ev.set_validityRangeMin( sub_nodes[0]->getText().toDouble() );
1990 
1991  sub_nodes.clear();
1992  xpath = "noiseEstimate/validityRangeMax";
1993  (*node)->findChildNodes(xpath, sub_nodes);
1994  if (sub_nodes.size() == 0)
1995  {
1996  setErrorStatus();
1997  if(traceDebug())
1998  {
2000  << MODULE << " DEBUG:"
2001  << "\nCould not find: " << xpath
2002  << std::endl;
2003  }
2004  return false;
2005  }
2006  ev.set_validityRangeMax( sub_nodes[0]->getText().toDouble() );
2007 
2008  sub_nodes.clear();
2009  xpath = "noiseEstimate/referencePoint";
2010  (*node)->findChildNodes(xpath, sub_nodes);
2011  if (sub_nodes.size() == 0)
2012  {
2013  setErrorStatus();
2014  if(traceDebug())
2015  {
2017  << MODULE << " DEBUG:"
2018  << "\nCould not find: " << xpath
2019  << std::endl;
2020  }
2021  return false;
2022  }
2023  ev.set_referencePoint( sub_nodes[0]->getText().toDouble() );
2024 
2025  sub_nodes.clear();
2026  xpath = "noiseEstimate/polynomialDegree";
2027  (*node)->findChildNodes(xpath, sub_nodes);
2028  if (sub_nodes.size() == 0)
2029  {
2030  setErrorStatus();
2031  if(traceDebug())
2032  {
2034  << MODULE << " DEBUG:"
2035  << "\nCould not find: " << xpath
2036  << std::endl;
2037  }
2038  return false;
2039  }
2040  ev.set_polynomialDegree( sub_nodes[0]->getText().toInt32() );
2041 
2042  sub_nodes.clear();
2043  ossimXmlNode::ChildListType nodelist;
2044  (*node)->findChildNodes("noiseEstimate/coefficient",nodelist);
2045  ossimXmlNode::ChildListType::const_iterator child_iter = nodelist.begin();
2046  std::vector<double> polynomialCoefficients;
2047  while(child_iter != nodelist.end())
2048  {
2049  double coefficient = ((*child_iter)->getText()).toDouble() ;
2050  polynomialCoefficients.push_back(coefficient);
2051  ++child_iter;
2052  }
2053  ev.set_polynomialCoefficients( polynomialCoefficients );
2054 
2055  tabImageNoise.push_back(ev);
2056 
2057  ++node;
2058  }
2059 
2060  noise.set_imageNoise(tabImageNoise);
2061 
2062  if (traceDebug())
2063  {
2064  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " leaving...\n";
2065  }
2066 
2067  return true;
2068 }
void clear()
Erases the entire container.
Definition: ossimString.h:432
void findChildNodes(const ossimString &rel_xpath, ossimXmlNode::ChildListType &nodelist) const
void set_imageNoise(const std::vector< ImageNoise > &image_noise)
Definition: Noise.h:75
std::vector< ossimRefPtr< ossimXmlNode > > ChildListType
Definition: ossimXmlNode.h:30
std::string::iterator begin()
Definition: ossimString.h:420
void set_numberOfNoiseRecords(const ossim_int32 &numberOfNoiseRecords)
Definition: Noise.h:71
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getPolLayerFromImageFile()

bool ossimplugins::ossimTerraSarModel::getPolLayerFromImageFile ( const ossimXmlDocument xmlDocument,
const ossimFilename imageFilename 
)
private

Method to find the polLayer from the image file.

Parameters
xdocOpened product xml file.
fileimage or metadata path.
Returns
true on success, false on error.

Definition at line 2180 of file ossimTerraSarModel.cpp.

References ossimString::begin(), ossimString::clear(), ossimFilename::file(), ossimXmlDocument::findNodes(), ossimNotify(), and ossimNotifyLevel_DEBUG.

2182 {
2183  ossimString xpath;
2184  ossimString polLayerName;
2185  ossimString polLayerFileName;
2186  std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2187  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2188  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
2189 
2190  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::getPolLayerFromImageFile";
2191 
2192  if (traceDebug())
2193  {
2194  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entering...\n";
2195  }
2196 
2197  xml_nodes.clear();
2198  xpath = "/level1Product/productComponents/imageData";
2199 
2200  xmlDocument->findNodes(xpath, xml_nodes);
2201  if(xml_nodes.size() == 0)
2202  {
2203  setErrorStatus();
2204  if(traceDebug())
2205  {
2207  << MODULE << " DEBUG:"
2208  << "\nCould not find: " << xpath
2209  << std::endl;
2210  }
2211  return false;
2212  }
2213 
2214  node = xml_nodes.begin();
2215  while (node != xml_nodes.end())
2216  {
2217  sub_nodes.clear();
2218  xpath = "polLayer";
2219  (*node)->findChildNodes(xpath, sub_nodes);
2220  if (sub_nodes.size() == 0)
2221  {
2222  setErrorStatus();
2223  if(traceDebug())
2224  {
2226  << MODULE << " DEBUG:"
2227  << "\nCould not find: " << xpath
2228  << std::endl;
2229  }
2230  return false;
2231  }
2232  polLayerName = sub_nodes[0]->getText();
2233 
2234  sub_nodes.clear();
2235  xpath = "file/location/filename";
2236  (*node)->findChildNodes(xpath, sub_nodes);
2237  if (sub_nodes.size() == 0)
2238  {
2239  setErrorStatus();
2240  if(traceDebug())
2241  {
2243  << MODULE << " DEBUG:"
2244  << "\nCould not find: " << xpath
2245  << std::endl;
2246  }
2247  return false;
2248  }
2249  polLayerFileName = sub_nodes[0]->getText();
2250 
2251  if (polLayerFileName == imageFilename.file())
2252  {
2253  _polLayer = polLayerName;
2254  }
2255  ++node;
2256  }
2257 
2258  if (traceDebug())
2259  {
2260  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " leaving...\n";
2261  }
2262  return true;
2263 }
void clear()
Erases the entire container.
Definition: ossimString.h:432
std::string::iterator begin()
Definition: ossimString.h:420
ossimString _polLayer
PolLayer (AcquisitionInfo node).
ossimFilename file() const
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getSlantRangeFromGeoreferenced()

double ossimplugins::ossimTerraSarModel::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 169 of file ossimTerraSarModel.cpp.

170 {
171  const double c = 2.99792458e+8;
172  double tn = _alt_srgr_coefset[0] + _alt_srgr_coefset[1] * col + _alt_srgr_coefset[2] * col*col ;
173  return tn * (c/2.0);
174 }
std::vector< double > _alt_srgr_coefset
alternative SRGR computation coefficients.

◆ initAcquisitionInfo()

bool ossimplugins::ossimTerraSarModel::initAcquisitionInfo ( const ossimXmlDocument xdoc,
const ossimTerraSarProductDoc tsDoc 
)
private

Method to initialize AcquisitionInfo parameters from TerraSAR product xml file.

Parameters
xdocOpened product xml file.
Returns
true on success, false on error.

Definition at line 1758 of file ossimTerraSarModel.cpp.

References ossimplugins::ossimTerraSarProductDoc::geNumberOfLayers(), ossimplugins::ossimTerraSarProductDoc::getAcquisitionSensor(), ossimplugins::ossimTerraSarProductDoc::getImagingMode(), ossimplugins::ossimTerraSarProductDoc::getLookDirection(), ossimplugins::ossimTerraSarProductDoc::getMission(), ossimplugins::ossimTerraSarProductDoc::getPolarisationMode(), ossimplugins::ossimTerraSarProductDoc::getPolLayerList(), ossimNotify(), ossimNotifyLevel_DEBUG, and ossimString::toUInt32().

1760 {
1761  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::initAcquisitionInfo";
1762  bool result;
1763  ossimString s;
1764 
1765  if (traceDebug())
1766  {
1767  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entering...\n";
1768  }
1769 
1770  result = tsDoc.geNumberOfLayers(xdoc, s);
1771  if ( result == false )
1772  {
1773  if (traceDebug())
1774  {
1776  << "unable to get Number Of Layers \n";
1777  }
1778  setErrorStatus();
1779  return false;
1780  }
1782 
1783  result = tsDoc.getMission(xdoc, theSensorID);
1784  if ( result == false )
1785  {
1786  if (traceDebug())
1787  {
1789  << "unable to get theSensorID \n";
1790  }
1791  setErrorStatus();
1792  return false;
1793  }
1794 
1795  result = tsDoc.getImagingMode(xdoc, _imagingMode);
1796  if ( result == false )
1797  {
1798  if (traceDebug())
1799  {
1801  << "unable to get Imaging Mode \n";
1802  }
1803  setErrorStatus();
1804  return false;
1805  }
1806 
1807  result = tsDoc.getAcquisitionSensor(xdoc, _acquisitionSensor);
1808  if ( result == false )
1809  {
1810  if (traceDebug())
1811  {
1813  << "unable to get Acquisition Sensor \n";
1814  }
1815  setErrorStatus();
1816  return false;
1817  }
1818  result = tsDoc.getLookDirection(xdoc, _lookDirection);
1819  if ( result == false )
1820  {
1821  if (traceDebug())
1822  {
1824  << "unable to get Look direction \n";
1825  }
1826  setErrorStatus();
1827  return false;
1828  }
1829  result = tsDoc.getPolarisationMode(xdoc, _polarisationMode);
1830  if ( result == false )
1831  {
1832  if (traceDebug())
1833  {
1835  << "unable to get Polarisation Mode \n";
1836  }
1837  setErrorStatus();
1838  return false;
1839  }
1840  result = tsDoc.getPolLayerList(xdoc, _polLayerList);
1841  if ( result == false )
1842  {
1843  if (traceDebug())
1844  {
1846  << "unable to get Polarisation Layer list \n";
1847  }
1848  setErrorStatus();
1849  return false;
1850  }
1851 
1852  if (traceDebug())
1853  {
1854  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " leaving...\n";
1855  }
1856 
1857  return result;
1858 }
ossimString theSensorID
ossim_uint32 _numberOfLayers
number of layer (ImageDataInfo node).
ossim_uint32 toUInt32() const
ossimString _acquisitionSensor
Sensor (AcquisitionInfo node).
ossimString _lookDirection
LookDirection (AcquisitionInfo node).
std::vector< ossimString > _polLayerList
ossimString _imagingMode
ImagingMode (AcquisitionInfo node).
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimString _polarisationMode
PolarisationMode (AcquisitionInfo node).

◆ initCalibration()

bool ossimplugins::ossimTerraSarModel::initCalibration ( const ossimXmlDocument xmlDocument,
const ossimTerraSarProductDoc tsDoc 
)
private

Method to initialize Calibration parameters from TerraSAR product xml file.

Parameters
xdocOpened product xml file.
Returns
true on success, false on error.

Definition at line 2266 of file ossimTerraSarModel.cpp.

References ossimString::begin(), ossimXmlDocument::findNodes(), ossimNotify(), ossimNotifyLevel_DEBUG, and ossimString::toDouble().

2268 {
2269  ossimString xpath;
2270  ossimString polLayerName;
2271  std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2272  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2273  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
2274 
2275  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::initCalibration";
2276 
2277  if (traceDebug())
2278  {
2279  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entering...\n";
2280  }
2281 
2282  _calFactor.resize(_numberOfLayers);
2283 
2284  xml_nodes.clear();
2285  xpath = "/level1Product/calibration/calibrationConstant";
2286 
2287  xmlDocument->findNodes(xpath, xml_nodes);
2288  if(xml_nodes.size() == 0)
2289  {
2290  setErrorStatus();
2291  if(traceDebug())
2292  {
2294  << MODULE << " DEBUG:"
2295  << "\nCould not find: " << xpath
2296  << std::endl;
2297  }
2298  return false;
2299  }
2300 
2301  node = xml_nodes.begin();
2302  while (node != xml_nodes.end())
2303  {
2304  sub_nodes.clear();
2305  xpath = "polLayer";
2306  (*node)->findChildNodes(xpath, sub_nodes);
2307  if (sub_nodes.size() == 0)
2308  {
2309  setErrorStatus();
2310  if(traceDebug())
2311  {
2313  << MODULE << " DEBUG:"
2314  << "\nCould not find: " << xpath
2315  << std::endl;
2316  }
2317  return false;
2318  }
2319 
2320  polLayerName = sub_nodes[0]->getText();
2321 
2322  ossim_uint32 polLayerIdx = 0;
2323  bool polLayerIdxFound = false;
2324 
2325  for(ossim_uint32 idx = 0 ; idx < _polLayerList.size(); ++idx)
2326  {
2327  if(_polLayerList[idx] == polLayerName)
2328  {
2329  polLayerIdx = idx;
2330  polLayerIdxFound = true;
2331  }
2332  }
2333 
2334  if(!polLayerIdxFound)
2335  {
2336  setErrorStatus();
2337  if(traceDebug())
2338  {
2340  << MODULE << " DEBUG: Unable to found polLayer in polLayer List" << std::endl;
2341  }
2342  return false;
2343  }
2344 
2345  sub_nodes.clear();
2346  xpath = "calFactor";
2347  (*node)->findChildNodes(xpath, sub_nodes);
2348  if (sub_nodes.size() == 0)
2349  {
2350  setErrorStatus();
2351  if(traceDebug())
2352  {
2354  << MODULE << " DEBUG:"
2355  << "\nCould not find: " << xpath
2356  << std::endl;
2357  }
2358  return false;
2359  }
2360  _calFactor[polLayerIdx] = sub_nodes[0]->getText().toDouble();
2361  ++node;
2362  }
2363 
2364  if (traceDebug())
2365  {
2366  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " leaving...\n";
2367  }
2368 
2369  return true;
2370 }
ossim_uint32 _numberOfLayers
number of layer (ImageDataInfo node).
std::string::iterator begin()
Definition: ossimString.h:420
unsigned int ossim_uint32
std::vector< double > _calFactor
CalFactor (Calibration node).
std::vector< ossimString > _polLayerList
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ initNoise()

bool ossimplugins::ossimTerraSarModel::initNoise ( const ossimXmlDocument xmlDocument,
const ossimTerraSarProductDoc tsDoc 
)
private

Method to initialize ImageNoise parameters from TerraSAR product xml file.

Parameters
xdocOpened product xml file.
Returns
true on success, false on error.

Definition at line 2071 of file ossimTerraSarModel.cpp.

References ossimString::begin(), ossimXmlDocument::findNodes(), ossimNotify(), and ossimNotifyLevel_DEBUG.

2073 {
2074  ossimString xpath;
2075  ossimString polLayerName;
2076  std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2077  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2078  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
2079  bool result;
2080 
2081  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::initNoise";
2082 
2083  if (traceDebug())
2084  {
2085  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entering...\n";
2086  }
2087 
2088  _noise.resize(_numberOfLayers);
2089 
2090  xml_nodes.clear();
2091  xpath = "/level1Product/noise";
2092 
2093  xmlDocument->findNodes(xpath, xml_nodes);
2094  if(xml_nodes.size() == 0)
2095  {
2096  setErrorStatus();
2097  if(traceDebug())
2098  {
2100  << MODULE << " DEBUG:"
2101  << "\nCould not find: " << xpath
2102  << std::endl;
2103  }
2104  return false;
2105  }
2106 
2107  node = xml_nodes.begin();
2108  while (node != xml_nodes.end())
2109  {
2110  sub_nodes.clear();
2111  xpath = "polLayer";
2112  (*node)->findChildNodes(xpath, sub_nodes);
2113  if (sub_nodes.size() == 0)
2114  {
2115  setErrorStatus();
2116  if(traceDebug())
2117  {
2119  << MODULE << " DEBUG:"
2120  << "\nCould not find: " << xpath
2121  << std::endl;
2122  }
2123  return false;
2124  }
2125 
2126  polLayerName = sub_nodes[0]->getText();
2127 
2128  ossim_uint32 polLayerIdx = 0;
2129  bool polLayerIdxFound = false;
2130 
2131  for(ossim_uint32 idx = 0 ; idx < _polLayerList.size(); ++idx)
2132  {
2133  if(_polLayerList[idx] == polLayerName)
2134  {
2135  polLayerIdx = idx;
2136  polLayerIdxFound = true;
2137  }
2138  }
2139 
2140  if (!polLayerIdxFound)
2141  {
2142  setErrorStatus();
2143  if (traceDebug())
2144  {
2145  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: Unable to find polLayer in polLayer List"
2146  << std::endl;
2147  }
2148  return false;
2149  }
2150 
2151  sub_nodes.clear();
2152 
2153  //_noise[polLayerIdx] = new Noise();
2154  _noise[polLayerIdx].set_imagePolarisation(polLayerName);
2155 
2156  result = getNoiseAtGivenNode( (*node),_noise[polLayerIdx]);
2157  if(!result)
2158  {
2159  setErrorStatus();
2160  if (traceDebug())
2161  {
2162  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: Unable to getNoise for the " << polLayerName
2163  << " layer image" << std::endl;
2164  }
2165  return false;
2166  }
2167 
2168  ++node;
2169  }
2170 
2171  if (traceDebug())
2172  {
2173  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " leaving...\n";
2174  }
2175 
2176  return true;
2177 }
bool getNoiseAtGivenNode(const ossimRefPtr< ossimXmlNode > xmlDocument, ossimplugins::Noise &noise)
Method to get ImageNoise parameters from TerraSAR product xml file at a given node.
ossim_uint32 _numberOfLayers
number of layer (ImageDataInfo node).
std::string::iterator begin()
Definition: ossimString.h:420
unsigned int ossim_uint32
std::vector< ossimString > _polLayerList
std::vector< Noise > _noise
Noise (Noise node).
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ InitPlatformPosition()

bool ossimplugins::ossimTerraSarModel::InitPlatformPosition ( const ossimKeywordlist kwl,
const char *  prefix 
)
privatevirtual

Initializes the Platform Position from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 1078 of file ossimTerraSarModel.cpp.

References ossimKeywordlist::find(), and ossimplugins::ossim::iso8601TimeStringToCivilDate().

1080 {
1081  /*
1082  * Retrieval of ephemerisis number
1083  */
1084  const char* neph_str = kwl.find(prefix,"neph");
1085  int neph = atoi(neph_str);
1086 
1087  Ephemeris** ephemeris = new Ephemeris*[neph];
1088 
1089  /*
1090  * Retrieval of ephemerisis
1091  */
1092  for (int i=0;i<neph;i++)
1093  {
1094  double pos[3];
1095  double vit[3];
1096  char name[64];
1097 
1098 
1099  sprintf(name,"eph%i_date",i);
1100  const char* date_str = kwl.find(prefix,name);
1101 
1102  sprintf(name,"eph%i_posX",i);
1103  const char* px_str = kwl.find(prefix,name);
1104  pos[0] = atof(px_str);
1105 
1106  sprintf(name,"eph%i_posY",i);
1107  const char* py_str = kwl.find(prefix,name);
1108  pos[1] = atof(py_str);
1109 
1110  sprintf(name,"eph%i_posZ",i);
1111  const char* pz_str = kwl.find(prefix,name);
1112  pos[2] = atof(pz_str);
1113 
1114 
1115  sprintf(name,"eph%i_velX",i);
1116  const char* vx_str = kwl.find(prefix,name);
1117  vit[0] = atof(vx_str) ;
1118 
1119  sprintf(name,"eph%i_velY",i);
1120  const char* vy_str = kwl.find(prefix,name);
1121  vit[1] = atof(vy_str) ;
1122 
1123  sprintf(name,"eph%i_velZ",i);
1124  const char* vz_str = kwl.find(prefix,name);
1125  vit[2] = atof(vz_str) ;
1126 
1127  /*
1128  * Conversion to JSD Date
1129  */
1130  std::string utcString(date_str);
1131  CivilDateTime eph_civil_date;
1132  if (! ossim::iso8601TimeStringToCivilDate(utcString, eph_civil_date)) return false;
1133 
1134  JSDDateTime eph_jsd_date(eph_civil_date);
1135 
1136  GeographicEphemeris* eph = new GeographicEphemeris(eph_jsd_date,pos,vit);
1137 
1138  ephemeris[i] = eph;
1139  }
1140 
1141  /*
1142  * Creation of the platform position interpolator
1143  */
1144  if (_platformPosition != NULL)
1145  {
1146  delete _platformPosition;
1147  }
1148  _platformPosition = new PlatformPosition(ephemeris,neph);
1149 
1150  /*
1151  * Free of memory used by ephemerisis list : the constructor copies the ephemerisis
1152  */
1153  for (int i=0;i<neph;i++)
1154  {
1155  delete ephemeris[i];
1156  }
1157  delete[] ephemeris;
1158 
1159  return true;
1160 }
const char * find(const char *key) const
bool iso8601TimeStringToCivilDate(const std::string &dataString, CivilDateTime &outputDate)
Converts date string from ISO 8601 format to CivilDateTime.
PlatformPosition * _platformPosition
Handle the position of the platform.

◆ initPlatformPosition()

bool ossimplugins::ossimTerraSarModel::initPlatformPosition ( const ossimXmlDocument xdoc,
const ossimTerraSarProductDoc rsDoc 
)
private

Definition at line 1483 of file ossimTerraSarModel.cpp.

References ossimplugins::ossimTerraSarProductDoc::initPlatformPosition(), ossimNotify(), and ossimNotifyLevel_DEBUG.

1485 {
1486  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::initPlatformPosition";
1487 
1488  if (traceDebug())
1489  {
1490  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entered...\n";
1491  }
1492 
1493  // Initialize the platform position interpolator.
1494  if (_platformPosition)
1495  {
1496  delete _platformPosition;
1497  }
1498 
1499  _platformPosition = new PlatformPosition();
1500 
1501  bool result = tsDoc.initPlatformPosition(xdoc, _platformPosition);
1502 
1503  if (traceDebug())
1504  {
1506  << MODULE << " exit status = " << (result?"true":"false\n")
1507  << std::endl;
1508  }
1509 
1510  return result;
1511 }
PlatformPosition * _platformPosition
Handle the position of the platform.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ InitRefPoint()

bool ossimplugins::ossimTerraSarModel::InitRefPoint ( const ossimKeywordlist kwl,
const char *  prefix 
)
privatevirtual

Initializes the Reference Point from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 1162 of file ossimTerraSarModel.cpp.

References ossimKeywordlist::find(), ossimplugins::CivilDateTime::get_decimal(), ossimplugins::CivilDateTime::get_second(), and ossimplugins::ossim::iso8601TimeStringToCivilDate().

1163 {
1164  const char* sc_lin_str = kwl.find(prefix,"sc_lin");
1165  double sc_lin = atof(sc_lin_str);
1166 
1167  const char* sc_pix_str = kwl.find(prefix,"sc_pix");
1168  double sc_pix = atof(sc_pix_str);
1169 
1170  const char* inp_sctim_str = kwl.find(prefix,"inp_sctim");
1171  std::string inp_sctim_string(inp_sctim_str) ;
1172 
1173  const char* sceneCenterRangeTime_str = kwl.find(prefix,"sc_rng");
1174  _sceneCenterRangeTime = atof(sceneCenterRangeTime_str);
1175 
1176  if(_refPoint == NULL)
1177  {
1178  _refPoint = new RefPoint();
1179  }
1180 
1181  _refPoint->set_pix_col(sc_pix);
1182  _refPoint->set_pix_line(sc_lin);
1183 
1184  CivilDateTime * date = new CivilDateTime() ;
1185  if (! ossim::iso8601TimeStringToCivilDate(inp_sctim_string, *date)) return false ;
1186 
1187  if(_platformPosition != NULL)
1188  {
1189  Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)*date);
1190  if (ephemeris == NULL) return false ;
1191 
1192  _refPoint->set_ephemeris(ephemeris);
1193 
1194  delete ephemeris;
1195  }
1196  else
1197  {
1198  return false;
1199  }
1200 
1201  const double CLUM = 2.99792458e+8 ;
1202  double sceneCenterSlantRange = _sceneCenterRangeTime * CLUM / 2.0 ;
1203 
1204  _refPoint->set_distance(sceneCenterSlantRange);
1205 
1206  // in the case of Georeferenced images, the ground range is stored in place of the slant range
1207  // (used for SlantRange computation relative to reference point, necessary for optimization)
1209  double estimatedGroundRange = 0.0 ;
1210  for (int i=0; i<static_cast<int>(_SrToGr_coeffs.size()); i++)
1211  {
1212  estimatedGroundRange += _SrToGr_coeffs[i]*pow(_sceneCenterRangeTime-_SrToGr_R0,_SrToGr_exponent[i]);
1213  }
1214  // SrToGr update : estimatedGroundRange = sc_pix * scaling_factor
1215  _SrToGr_scaling_factor = estimatedGroundRange / sc_pix ;
1216  _refPoint->set_distance(estimatedGroundRange);
1217  }
1218 
1219  // in order to use ossimSensorModel::lineSampleToWorld
1220  const char* nbCol_str = kwl.find(prefix,"nbCol");
1221  const char* nbLin_str = kwl.find(prefix,"nbLin");
1222  theImageSize.x = atoi(nbCol_str);
1223  theImageSize.y = atoi(nbLin_str);
1225 
1227  std::string azimuthStartTime(kwl.find("azimuthStartTime"));
1228  std::string azimuthStopTime(kwl.find("azimuthStopTime"));
1229  CivilDateTime * dateStart = new CivilDateTime() ;
1230  if (! ossim::iso8601TimeStringToCivilDate(azimuthStartTime, *dateStart)) return false ;
1231  CivilDateTime * dateStop = new CivilDateTime() ;
1232  if (! ossim::iso8601TimeStringToCivilDate(azimuthStopTime, *dateStop)) return false ;
1233  double acq_msec_first = (double) dateStart->get_second()+dateStart->get_decimal();
1234  double acq_msec_last = (double) dateStop->get_second()+dateStop->get_decimal();
1235 
1236  double actualPRF = theImageSize.y/(acq_msec_last-acq_msec_first) ;
1237  _sensor->set_nAzimuthLook(_sensor->get_prf()/actualPRF);
1238  }
1239  else
1240  _sensor->set_nAzimuthLook(1.0);
1241 
1242  // Ground Control Points extracted from the model : scene center and corners
1243  std::list<ossimGpt> groundGcpCoordinates ;
1244  std::list<ossimDpt> imageGcpCoordinates ;
1245  char name[64];
1246  for (int k=0 ; k<5 ; k++) {
1247  sprintf(name,"cornersCol%i",k);
1248  const char* i_str = kwl.find(name);
1249  int i = atoi(i_str);
1250  sprintf(name,"cornersLin%i",k);
1251  const char* j_str = kwl.find(name);
1252  int j = atoi(j_str);
1253  sprintf(name,"cornersLon%i",k);
1254  const char* lon_str = kwl.find(name);
1255  double lon = atof(lon_str);
1256  sprintf(name,"cornersLat%i",k);
1257  const char* lat_str = kwl.find(name);
1258  double lat = atof(lat_str);
1259  const char* height_str = kwl.find("terrain_h");
1260  double height = atof(height_str) ;
1261 
1262  ossimDpt imageGCP(i,j);
1263  ossimGpt groundGCP(lat ,lon , height);
1264  groundGcpCoordinates.push_back(groundGCP) ;
1265  imageGcpCoordinates.push_back(imageGCP) ;
1266  }
1267 
1268  // Default optimization
1269  optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ;
1270 
1271  return true;
1272 }
double _sceneCenterRangeTime
Scene Center range time.
const char * find(const char *key) const
bool iso8601TimeStringToCivilDate(const std::string &dataString, CivilDateTime &outputDate)
Converts date string from ISO 8601 format to CivilDateTime.
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
bool _isProductGeoreferenced
True iff the product is ground range.
double _SrToGr_scaling_factor
Slant Range TO Ground Range scaling factor at scene center.
ossimDrect theImageClipRect
PlatformPosition * _platformPosition
Handle the position of the platform.
std::vector< int > _SrToGr_exponent
Slant Range TO Ground Range Projection exponents.
ossim_int32 y
Definition: ossimIpt.h:142
void set_nAzimuthLook(double look)
Definition: SensorParams.h:133
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
std::vector< double > _SrToGr_coeffs
Slant Range TO Ground Range Projection coefficients.
void set_distance(double distance)
Definition: RefPoint.cpp:75
double _SrToGr_R0
Slant Range TO Ground Range Projection reference point.

◆ initRefPoint()

bool ossimplugins::ossimTerraSarModel::initRefPoint ( const ossimXmlDocument xdoc,
const ossimTerraSarProductDoc rsDoc 
)
private

Method to initialize RefPoint object from TerraSAR product xml file.

Parameters
xdocOpened product xml file.
Returns
true on success, false on error.

Definition at line 1554 of file ossimTerraSarModel.cpp.

References ossimplugins::CivilDateTime::get_decimal(), ossimplugins::CivilDateTime::get_second(), ossimplugins::ossimTerraSarProductDoc::getAzimuthStartTime(), ossimplugins::ossimTerraSarProductDoc::getAzimuthStopTime(), ossimplugins::ossimTerraSarProductDoc::getSceneCenterAzimuthTime(), ossimplugins::ossimTerraSarProductDoc::getSceneCenterLat(), ossimplugins::ossimTerraSarProductDoc::getSceneCenterLon(), ossimplugins::ossimTerraSarProductDoc::getSceneCenterRangeTime(), ossimplugins::ossimTerraSarProductDoc::getSceneCenterRefColumn(), ossimplugins::ossimTerraSarProductDoc::getSceneCenterRefRow(), ossimplugins::ossimTerraSarProductDoc::initTiePoints(), ossimplugins::ossim::iso8601TimeStringToCivilDate(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimString::toDouble(), and ossimString::toFloat64().

1556 {
1557  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::initRefPoint";
1558 
1559  if (traceDebug())
1560  {
1561  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entered...\n";
1562  }
1563 
1564  if ( !_platformPosition )
1565  {
1566  return false;
1567  }
1568 
1569  bool result = true;
1570 
1571  ossimString s; // used throughout
1572 
1573  //---
1574  // Set the base class reference points.
1575  // Note the "ONE BASED" image points from xml doc.
1576  //---
1577 
1578  // Get the center sample.
1579  if ( tsDoc.getSceneCenterRefColumn(xdoc, s) )
1580  {
1581  theRefImgPt.x = s.toFloat64() - 1.0;
1582  }
1583  else
1584  {
1585  result = false;
1586  }
1587 
1588  // Get the center line.
1589  if ( tsDoc.getSceneCenterRefRow(xdoc, s) )
1590  {
1591  theRefImgPt.y = s.toFloat64() - 1.0;
1592  }
1593  else
1594  {
1595  result = false;
1596  }
1597 
1598  // Get the center latitude.
1599  if ( tsDoc.getSceneCenterLat(xdoc, s) )
1600  {
1601  theRefGndPt.lat = s.toFloat64();
1602  }
1603  else
1604  {
1605  result = false;
1606  }
1607 
1608  // Get the center longitude.
1609  if ( tsDoc.getSceneCenterLon(xdoc, s) )
1610  {
1611  theRefGndPt.lon = s.toFloat64();
1612  }
1613  else
1614  {
1615  result = false;
1616  }
1617 
1618  // Reference point.
1619  if (_refPoint)
1620  {
1621  delete _refPoint;
1622  }
1623  _refPoint = new RefPoint();
1624 
1627 
1628  if ( tsDoc.getSceneCenterAzimuthTime(xdoc, s) )
1629  {
1630  CivilDateTime date;
1631  if ( ossim::iso8601TimeStringToCivilDate(s, date) )
1632  {
1633  JSDDateTime jdate(date);
1634  Ephemeris * ephemeris = _platformPosition->Interpolate(jdate);
1635  if (ephemeris)
1636  {
1637  _refPoint->set_ephemeris(ephemeris);
1638  delete ephemeris;
1639  }
1640  else
1641  {
1642  result = false;
1643  }
1644  }
1645  else
1646  {
1647  result = false;
1648  }
1649  }
1650  else
1651  {
1652  result = false;
1653  }
1654 
1655  if ( tsDoc.getSceneCenterRangeTime(xdoc, s) )
1656  {
1658 
1659  const double CLUM = 2.99792458e+8;
1660  double sceneCenterSlantRange = _sceneCenterRangeTime * CLUM / 2.0;
1661  _refPoint->set_distance(sceneCenterSlantRange);
1662  }
1663  else
1664  {
1665  result = false;
1666  }
1667 
1668  //---
1669  // In the case of Georeferenced images, the ground range is stored in
1670  // place of the slant range
1671  // (used for SlantRange computation relative to reference point, necessary
1672  // for optimization)
1673  //---
1675  {
1676  double estimatedGroundRange = 0.0 ;
1677  for (int i=0; i<static_cast<int>(_SrToGr_coeffs.size()); i++)
1678  {
1679  estimatedGroundRange += _SrToGr_coeffs[i]*
1681  }
1682 
1683  // SrToGr update : estimatedGroundRange = sc_pix * scaling_factor
1684  _SrToGr_scaling_factor = estimatedGroundRange / theRefImgPt.x;
1685  _refPoint->set_distance(estimatedGroundRange);
1686 
1687  CivilDateTime dateStart;
1688  CivilDateTime dateStop;
1689 
1690  if (tsDoc.getAzimuthStartTime(xdoc, s) )
1691  {
1692  if (! ossim::iso8601TimeStringToCivilDate(s, dateStart) )
1693  {
1694  result = false;
1695  }
1696  }
1697  else
1698  {
1699  result = false;
1700  }
1701 
1702  if (tsDoc.getAzimuthStopTime(xdoc, s) )
1703  {
1704  if (! ossim::iso8601TimeStringToCivilDate(s, dateStop) )
1705  {
1706  result = false;
1707  }
1708  }
1709  else
1710  {
1711  result = false;
1712  }
1713 
1714  double acq_msec_first = (double) dateStart.get_second() +
1715  dateStart.get_decimal();
1716  double acq_msec_last = (double) dateStop.get_second() +
1717  dateStop.get_decimal();
1718 
1719  double actualPRF = theImageSize.y/(acq_msec_last - acq_msec_first) ;
1720  _sensor->set_nAzimuthLook(_sensor->get_prf()/actualPRF);
1721 
1722  }
1723  else
1724  {
1725  _sensor->set_nAzimuthLook(1.0);
1726  }
1727 
1728  // Ground Control Points extracted from the model.
1729  std::list<ossimGpt> groundGcpCoordinates;
1730  std::list<ossimDpt> imageGcpCoordinates;
1731  if ( tsDoc.initTiePoints(xdoc,
1732  groundGcpCoordinates,
1733  imageGcpCoordinates) == false )
1734  {
1735  if (traceDebug())
1736  {
1738  << MODULE << "initTiePoint error! exiting\n";
1739  }
1740  return false;
1741  }
1742 
1743  if (result)
1744  {
1745  // Default optimization
1746  optimizeModel(groundGcpCoordinates, imageGcpCoordinates);
1747  }
1748 
1749  if (traceDebug())
1750  {
1752  << MODULE << " exit status = true\n";
1753  }
1754 
1755  return true;
1756 }
double _sceneCenterRangeTime
Scene Center range time.
double y
Definition: ossimDpt.h:165
bool iso8601TimeStringToCivilDate(const std::string &dataString, CivilDateTime &outputDate)
Converts date string from ISO 8601 format to CivilDateTime.
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
bool _isProductGeoreferenced
True iff the product is ground range.
double _SrToGr_scaling_factor
Slant Range TO Ground Range scaling factor at scene center.
ossim_float64 lon
Definition: ossimGpt.h:266
double toDouble() const
ossim_float64 toFloat64() const
PlatformPosition * _platformPosition
Handle the position of the platform.
std::vector< int > _SrToGr_exponent
Slant Range TO Ground Range Projection exponents.
ossim_int32 y
Definition: ossimIpt.h:142
double x
Definition: ossimDpt.h:164
void set_nAzimuthLook(double look)
Definition: SensorParams.h:133
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.
ossim_float64 lat
Definition: ossimGpt.h:265
void set_ephemeris(Ephemeris *ephemeris)
Definition: RefPoint.cpp:65
std::vector< double > _SrToGr_coeffs
Slant Range TO Ground Range Projection coefficients.
void set_distance(double distance)
Definition: RefPoint.cpp:75
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
double _SrToGr_R0
Slant Range TO Ground Range Projection reference point.

◆ initSceneCoord()

bool ossimplugins::ossimTerraSarModel::initSceneCoord ( const ossimXmlDocument xdoc,
const ossimTerraSarProductDoc tsDoc 
)
private

Method to initialize InfoIncidenceAngle parameters from TerraSAR product xml file.

Parameters
xdocOpened product xml file.
Returns
true on success, false on error.

Definition at line 1860 of file ossimTerraSarModel.cpp.

References ossimplugins::ossimTerraSarProductDoc::initSceneCoord(), ossimNotify(), and ossimNotifyLevel_DEBUG.

1862 {
1863  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::initSceneCoord";
1864 
1865  if (traceDebug())
1866  {
1867  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entered...\n";
1868  }
1869 
1870  if (_sceneCoord)
1871  {
1872  delete _sceneCoord;
1873  }
1874 
1875  _sceneCoord = new SceneCoord();
1876 
1877  bool result = tsDoc.initSceneCoord(xdoc, _sceneCoord);
1878 
1879  if (traceDebug())
1880  {
1882  << MODULE << " exit status = " << (result?"true":"false\n")
1883  << std::endl;
1884  }
1885 
1886  return result;
1887 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
SceneCoord * _sceneCoord
SceneCoord (SceneInfo node)

◆ InitSensorParams()

bool ossimplugins::ossimTerraSarModel::InitSensorParams ( const ossimKeywordlist kwl,
const char *  prefix 
)
privatevirtual

Initializes the Sensor Params from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 986 of file ossimTerraSarModel.cpp.

References ossimKeywordlist::find(), ossimplugins::SensorParams::Left, and ossimplugins::SensorParams::Right.

988 {
989 
990 
991 
992 
993  const char* central_freq_str = kwl.find(prefix,"central_freq");
994  double central_freq = atof(central_freq_str);
995  const char* fr_str = kwl.find(prefix,"fr");
996  double fr = atof(fr_str);
997  const char* fa_str = kwl.find(prefix,"fa");
998  double fa = atof(fa_str);
999 
1000 
1001 
1002 
1003  //number of different looks
1004  // const char* n_azilok_str = kwl.find(prefix,"n_azilok");
1005  // double n_azilok = atof(n_azilok_str);
1006  const char* n_rnglok_str = kwl.find(prefix,"n_rnglok");
1007  double n_rnglok = atof(n_rnglok_str);
1008 
1009  //ellipsoid parameters
1010  const char* ellip_maj_str = kwl.find(prefix,"ellip_maj");
1011  double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m
1012  const char* ellip_min_str = kwl.find(prefix,"ellip_min");
1013  double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m
1014 
1015 
1016  if(_sensor != NULL)
1017  {
1018  delete _sensor;
1019  }
1020 
1021  _sensor = new SensorParams();
1022 
1023 
1025  {
1026  const char* orbitDirection_str = kwl.find(prefix,"orbitDirection");
1027  std::string orbitDirection(orbitDirection_str) ;
1028  int orbitDirectionSign ;
1029  if (orbitDirection=="DESCENDING") orbitDirectionSign = 1 ;
1030  else orbitDirectionSign = - 1 ;
1031 
1032  const char* imageDataStartWith_str = kwl.find(prefix,"imageDataStartWith");
1033  std::string imageDataStartWith(imageDataStartWith_str) ;
1034  if (imageDataStartWith=="EARLYAZNEARRG") {
1035  _sensor->set_col_direction(orbitDirectionSign);
1036  _sensor->set_lin_direction(orbitDirectionSign);
1037  } else if (imageDataStartWith=="EARLYAZFARRG") {
1038  _sensor->set_col_direction(-orbitDirectionSign);
1039  _sensor->set_lin_direction(orbitDirectionSign);
1040  } else if (imageDataStartWith=="LATEAZNEARRG") {
1041  _sensor->set_col_direction(orbitDirectionSign);
1042  _sensor->set_lin_direction(-orbitDirectionSign);
1043  } else if (imageDataStartWith=="LATEAZFARRG") {
1044  _sensor->set_col_direction(-orbitDirectionSign);
1045  _sensor->set_lin_direction(-orbitDirectionSign);
1046  } else {
1047  // COSAR Files are stored starting with early azimuth, near range
1048  _sensor->set_col_direction(orbitDirectionSign);
1049  _sensor->set_lin_direction(orbitDirectionSign);
1050  }
1051  }
1052  else
1053  {
1056  }
1057 
1058  const char* lookDirection_str = kwl.find(prefix,"lookDirection");
1059  std::string lookDirection(lookDirection_str) ;
1060  if ((lookDirection == "Right")||(lookDirection == "RIGHT")) _sensor->set_sightDirection(SensorParams::Right) ;
1062 
1063  _sensor->set_sf(fr);
1064  const double CLUM = 2.99792458e+8 ;
1065  double wave_length = CLUM / central_freq ;
1066  _sensor->set_rwl(wave_length);
1067  _sensor->set_nRangeLook(n_rnglok);
1068  _sensor->set_prf(fa) ;
1069  // fa is the processing PRF
1070  //_sensor->set_prf(fa * n_azilok); // number of looks disabled
1071 
1072  _sensor->set_semiMajorAxis(ellip_maj) ;
1073  _sensor->set_semiMinorAxis(ellip_min) ;
1074 
1075  return true;
1076 }
void set_sightDirection(SightDirection sight)
Definition: SensorParams.h:93
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
bool _isProductGeoreferenced
True iff the product is ground range.
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_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

◆ initSensorParams()

bool ossimplugins::ossimTerraSarModel::initSensorParams ( const ossimXmlDocument xdoc,
const ossimTerraSarProductDoc rsDoc 
)
private

Definition at line 1513 of file ossimTerraSarModel.cpp.

References ossimplugins::ossimTerraSarProductDoc::initSensorParams(), ossimNotify(), and ossimNotifyLevel_DEBUG.

1515 {
1516  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::initSensorParams";
1517 
1518  if (traceDebug())
1519  {
1520  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
1521  }
1522 
1523  if (_sensor )
1524  {
1525  delete _sensor;
1526  }
1527  _sensor = new SensorParams();
1528 
1529 
1530  bool result = tsDoc.initSensorParams(xdoc, _sensor);
1531 
1532  if (traceDebug())
1533  {
1535  << "result for tsDoc.initSensorParams " << result << endl;
1536  }
1537 
1538  if (!result)
1539  {
1540  delete _sensor;
1541  _sensor = 0;
1542  }
1543 
1544  if (traceDebug())
1545  {
1547  << MODULE << " exit status = " << (result?"true":"false\n")
1548  << std::endl;
1549  }
1550 
1551  return result;
1552 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ InitSRGR()

bool ossimplugins::ossimTerraSarModel::InitSRGR ( const ossimKeywordlist kwl,
const char *  prefix 
)
privatevirtual

Initializes the Slant Range to Ground Range data sets : _SrToGr_R0,_SrToGr_coeffs_number,_SrToGr_exponent,_SrToGr_coeffs,_nbCol.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 1274 of file ossimTerraSarModel.cpp.

References ossimKeywordlist::find().

1275 {
1276  const char* rangeProjectionType_str = kwl.find(prefix,"rangeProjectionType");
1277  std::string rangeProjectionType(rangeProjectionType_str);
1278 
1279  _isProductGeoreferenced = (rangeProjectionType=="GROUNDRANGE") ;
1280 
1281  // SRtoGR polynomial reference
1282  const char* SrToGr_R0_str = kwl.find(prefix,"SrToGr_R0");
1283  _SrToGr_R0 = atof(SrToGr_R0_str);
1284 
1285  // number of SRtoGR coefficients
1286  const char* SrToGr_coeffs_number_str = kwl.find(prefix,"SrToGr_coeffs_number");
1287  int srToGr_coeffs_number = atoi(SrToGr_coeffs_number_str);
1288 
1289  // SRtoGR coefficients and exponents
1290  char name[64];
1291  double coeff ;
1292  int exponent ;
1293  for(int i=0;i<srToGr_coeffs_number;i++)
1294  {
1295  sprintf(name,"SrToGr_coeffs_%i",i);
1296  const char* coeff_str = kwl.find(prefix,name);
1297  coeff = atof(coeff_str);
1298  _SrToGr_coeffs.push_back(coeff);
1299  sprintf(name,"SrToGr_exps_%i",i);
1300  const char* exp_str = kwl.find(prefix,name);
1301  exponent = atoi(exp_str);
1302  _SrToGr_exponent.push_back(exponent);
1303  }
1304 
1305  // ALTERNATIVE to provided coefficients
1306 
1307  // Range time for first mid and last pixel
1308  std::string orbitDirection(kwl.find(prefix,"orbitDirection")) ;
1309  double t1, t2, t3 ;
1310  if (orbitDirection=="DESCENDING") {
1311  t3 = atof(kwl.find("start_rng"));
1312  t2 = atof(kwl.find("sc_rng"));
1313  t1 = atof(kwl.find("end_rng"));
1314  }
1315  else {
1316  t1 = atof(kwl.find("start_rng"));
1317  t2 = atof(kwl.find("sc_rng"));
1318  t3 = atof(kwl.find("end_rng"));
1319  }
1320 
1321  // Range pixels numbers corresponding
1322  // double x1 = 0.0;
1323  double x2 = atof(kwl.find("sc_pix"));
1324  double x3 = 2.0*(x2+1.0) -1.0 ;
1325 
1326  _alt_srgr_coefset[0] = t1;
1327  _alt_srgr_coefset[1] = ((t2-t1)/(x2*x2)+(t1-t3)/(x3*x3))/((1.0/x2)-(1.0/x3));
1328  _alt_srgr_coefset[2] = ((t2-t1)/x2 + (t1-t3)/x3)/(x2-x3);
1329 
1330  return true;
1331 }
const char * find(const char *key) const
std::vector< double > _alt_srgr_coefset
alternative SRGR computation coefficients.
bool _isProductGeoreferenced
True iff the product is ground range.
std::vector< int > _SrToGr_exponent
Slant Range TO Ground Range Projection exponents.
std::vector< double > _SrToGr_coeffs
Slant Range TO Ground Range Projection coefficients.
double _SrToGr_R0
Slant Range TO Ground Range Projection reference point.

◆ initSRGR()

bool ossimplugins::ossimTerraSarModel::initSRGR ( const ossimXmlDocument xdoc,
const ossimTerraSarProductDoc rsDoc 
)
private
Note
This method must be called before initRefPoint.

Definition at line 1333 of file ossimTerraSarModel.cpp.

References ossimXmlDocument::findNodes(), ossimplugins::ossimTerraSarProductDoc::getOrbitDirection(), ossimplugins::ossimTerraSarProductDoc::getRangeGateFirstPixel(), ossimplugins::ossimTerraSarProductDoc::getRangeGateLastPixel(), ossimplugins::ossimTerraSarProductDoc::getReferencePoint(), ossimplugins::ossimTerraSarProductDoc::getSceneCenterRangeTime(), ossimplugins::ossimTerraSarProductDoc::getSceneCenterRefColumn(), ossimplugins::ossimTerraSarProductDoc::isProductGeoreferenced(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimString::toDouble(), and ossimString::toInt32().

1335 {
1336  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::initSRGR";
1337 
1338  if (traceDebug())
1339  {
1340  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entered...\n";
1341  }
1342 
1343  bool result = true;
1344 
1345  ossimString s;
1346 
1347  _isProductGeoreferenced = tsDoc.isProductGeoreferenced(xdoc);
1348 
1349  // SRtoGR polynomial reference
1350  if ( tsDoc.getReferencePoint(xdoc, s) )
1351  {
1352  _SrToGr_R0 = s.toDouble();
1353  }
1354  else
1355  {
1356  //---
1357  // This value is only used if product is geo referenced,
1358  // (projection == GROUNDRANGE) so we won't error out if not.
1359  //---
1361  {
1362  result = false;
1363  }
1364  _SrToGr_R0 = 0.0;
1365  }
1366 
1367  // number of SRtoGR coefficients
1369  ossimString path =
1370  "/level1Product/productSpecific/projectedImageInfo/slantToGroundRangeProjection/coefficient";
1371  std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
1372  const ossimString EXP = "exponent";
1373  xdoc->findNodes(path, xnodes);
1374  if ( xnodes.size() )
1375  {
1376  for (ossim_uint32 i = 0; i < xnodes.size(); ++i)
1377  {
1378  if (xnodes[i].valid())
1379  {
1380  xnodes[i]->getAttributeValue(s, EXP);
1381  _SrToGr_exponent.push_back(s.toInt32());
1382  _SrToGr_coeffs.push_back(xnodes[i]->getText().toDouble());
1383  }
1384  }
1385  }
1386  else
1387  {
1388  result = false;
1389  }
1390 
1391  // Range time for first mid and last pixel
1392 
1393  if ( tsDoc.getOrbitDirection(xdoc, s) )
1394  {
1395  bool desendingFlag = (s == "DESCENDING");
1396  double startRng = 0.0;
1397  double endRng = 0.0;
1398  double scRng = 0.0;
1399  double t1 = 0.0;
1400  double t2 = 0.0;
1401  double t3 = 0.0;
1402  double x2 = 0.0;
1403 
1404  if ( tsDoc.getRangeGateFirstPixel(xdoc, s) )
1405  {
1406  startRng = s.toDouble();
1407  }
1408  else
1409  {
1410  result = false;
1411  }
1412 
1413  if ( tsDoc.getRangeGateLastPixel(xdoc, s) )
1414  {
1415  endRng = s.toDouble();
1416  }
1417  else
1418  {
1419  result = false;
1420  }
1421 
1422  if ( tsDoc.getSceneCenterRangeTime(xdoc, s) )
1423  {
1424  scRng = s.toDouble();
1425  }
1426  else
1427  {
1428  result = false;
1429  }
1430 
1431  t2 = scRng;
1432 
1433  if (desendingFlag)
1434  {
1435  t3 = startRng;
1436  t1 = endRng;
1437  }
1438  else
1439  {
1440  t1 = startRng;
1441  t3 = endRng;
1442  }
1443 
1444  // Range pixels numbers corresponding
1445  if ( tsDoc.getSceneCenterRefColumn(xdoc, s) )
1446  {
1447  //---
1448  // TSX image coordinates start at (1,1),
1449  // while OSSIM image coordinates start at (0,0)
1450  //---
1451  x2 = s.toDouble() - 1.0;
1452  }
1453  else
1454  {
1455  result = false;
1456  }
1457 
1458  if (traceDebug())
1459  {
1461  << "startRng: " << startRng
1462  << "\nscRng: " << scRng
1463  << "\nendRng: " << endRng
1464  << "\nx2: " << x2
1465  << "\n";
1466  }
1467 
1468  double x3 = 2.0*(x2+1.0) -1.0 ;
1469 
1470  _alt_srgr_coefset[0] = t1;
1471  _alt_srgr_coefset[1] =
1472  ((t2-t1)/(x2*x2)+(t1-t3)/(x3*x3))/((1.0/x2)-(1.0/x3));
1473  _alt_srgr_coefset[2] = ((t2-t1)/x2 + (t1-t3)/x3)/(x2-x3);
1474  }
1475  else
1476  {
1477  result = false;
1478  }
1479 
1480  return result;
1481 }
std::vector< double > _alt_srgr_coefset
alternative SRGR computation coefficients.
bool _isProductGeoreferenced
True iff the product is ground range.
ossim_int32 toInt32() const
unsigned int ossim_uint32
double toDouble() const
std::vector< int > _SrToGr_exponent
Slant Range TO Ground Range Projection exponents.
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
std::vector< double > _SrToGr_coeffs
Slant Range TO Ground Range Projection coefficients.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
double _SrToGr_R0
Slant Range TO Ground Range Projection reference point.

◆ loadState()

bool ossimplugins::ossimTerraSarModel::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 401 of file ossimTerraSarModel.cpp.

References ossimKeywordlist::find(), getClassName(), ossimplugins::ossimGeometricSarSensorModel::loadState(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimString::toBool(), and ossimKeywordNames::TYPE_KW.

403 {
404  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::loadState";
405 
406  if (traceDebug())
407  {
408  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
409  }
410 
411  const char* lookup = 0;
412  ossimString s;
413 
414  // Check the type first.
415  lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
416  if (lookup)
417  {
418  s = lookup;
419  if (s != getClassName())
420  {
421  return false;
422  }
423  }
424 
425  // Get the product.xml file name.
426  lookup = kwl.find(prefix, PRODUCT_XML_FILE_KW);
427 
428  if (lookup)
429  {
430  _productXmlFile = lookup;
431 
432  // See if caller wants to load from xml vice keyword list.
433  lookup = kwl.find(prefix, LOAD_FROM_PRODUCT_FILE_KW);
434  if (lookup)
435  {
436  s = lookup;
437  if ( s.toBool() )
438  {
439  // Loading from product.xml file.
440  return open(_productXmlFile);
441  }
442  }
443  }
444 
445 
446  //---
447  // Temp: This must be cleared or you end up with a bounding rect of all
448  // zero's.
449  //---
451 
452  // Load the base class.
453  bool result = ossimGeometricSarSensorModel::loadState(kwl, prefix);
454 
455  if (result)
456  {
457  lookup = kwl.find(prefix,SR_GR_R0_KW);
458  if (lookup)
459  {
460  s = lookup;
461  _SrToGr_R0 = s.toDouble();
462  }
463  else
464  {
465  if (traceDebug())
466  {
468  << MODULE
469  << "\nRequired keyword not found: "
470  << SR_GR_R0_KW << "\n";
471  }
472  result = false;
473  }
474 
475  ossim_uint32 count = 0;
476  lookup = kwl.find(prefix, NUMBER_SRGR_COEFFICIENTS_KW);
477  if (lookup)
478  {
479  s = lookup;
480  count = s.toUInt32();
481  }
482  else
483  {
484  if (traceDebug())
485  {
487  << MODULE
488  << "\nRequired keyword not found: "
489  << NUMBER_SRGR_COEFFICIENTS_KW << "\n";
490  }
491  result = false;
492  }
493 
495 
496  if (result && count)
497  {
498  _SrToGr_exponent.resize(count);
499  _SrToGr_coeffs.resize(count);
500 
501  ossimString kw1 = "sr_gr_exponent_";
502  ossimString kw2 = "sr_gr_coeffs_";
503 
504  for(ossim_uint32 i = 0; i < count; ++i)
505  {
506  ossimString kw;
508 
509  // sr_gr_exponents
510  kw = kw1;
511  kw += iStr;
512 
513  lookup = kwl.find(prefix, kw);
514  if (lookup)
515  {
516  s = lookup;
517  _SrToGr_exponent[i] = s.toInt();
518  }
519  else
520  {
521  if (traceDebug())
522  {
524  << MODULE
525  << "\nRequired keyword not found: "
526  << kw << "\n";
527  }
528  result = false;
529  }
530 
531  // _SrToGr_coeffs
532  kw = kw2;
533  kw += iStr;
534  lookup = kwl.find(prefix, kw);
535  if (lookup)
536  {
537  s = lookup;
538  _SrToGr_coeffs[i] = s.toDouble();
539  }
540  else
541  {
542  if (traceDebug())
543  {
545  << MODULE
546  << "\nRequired keyword not found: "
547  << kw << "\n";
548  }
549  result = false;
550  }
551  }
552 
553  } // matches: if (result && count)
554 
555  lookup = kwl.find(prefix, SC_RT_KW);
556  if (lookup)
557  {
558  s = lookup;
560  }
561  else
562  {
563  if (traceDebug())
564  {
566  << MODULE
567  << "\nRequired keyword not found: "
568  << SC_RT_KW << "\n";
569  }
570  result = false;
571  }
572 
573  lookup = kwl.find(prefix, SR_GR_SF_KW);
574  if (lookup)
575  {
576  s = lookup;
578  }
579  else
580  {
581  if (traceDebug())
582  {
584  << MODULE
585  << "\nRequired keyword not found: "
586  << SR_GR_SF_KW << "\n";
587  }
588  result = false;
589  }
590 
591  lookup = kwl.find(prefix, ALT_SR_GR_COEFFICIENT0_KW);
592  if (lookup)
593  {
594  s = lookup;
595  _alt_srgr_coefset[0] = s.toDouble();
596  }
597  else
598  {
599  if (traceDebug())
600  {
602  << MODULE
603  << "\nRequired keyword not found: "
604  << ALT_SR_GR_COEFFICIENT0_KW << "\n";
605  }
606  result = false;
607  }
608  lookup = kwl.find(prefix, ALT_SR_GR_COEFFICIENT1_KW);
609  if (lookup)
610  {
611  s = lookup;
612  _alt_srgr_coefset[1] = s.toDouble();
613  }
614  else
615  {
616  if (traceDebug())
617  {
619  << MODULE
620  << "\nRequired keyword not found: "
621  << ALT_SR_GR_COEFFICIENT1_KW << "\n";
622  }
623  result = false;
624  }
625  lookup = kwl.find(prefix, ALT_SR_GR_COEFFICIENT2_KW);
626  if (lookup)
627  {
628  s = lookup;
629  _alt_srgr_coefset[2] = s.toDouble();
630  }
631  else
632  {
633  if (traceDebug())
634  {
636  << MODULE
637  << "\nRequired keyword not found: "
638  << ALT_SR_GR_COEFFICIENT2_KW << "\n";
639  }
640  result = false;
641  }
642 
643  lookup = kwl.find(prefix, PRODUCT_XML_FILE_KW);
644  if (lookup)
645  {
646  _productXmlFile = lookup;
647  }
648  else
649  {
650  if (traceDebug())
651  {
653  << MODULE
654  << "\nRequired keyword not found: "
655  << PRODUCT_XML_FILE_KW << "\n";
656  }
657  result = false;
658  }
659 
660  } // matches: if (result)
661 
662  // Load the base class.
663  /*
664  * TODO correct loadState
665  */
666 #if 0
667  if ( !_noise)
668  {
669  _noise = new Noise();
670  }
671  if ( _noise->loadState(kwl, prefix) == false )
672  {
673  if (traceDebug())
674  {
676  << MODULE
677  << "\n_noise->loadState failed!\n";
678  }
679  result = false;
680  }
681 #endif
682 
683 
684  // Load the base class.
685  if ( !_sceneCoord)
686  {
687  _sceneCoord = new SceneCoord();
688  }
689 
690  if ( _sceneCoord->loadState(kwl,prefix) == false )
691  {
692  if (traceDebug())
693  {
695  << MODULE
696  << "\n__sceneCoord->loadState failed!\n";
697  }
698  result = false;
699  }
700 
701  lookup = kwl.find(prefix, CALIBRATION_CALFACTOR);
702  if (lookup)
703  {
704  std::istringstream in(lookup);
705  ossimString tempValue;
706  for(ossim_uint32 idx = 0; idx < _numberOfLayers; ++idx)
707  {
708  in >> tempValue;
709  _calFactor[idx] = tempValue.toDouble();
710 
711  }
712  }
713  else
714  {
715  if (traceDebug())
716  {
718  << MODULE
719  << "\nRequired keyword not found: "
720  << CALIBRATION_CALFACTOR << "\n";
721  }
722  result = false;
723  }
724 
725  lookup = kwl.find(prefix, RADAR_FREQUENCY);
726  if (lookup)
727  {
728  s = lookup;
730  }
731  else
732  {
733  if (traceDebug())
734  {
736  << MODULE
737  << "\nRequired keyword not found: "
738  << RADAR_FREQUENCY << "\n";
739  }
740  result = false;
741  }
742 
743  lookup = kwl.find(prefix, AZ_START_TIME);
744  if (lookup)
745  {
746  _azStartTime = lookup;
747  }
748  else
749  {
750  if (traceDebug())
751  {
753  << MODULE
754  << "\nRequired keyword not found: "
755  << AZ_START_TIME << "\n";
756  }
757  result = false;
758  }
759 
760  lookup = kwl.find(prefix, AZ_STOP_TIME);
761  if (lookup)
762  {
763  _azStopTime = lookup;
764  }
765  else
766  {
767  if (traceDebug())
768  {
770  << MODULE
771  << "\nRequired keyword not found: "
772  << AZ_STOP_TIME << "\n";
773  }
774  result = false;
775  }
776 
777  lookup = kwl.find(prefix, RG_FIRST_TIME);
778  if (lookup)
779  {
780  _rgFirstPixelTime = lookup;
781  }
782  else
783  {
784  if (traceDebug())
785  {
787  << MODULE
788  << "\nRequired keyword not found: "
789  << RG_FIRST_TIME << "\n";
790  }
791  result = false;
792  }
793 
794  lookup = kwl.find(prefix, RG_LAST_TIME);
795  if (lookup)
796  {
797  _rgLastPixelTime = lookup;
798  }
799  else
800  {
801  if (traceDebug())
802  {
804  << MODULE
805  << "\nRequired keyword not found: "
806  << RG_LAST_TIME << "\n";
807  }
808  result = false;
809  }
810 
811 
812  lookup = kwl.find(prefix, GENERATION_TIME);
813  if (lookup)
814  {
815  _generationTime = lookup;
816  }
817  else
818  {
819  if (traceDebug())
820  {
822  << MODULE
823  << "\nRequired keyword not found: "
824  << GENERATION_TIME << "\n";
825  }
826  result = false;
827  }
828 
829  if (traceDebug())
830  {
832  << MODULE << " exit status = " << (result?"true":"false\n")
833  << std::endl;
834  }
835 
836  return result;
837 }
ossimString _rgLastPixelTime
Last pixel Range Time (Start acquisition time in range direction).
double _sceneCenterRangeTime
Scene Center range time.
double _radarFrequency
centerFrequency (instrument node).
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
ossimString _rgFirstPixelTime
First pixel Range Time (Start acquisition time in range direction).
ossim_uint32 _numberOfLayers
number of layer (ImageDataInfo node).
ossim_uint32 toUInt32() const
ossimString _generationTime
Generation time.
std::vector< double > _alt_srgr_coefset
alternative SRGR computation coefficients.
static const char * TYPE_KW
ossimString _azStartTime
Azimuthal Start Time (Start acquisition time).
ossimString _azStopTime
Azimuthal Stop Time (Start acquisition time).
double _SrToGr_scaling_factor
Slant Range TO Ground Range scaling factor at scene center.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
bool toBool() const
String to numeric methods.
unsigned int ossim_uint32
ossimPolygon theBoundGndPolygon
double toDouble() const
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
Definition: SceneCoord.cpp:84
std::vector< double > _calFactor
CalFactor (Calibration node).
bool open(const ossimFilename &file)
Method to intantial model from a file.
std::vector< Noise > _noise
Noise (Noise node).
std::vector< int > _SrToGr_exponent
Slant Range TO Ground Range Projection exponents.
virtual ossimString getClassName() const
Method to return the class name.
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
std::vector< double > _SrToGr_coeffs
Slant Range TO Ground Range Projection coefficients.
int toInt() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
SceneCoord * _sceneCoord
SceneCoord (SceneInfo node)
double _SrToGr_R0
Slant Range TO Ground Range Projection reference point.

◆ open()

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

Method to intantial model from a file.

Attempts to find the required xml file.

Parameters
file
Returns
true on success, false on error.

Definition at line 176 of file ossimTerraSarModel.cpp.

References ossimSupportFilesList::add(), ossimFilename::expand(), ossimRefPtr< T >::get(), ossimplugins::ossimTerraSarProductDoc::getAzimuthStartTime(), ossimplugins::ossimTerraSarProductDoc::getAzimuthStopTime(), ossimplugins::ossimTerraSarProductDoc::getGenerationTime(), ossimplugins::ossimTerraSarProductDoc::getMission(), ossimplugins::ossimTerraSarProductDoc::getProductType(), ossimplugins::ossimTerraSarProductDoc::getProjection(), ossimplugins::ossimTerraSarProductDoc::getRadarFrequency(), ossimplugins::ossimTerraSarProductDoc::getRadiometricCorrection(), ossimplugins::ossimTerraSarProductDoc::getRangeFirstPixelTime(), ossimplugins::ossimTerraSarProductDoc::getRangeLastPixelTime(), ossimplugins::ossimTerraSarProductDoc::getSceneId(), ossimplugins::ossimTerraSarProductDoc::initGsd(), ossimplugins::ossimTerraSarProductDoc::initImageSize(), ossimSupportFilesList::instance(), ossimplugins::ossimTerraSarProductDoc::isTerraSarX(), ossimFilename::NIL, ossimXmlDocument::openFile(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimNotifyLevel_NOTICE, ossimString::toFloat64(), and ossimString::upcase().

Referenced by ossimplugins::ossimTerraSarTiffReader::getInternalImageGeometry().

177 {
178  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::open() -- ";
179 
180  _imageFilename = file.expand();
182  ossimFilename xmlfile;
183  bool foundMetadataFile = findTSXLeader(file, xmlfile);
184  while (foundMetadataFile) // use of while allows use of "break"
185  {
186  //---
187  // Instantiate the XML parser:
188  //---
190  if ( !xdoc->openFile(xmlfile) ) break;
191 
192  ossimTerraSarProductDoc tsDoc;
193  if (!tsDoc.isTerraSarX(xdoc.get())) break;
194 
195  ossimString s;
196  if ( tsDoc.getProjection(xdoc.get(), s) )
197  {
198  if ( s.upcase() == "MAP" ) break;
199  }
200 
201  // Set the base class number of lines and samples
202  // Set the base class clip rect.
203  // Set the sub image offset. tmp hard coded (drb).
204  if (!tsDoc.initImageSize(xdoc.get(), theImageSize)) break;
206  theSubImageOffset.x = 0.0;
207  theSubImageOffset.y = 0.0;
208 
209  // Set the image ID to the scene ID.
210  if (!tsDoc.getSceneId(xdoc.get(), theImageID)) break;
211 
212  // Set the sensor ID to the mission ID.
213  if (!tsDoc.getMission(xdoc.get(), theSensorID)) break;
214 
215  // Set the base class gsd:
216  if (!tsDoc.initGsd(xdoc.get(), theGSD)) break;
217  theMeanGSD = (theGSD.x + theGSD.y)/2.0;
218 
219  initSRGR(xdoc.get(), tsDoc);
220 
221  if (!initPlatformPosition(xdoc.get(), tsDoc)) break;
222  if (!initSensorParams(xdoc.get(), tsDoc)) break;
223  if (!initRefPoint(xdoc.get(), tsDoc)) break;
224  if (!tsDoc.getProductType(xdoc.get(), _productType)) break;
225  if (!tsDoc.getRadiometricCorrection(xdoc.get(), _radiometricCorrection)) break;
226  if (!initAcquisitionInfo(xdoc.get(), tsDoc)) break;
227  if (!initNoise(xdoc.get(), tsDoc)) break;
228  if (!getPolLayerFromImageFile(xdoc.get(), file)) break;
229  if (!initCalibration(xdoc.get(), tsDoc)) break;
230 
231 // replaced by OTB by the initCalibration above
232 // if (!tsDoc.getCalFactor(xdoc.get(), s)) break;
233 // _calFactor = s.toFloat64();
234 
235  if (!tsDoc.getRadarFrequency(xdoc.get(), s)) break;
237 
238  if (!tsDoc.getAzimuthStartTime(xdoc.get(), _azStartTime)) break;
239  if (!tsDoc.getAzimuthStopTime(xdoc.get(), _azStopTime)) break;
240  if (!tsDoc.getRangeFirstPixelTime(xdoc.get(), _rgFirstPixelTime)) break;
241  if (!tsDoc.getRangeLastPixelTime(xdoc.get(), _rgLastPixelTime)) break;
242  if (!tsDoc.getGenerationTime(xdoc.get(), _generationTime)) break;
243 // removed by OTB
244 // if (!initIncidenceAngles(xdoc.get(), tsDoc)) break;
245  if (!initSceneCoord(xdoc.get(), tsDoc)) break;
246 
247  xdoc = 0;
248 
249  _productXmlFile = xmlfile;
251 
252  // Assign the ossimSensorModel::theBoundGndPolygon
253  ossimGpt ul;
254  ossimGpt ur;
255  ossimGpt lr;
256  ossimGpt ll;
261  setGroundRect(ul, ur, lr, ll); // ossimSensorModel method.
262  if (traceDebug())
263  {
264  ossimNotify(ossimNotifyLevel_NOTICE) << MODULE << "Loaded support data file <"<<xmlfile
265  <<"> for image <"<<file<<">."<<std::endl;
266 
268  << "4 corners from Projection: " << "\n"
269  << ul << ", " << ur << ", " << lr << ", " << ll << "\n";
270  }
271 
272  // OSSIM preferences specifies whether a coarse grid needs to be generated:
273  if (!createReplacementOCG()) break;
274  return true;
275  }
276 
277  // If we broke out of the while, something happened...
278  return false;
279 
280 } // End of: bool ossimTerraSarModel::open(const ossimFilename& file)
ossimString theSensorID
ossimString _rgLastPixelTime
Last pixel Range Time (Start acquisition time in range direction).
bool findTSXLeader(const ossimFilename &file, ossimFilename &metadataFile)
Method to find the metadata file TerraSAR file (image or xml).
bool createReplacementOCG()
Creates replacement coarse grid model if user requested via ossim preferences keyword "geometric_sar_...
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
static const ossimFilename NIL
This was taken from Wx widgets for performing touch and access date stamps.
Definition: ossimFilename.h:40
double _radarFrequency
centerFrequency (instrument node).
ossimString theImageID
ossimFilename expand() const
Method to do file name expansion.
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
ossimString _rgFirstPixelTime
First pixel Range Time (Start acquisition time in range direction).
ossimString _radiometricCorrection
RadiometricCorrection.
ossimString _generationTime
Generation time.
ossimString _azStartTime
Azimuthal Start Time (Start acquisition time).
ossimString _azStopTime
Azimuthal Stop Time (Start acquisition time).
ossimString _productType
ProductType.
ossimDpt theSubImageOffset
void add(const ossimFilename &f)
Add support data filename to the list:
bool initRefPoint(const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &rsDoc)
Method to initialize RefPoint object from TerraSAR product xml file.
bool openFile(const ossimFilename &filename)
ossim_float64 toFloat64() const
bool initPlatformPosition(const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &rsDoc)
bool initAcquisitionInfo(const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &tsDoc)
Method to initialize AcquisitionInfo parameters from TerraSAR product xml file.
bool initCalibration(const ossimXmlDocument *xmlDocument, const ossimTerraSarProductDoc &tsDoc)
Method to initialize Calibration parameters from TerraSAR product xml file.
bool getPolLayerFromImageFile(const ossimXmlDocument *xmlDocument, const ossimFilename &imageFilename)
Method to find the polLayer from the image file.
bool initSRGR(const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &rsDoc)
ossimDrect theImageClipRect
bool initSensorParams(const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &rsDoc)
ossim_int32 y
Definition: ossimIpt.h:142
void setGroundRect(const ossimGpt &ul, const ossimGpt &ur, const ossimGpt &lr, const ossimGpt &ll)
const ossimDpt & ur() const
Definition: ossimDrect.h:340
virtual void lineSampleToWorld(const ossimDpt &image_point, ossimGpt &gpt) const
double x
Definition: ossimDpt.h:164
bool initNoise(const ossimXmlDocument *xmlDocument, const ossimTerraSarProductDoc &tsDoc)
Method to initialize ImageNoise parameters from TerraSAR product xml file.
ossim_int32 x
Definition: ossimIpt.h:141
const ossimDpt & ll() const
Definition: ossimDrect.h:342
static ossimSupportFilesList * instance()
const ossimDpt & lr() const
Definition: ossimDrect.h:341
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
bool initSceneCoord(const ossimXmlDocument *xdoc, const ossimTerraSarProductDoc &tsDoc)
Method to initialize InfoIncidenceAngle parameters from TerraSAR product xml file.
ossim_float64 theMeanGSD

◆ print()

std::ostream & ossimplugins::ossimTerraSarModel::print ( std::ostream &  out) const
virtual

METHOD: print() Fulfills base-class pure virtual. Dumps contents of object to ostream.

Reimplemented from ossimplugins::ossimGeometricSarSensorModel.

Definition at line 839 of file ossimTerraSarModel.cpp.

840 {
841  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::print";
842  // Capture the original flags.
843  std::ios_base::fmtflags f = out.flags();
844 
845  out << setprecision(15) << setiosflags(ios::fixed)
846  << "\nossimTerraSarModelclass data members:\n"
847  << SR_GR_R0_KW << _SrToGr_R0 << "\n";
848 
849  ossim_uint32 i;
850 
851  ossimString kw1 = "sr_gr_exponent_";
852  for(i = 0; i < _SrToGr_exponent.size(); ++i)
853  {
855  ossimString kw = kw1;
856  kw += iStr;
857  kw += ": ";
858  out << kw << _SrToGr_exponent[i] << "\n";
859  }
860 
861  kw1 = "sr_gr_coeffs_";
862  for(i = 0; i < _SrToGr_coeffs.size(); ++i)
863  {
865  ossimString kw = kw1;
866  kw += iStr;
867  kw += ": ";
868  out << kw << _SrToGr_coeffs[i] << "\n";
869  }
870 
871  out << SC_RT_KW << ": " << _sceneCenterRangeTime << "\n"
872  << SR_GR_SF_KW << ": " << _SrToGr_scaling_factor << "\n"
873  << ALT_SR_GR_COEFFICIENT0_KW << ": " << _alt_srgr_coefset[0] << "\n"
874  << ALT_SR_GR_COEFFICIENT1_KW << ": " <<_alt_srgr_coefset[1] << "\n"
875  << ALT_SR_GR_COEFFICIENT2_KW << ": " <<_alt_srgr_coefset[2] << "\n"
876  << PRODUCT_XML_FILE_KW << ": " << _productXmlFile.c_str() << "\n";
877 
879  for(ossim_uint32 i = 0; i < _numberOfLayers; ++i)
880  {
881  if ( !_noise[i].print(out) )
882  {
883  if (traceDebug())
884  {
886  << MODULE
887  << "\n_noise->print failed!\n";
888  }
889  }
890  }
891 
892  if ( !_sceneCoord->print(out) )
893  {
894  if (traceDebug())
895  {
897  << MODULE
898  << "\n_sceneCoord->print failed!\n";
899  }
900  }
901 
902  out << NUMBER_LAYERS << ": " << _numberOfLayers << "\n";
903  for(ossim_uint32 idx = 0; idx < _numberOfLayers; ++idx)
904  {
905  out << CALIBRATION_CALFACTOR << "["<< idx << "]: " << _calFactor[idx] << "\n";
906  }
907  out << RADAR_FREQUENCY << ": " << _radarFrequency<< "\n";
908  out << AZ_START_TIME << ": " << _azStartTime << "\n";
909  out << AZ_STOP_TIME << ": " << _azStopTime << "\n";
910  out << RG_FIRST_TIME << ": " << _rgFirstPixelTime << "\n";
911  out << RG_LAST_TIME << ": " << _rgLastPixelTime << "\n";
912  out << GENERATION_TIME << ": " << _generationTime << "\n";
913 
914  // Reset flags.
915 
916  ossimString kw = ACQUISITION_INFO;
917  ossimString kw2 = kw + IMAGING_MODE;
918  out << kw2 << ": " << _imagingMode.c_str()<< "\n";
919  kw2 = kw + SENSOR;
920  out << kw2<< ": " << _acquisitionSensor.c_str()<< "\n";
921  kw2 = kw + LOOK_DIRECTION;
922  out << kw2<< ": " << _lookDirection.c_str()<< "\n";
923  kw2 = kw + POLARISATION_MODE;
924  out << kw2<< ": " << _polarisationMode.c_str()<< "\n";
925 /* kw2 = kw + POLARISATION_LIST;
926  for(ossim_uint32 i = 0; i < _numberOfLayers; ++i)
927  {
928  out << kw2 << "["<< i <<"] : " << _polLayer[i].c_str()<< "\n";
929  if ( _noise[i]->print(out) == false )
930  {
931  if (traceDebug())
932  {
933  ossimNotify(ossimNotifyLevel_WARN)
934  << MODULE
935  << "\n_noise->print failed!\n";
936  }
937  }
938  }
939 */
940 
941 
942  out.setf(f);
943 
944  return out;
945 }
ossimString _rgLastPixelTime
Last pixel Range Time (Start acquisition time in range direction).
double _sceneCenterRangeTime
Scene Center range time.
virtual std::ostream & print(std::ostream &out) const
double _radarFrequency
centerFrequency (instrument node).
static ossimString toString(bool aValue)
Numeric to string methods.
ossimString _rgFirstPixelTime
First pixel Range Time (Start acquisition time in range direction).
ossim_uint32 _numberOfLayers
number of layer (ImageDataInfo node).
ossimString _acquisitionSensor
Sensor (AcquisitionInfo node).
ossimString _generationTime
Generation time.
std::vector< double > _alt_srgr_coefset
alternative SRGR computation coefficients.
ossimString _azStartTime
Azimuthal Start Time (Start acquisition time).
ossimString _azStopTime
Azimuthal Stop Time (Start acquisition time).
double _SrToGr_scaling_factor
Slant Range TO Ground Range scaling factor at scene center.
ossimString _lookDirection
LookDirection (AcquisitionInfo node).
unsigned int ossim_uint32
std::vector< double > _calFactor
CalFactor (Calibration node).
virtual std::ostream & print(std::ostream &out) const
std::vector< Noise > _noise
Noise (Noise node).
std::vector< int > _SrToGr_exponent
Slant Range TO Ground Range Projection exponents.
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
ossimString _imagingMode
ImagingMode (AcquisitionInfo node).
std::vector< double > _SrToGr_coeffs
Slant Range TO Ground Range Projection coefficients.
virtual std::ostream & print(std::ostream &out) const
Definition: SceneCoord.cpp:139
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimString _polarisationMode
PolarisationMode (AcquisitionInfo node).
SceneCoord * _sceneCoord
SceneCoord (SceneInfo node)
double _SrToGr_R0
Slant Range TO Ground Range Projection reference point.

◆ printInfo()

void ossimplugins::ossimTerraSarModel::printInfo ( ostream &  os) const

Definition at line 2445 of file ossimTerraSarModel.cpp.

2446 {
2447  os << "\n----------------- General Info on TSX-1 Image -------------------"
2448  << "\n "
2449  << "\n Sensor ID : " << theSensorID
2450  << "\n Imaging Mode : " << _imagingMode
2451  << "\n Acquisition Sensor : " << _acquisitionSensor
2452  << "\n Look direction : " << _lookDirection
2453  << "\n Polarisation Mode : " << _polarisationMode
2454  << "\n Number of Layers : " << _numberOfLayers
2455  << "\n Polarisation List Size : " << _polLayerList.size()
2456  << "\n"
2457  << "\n------------------------------------------------------------------";
2458  for(ossim_uint32 idx = 0 ; idx < _polLayerList.size(); ++idx)
2459  {
2460  os << "\n----------------- Info on " << _polLayerList[idx] <<" Layer Image -------------------"
2461  << "\n calFactor : " << _calFactor[idx]
2462 // << "\n Image Noise size : " << _noise[idx].get_imageNoise().size()
2463  << "\n------------------------------------------------------------";
2464  }
2465  os << std::endl;
2466 }
ossimString theSensorID
ossim_uint32 _numberOfLayers
number of layer (ImageDataInfo node).
ossimString _acquisitionSensor
Sensor (AcquisitionInfo node).
ossimString _lookDirection
LookDirection (AcquisitionInfo node).
unsigned int ossim_uint32
std::vector< double > _calFactor
CalFactor (Calibration node).
std::vector< ossimString > _polLayerList
ossimString _imagingMode
ImagingMode (AcquisitionInfo node).
ossimString _polarisationMode
PolarisationMode (AcquisitionInfo node).

◆ saveState()

bool ossimplugins::ossimTerraSarModel::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 282 of file ossimTerraSarModel.cpp.

References ossimKeywordlist::add(), ossimNotify(), and ossimNotifyLevel_DEBUG.

284 {
285  static const char MODULE[] = "ossimplugins::ossimTerraSarModel::saveState";
286 
287  if (traceDebug())
288  {
289  ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " entered...\n";
290  }
291 
292  bool result = false;
293 
294  if ( (_alt_srgr_coefset.size() == 3) &&
295  ( _SrToGr_exponent.size() == _SrToGr_coeffs.size()) )
296  {
297  // Save our state:
298  kwl.add(prefix, SR_GR_R0_KW, _SrToGr_R0);
299 
300  ossimString kw1 = "sr_gr_exponent_";
301  ossimString kw2 = "sr_gr_coeffs_";
302 
303  const ossim_uint32 COUNT = _SrToGr_exponent.size();
304 
305  kwl.add(prefix, NUMBER_SRGR_COEFFICIENTS_KW, COUNT);
306 
307  for(ossim_uint32 i = 0; i < COUNT; ++i)
308  {
310  ossimString kw = kw1;
311  kw += iStr;
312  kwl.add(prefix, kw, _SrToGr_exponent[i]);
313  kw = kw2;
314  kw += iStr;
315  kwl.add(prefix, kw, _SrToGr_coeffs[i]);
316  }
317  kwl.add(prefix, SC_RT_KW, _sceneCenterRangeTime);
318  kwl.add(prefix, SR_GR_SF_KW, _SrToGr_scaling_factor);
319  kwl.add(prefix, ALT_SR_GR_COEFFICIENT0_KW, _alt_srgr_coefset[0]);
320  kwl.add(prefix, ALT_SR_GR_COEFFICIENT1_KW, _alt_srgr_coefset[1]);
321  kwl.add(prefix, ALT_SR_GR_COEFFICIENT2_KW, _alt_srgr_coefset[2]);
322  kwl.add(prefix, PRODUCT_XML_FILE_KW, _productXmlFile.c_str());
323 
324  // Call base save state:
325  result = ossimGeometricSarSensorModel::saveState(kwl, prefix);
326  }
327 
328  //---
329  // Uncomment to force load from product file instead of loadState.
330  //---
331  if (result)
332  {
333  // kwl.add(prefix, LOAD_FROM_PRODUCT_FILE_KW, "true");
334  }
335 
336  kwl.add(prefix, PRODUCT_TYPE, _productType.c_str());
337 
338  kwl.add(prefix, RADIOMETRIC_CORRECTION, _radiometricCorrection.c_str());
339 
340  ossimString kw = ACQUISITION_INFO;
341  ossimString kw2 = kw + IMAGING_MODE;
342  kwl.add(prefix, kw2, _imagingMode.c_str());
343  kw2 = kw + SENSOR;
344  kwl.add(prefix, kw2, _acquisitionSensor.c_str());
345  kw2 = kw + LOOK_DIRECTION;
346  kwl.add(prefix, kw2, _lookDirection.c_str());
347  kw2 = kw + POLARISATION_MODE;
348  kwl.add(prefix, kw2, _polarisationMode.c_str());
349  kw2 = kw + POLARISATION_LIST;
350  for(ossim_uint32 i = 0; i < _numberOfLayers; ++i)
351  {
352  ossimString iStr = ossimString::toString(i)+"]";
353  ossimString kw3 = kw2+"[";
354  kw3 += iStr;
355  kwl.add(prefix, kw3, _polLayerList[i].c_str());
356  }
357 
358  if( _polLayer !="UNDEFINED")
359  {
360  ossim_uint32 polLayerIdx = 0;
361  for(ossim_uint32 idx = 0 ; idx < _polLayerList.size(); ++idx)
362  {
363  if(_polLayerList[idx] == _polLayer)
364  {
365  polLayerIdx = idx;
366  }
367  }
368  _noise[polLayerIdx].saveState(kwl,prefix);
369  }
370  else
371  {
372  for(ossim_uint32 i = 0; i < _numberOfLayers; ++i)
373  {
374  _noise[i].saveState(kwl,prefix);
375  }
376  }
377  _sceneCoord->saveState(kwl,prefix);
378 
379  for(ossim_uint32 i = 0; i < _numberOfLayers; ++i)
380  {
381  kwl.add(prefix, CALIBRATION_CALFACTOR, ossimString::toString(_calFactor[i]).c_str());
382  }
383  kwl.add(prefix, RADAR_FREQUENCY, ossimString::toString(_radarFrequency).c_str());
384  kwl.add(prefix, AZ_START_TIME, _azStartTime.c_str());
385  kwl.add(prefix, AZ_STOP_TIME, _azStopTime.c_str());
386  kwl.add(prefix, RG_FIRST_TIME, _rgFirstPixelTime.c_str());
387  kwl.add(prefix, RG_LAST_TIME, _rgLastPixelTime.c_str());
388 
389  kwl.add(prefix, GENERATION_TIME, _generationTime.c_str());
390 
391  if (traceDebug())
392  {
394  << MODULE << " exit status = " << (result?"true":"false\n")
395  << std::endl;
396  }
397 
398  return result;
399 }
ossimString _rgLastPixelTime
Last pixel Range Time (Start acquisition time in range direction).
double _sceneCenterRangeTime
Scene Center range time.
double _radarFrequency
centerFrequency (instrument node).
static ossimString toString(bool aValue)
Numeric to string methods.
ossimString _rgFirstPixelTime
First pixel Range Time (Start acquisition time in range direction).
ossim_uint32 _numberOfLayers
number of layer (ImageDataInfo node).
ossimString _acquisitionSensor
Sensor (AcquisitionInfo node).
ossimString _radiometricCorrection
RadiometricCorrection.
ossimString _generationTime
Generation time.
std::vector< double > _alt_srgr_coefset
alternative SRGR computation coefficients.
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
Definition: SceneCoord.cpp:58
ossimString _azStartTime
Azimuthal Start Time (Start acquisition time).
ossimString _azStopTime
Azimuthal Stop Time (Start acquisition time).
double _SrToGr_scaling_factor
Slant Range TO Ground Range scaling factor at scene center.
ossimString _lookDirection
LookDirection (AcquisitionInfo node).
ossimString _productType
ProductType.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
unsigned int ossim_uint32
ossimString _polLayer
PolLayer (AcquisitionInfo node).
std::vector< double > _calFactor
CalFactor (Calibration node).
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
std::vector< ossimString > _polLayerList
std::vector< Noise > _noise
Noise (Noise node).
std::vector< int > _SrToGr_exponent
Slant Range TO Ground Range Projection exponents.
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
ossimString _imagingMode
ImagingMode (AcquisitionInfo node).
std::vector< double > _SrToGr_coeffs
Slant Range TO Ground Range Projection coefficients.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimString _polarisationMode
PolarisationMode (AcquisitionInfo node).
SceneCoord * _sceneCoord
SceneCoord (SceneInfo node)
double _SrToGr_R0
Slant Range TO Ground Range Projection reference point.

Member Data Documentation

◆ _acquisitionSensor

ossimString ossimplugins::ossimTerraSarModel::_acquisitionSensor
private

Sensor (AcquisitionInfo node).

Definition at line 252 of file ossimTerraSarModel.h.

◆ _alt_srgr_coefset

std::vector<double> ossimplugins::ossimTerraSarModel::_alt_srgr_coefset
private

alternative SRGR computation coefficients.

Three doubles.

Definition at line 232 of file ossimTerraSarModel.h.

◆ _azStartTime

ossimString ossimplugins::ossimTerraSarModel::_azStartTime
private

Azimuthal Start Time (Start acquisition time).

Definition at line 298 of file ossimTerraSarModel.h.

◆ _azStopTime

ossimString ossimplugins::ossimTerraSarModel::_azStopTime
private

Azimuthal Stop Time (Start acquisition time).

Definition at line 303 of file ossimTerraSarModel.h.

◆ _calFactor

std::vector<double> ossimplugins::ossimTerraSarModel::_calFactor
private

CalFactor (Calibration node).

Definition at line 283 of file ossimTerraSarModel.h.

◆ _generationTime

ossimString ossimplugins::ossimTerraSarModel::_generationTime
private

Generation time.

Definition at line 319 of file ossimTerraSarModel.h.

◆ _imagingMode

ossimString ossimplugins::ossimTerraSarModel::_imagingMode
private

ImagingMode (AcquisitionInfo node).

Definition at line 247 of file ossimTerraSarModel.h.

◆ _lookDirection

ossimString ossimplugins::ossimTerraSarModel::_lookDirection
private

LookDirection (AcquisitionInfo node).

Definition at line 257 of file ossimTerraSarModel.h.

◆ _noise

std::vector<Noise> ossimplugins::ossimTerraSarModel::_noise
private

Noise (Noise node).

Definition at line 273 of file ossimTerraSarModel.h.

◆ _numberOfLayers

ossim_uint32 ossimplugins::ossimTerraSarModel::_numberOfLayers
private

number of layer (ImageDataInfo node).

Definition at line 293 of file ossimTerraSarModel.h.

◆ _polarisationMode

ossimString ossimplugins::ossimTerraSarModel::_polarisationMode
private

PolarisationMode (AcquisitionInfo node).

Definition at line 262 of file ossimTerraSarModel.h.

◆ _polLayer

ossimString ossimplugins::ossimTerraSarModel::_polLayer
private

PolLayer (AcquisitionInfo node).

Definition at line 267 of file ossimTerraSarModel.h.

◆ _polLayerList

std::vector<ossimString> ossimplugins::ossimTerraSarModel::_polLayerList
private

Definition at line 268 of file ossimTerraSarModel.h.

◆ _productType

ossimString ossimplugins::ossimTerraSarModel::_productType
private

ProductType.

Definition at line 237 of file ossimTerraSarModel.h.

◆ _radarFrequency

double ossimplugins::ossimTerraSarModel::_radarFrequency
private

centerFrequency (instrument node).

Definition at line 288 of file ossimTerraSarModel.h.

◆ _radiometricCorrection

ossimString ossimplugins::ossimTerraSarModel::_radiometricCorrection
private

RadiometricCorrection.

Definition at line 242 of file ossimTerraSarModel.h.

◆ _rgFirstPixelTime

ossimString ossimplugins::ossimTerraSarModel::_rgFirstPixelTime
private

First pixel Range Time (Start acquisition time in range direction).

Definition at line 308 of file ossimTerraSarModel.h.

◆ _rgLastPixelTime

ossimString ossimplugins::ossimTerraSarModel::_rgLastPixelTime
private

Last pixel Range Time (Start acquisition time in range direction).

Definition at line 313 of file ossimTerraSarModel.h.

◆ _sceneCenterRangeTime

double ossimplugins::ossimTerraSarModel::_sceneCenterRangeTime
private

Scene Center range time.

Definition at line 222 of file ossimTerraSarModel.h.

◆ _sceneCoord

SceneCoord* ossimplugins::ossimTerraSarModel::_sceneCoord
private

SceneCoord (SceneInfo node)

Definition at line 278 of file ossimTerraSarModel.h.

Referenced by ossimTerraSarModel().

◆ _SrToGr_coeffs

std::vector<double> ossimplugins::ossimTerraSarModel::_SrToGr_coeffs
private

Slant Range TO Ground Range Projection coefficients.

Definition at line 218 of file ossimTerraSarModel.h.

◆ _SrToGr_exponent

std::vector<int> ossimplugins::ossimTerraSarModel::_SrToGr_exponent
private

Slant Range TO Ground Range Projection exponents.

Definition at line 213 of file ossimTerraSarModel.h.

◆ _SrToGr_R0

double ossimplugins::ossimTerraSarModel::_SrToGr_R0
private

Slant Range TO Ground Range Projection reference point.

Definition at line 208 of file ossimTerraSarModel.h.

◆ _SrToGr_scaling_factor

double ossimplugins::ossimTerraSarModel::_SrToGr_scaling_factor
private

Slant Range TO Ground Range scaling factor at scene center.

Definition at line 227 of file ossimTerraSarModel.h.

◆ theProductXmlFile

ossimFilename ossimplugins::ossimTerraSarModel::theProductXmlFile
private

Definition at line 321 of file ossimTerraSarModel.h.


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