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

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

#include <ossimCosmoSkymedModel.h>

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

Public Member Functions

 ossimCosmoSkymedModel ()
 Constructor. More...
 
 ~ossimCosmoSkymedModel ()
 Destructor. 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...
 
- Public Member Functions inherited from ossimplugins::ossimGeometricSarSensorModel
 ossimGeometricSarSensorModel ()
 default constructor More...
 
 ossimGeometricSarSensorModel (const ossimGeometricSarSensorModel &rhs)
 copy constructor More...
 
virtual ~ossimGeometricSarSensorModel ()
 Destructor. More...
 
virtual double getSlantRange (double col) const
 This function associates an image column number to a slant range. More...
 
virtual JSDDateTime getTime (double line) const
 This function associates an image line number to an azimuth time. More...
 
virtual bool getPlatformPositionAtLine (double line, vector< double > &position, vector< double > &speed)
 This function associates an image line number to a platform position and speed. More...
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
 This function is able to convert image coordinates into world coordinates the geometric model of SAR sensors. More...
 
virtual bool optimizeModel (const std::list< ossimGpt > &groundCoordinates, const std::list< ossimDpt > &imageCoordinates)
 This function optimizes the model according to a list of Ground Control Points. More...
 
virtual void clearGCPlist ()
 Clears _optimizationGCPsGroundCoordinates and _optimizationGCPsImageCoordinates attributes Updates the optimisation factors and bias. More...
 
virtual void getGCPlist (std::list< ossimGpt > &groundCoordinates, std::list< ossimDpt > &imageCoordinates)
 Returns _optimizationGCPsGroundCoordinates and _optimizationGCPsImageCoordinates attributes. More...
 
virtual bool useForward () const
 
virtual 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
 
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 ossimObjectdup () const =0
 
virtual ossimDpt forward (const ossimGpt &wp) const
 
virtual ossimGpt inverse (const ossimDpt &pp) const
 
virtual void getRoundTripError (const ossimDpt &imagePoint, ossimDpt &errorResult) const
 
virtual void getRoundTripError (const ossimGpt &groundPoint, ossimDpt &errorResult) const
 
virtual void getGroundClipPoints (ossimGeoPolygon &gpts) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual bool operator!= (const ossimProjection &projection) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
- Public Member Functions inherited from ossimOptimizableProjection
 ossimOptimizableProjection ()
 
 ossimOptimizableProjection (const ossimOptimizableProjection &source)
 
virtual ~ossimOptimizableProjection ()
 
virtual ossimOptimizableProjectionoperator= (const ossimOptimizableProjection &source)
 
virtual bool setupOptimizer (const ossimString &setup)
 setupFromString() Derived classes should implement as needed. Initialize parameters needed for optimizeFit and degreesOfFreedom More...
 
- Public Member Functions inherited from ossimAdjustableParameterInterface
 ossimAdjustableParameterInterface ()
 
 ossimAdjustableParameterInterface (const ossimAdjustableParameterInterface &rhs)
 
virtual ~ossimAdjustableParameterInterface ()
 
void newAdjustment (ossim_uint32 numberOfParameters=0)
 
void setAdjustmentDescription (const ossimString &description)
 
ossimString getAdjustmentDescription () const
 
ossimString getAdjustmentDescription (ossim_uint32 adjustmentIdx) const
 Returns adjustmentDescription of specific adjustmentInfo. More...
 
void setCurrentAdjustment (ossim_uint32 adjustmentIndex, bool notify=false)
 
bool setCurrentAdjustment (const ossimString &description, bool notify=false)
 Sets the current adjustment to the adjustment with a matching description. More...
 
void eraseAdjustment (bool notify)
 
void eraseAdjustment (ossim_uint32 idx, bool notify)
 
virtual void initAdjustableParameters ()
 
void resetAdjustableParameters (bool notify=false)
 
void copyAdjustment (ossim_uint32 idx, bool notify)
 
void copyAdjustment (bool notify=false)
 
void keepAdjustment (ossim_uint32 idx, bool createCopy)
 
virtual void keepAdjustment (bool createCopy=true)
 
const ossimAdjustableParameterInterfaceoperator= (const ossimAdjustableParameterInterface &rhs)
 
void removeAllAdjustments ()
 
ossim_uint32 getNumberOfAdjustableParameters () const
 
double getAdjustableParameter (ossim_uint32 idx) const
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, bool notify=false)
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, double sigma, bool notify=false)
 
double getParameterSigma (ossim_uint32 idx) const
 
void setParameterSigma (ossim_uint32 idx, double value, bool notify=false)
 
ossimUnitType getParameterUnit (ossim_uint32 idx) const
 
void setParameterUnit (ossim_uint32 idx, ossimUnitType unit)
 
void setParameterUnit (ossim_uint32 idx, const ossimString &unit)
 
void setParameterCenter (ossim_uint32 idx, double center, bool notify=false)
 
double getParameterCenter (ossim_uint32 idx) const
 
double computeParameterOffset (ossim_uint32 idx) const
 
void setParameterOffset (ossim_uint32 idx, ossim_float64 value, bool notify=false)
 
ossimString getParameterDescription (ossim_uint32 idx) const
 
void setParameterDescription (ossim_uint32 idx, const ossimString &descrption)
 
ossim_int32 findParameterIdxGivenDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
ossim_int32 findParameterIdxContainingDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
bool isParameterLocked (ossim_uint32 idx) const
 
void setParameterLockFlag (ossim_uint32 idxParam, bool flag)
 
bool getParameterLockFlag (ossim_uint32 idx) const
 
void lockAllParametersCurrentAdjustment ()
 
void unlockAllParametersCurrentAdjustment ()
 
void lockAllParameters (ossim_uint32 idxAdjustment)
 
void unlockAllParameters (ossim_uint32 idxAdjustment)
 
void resizeAdjustableParameterArray (ossim_uint32 numberOfParameters)
 
void setAdjustment (const ossimAdjustmentInfo &adj, bool notify=false)
 
void setAdjustment (ossim_uint32 idx, const ossimAdjustmentInfo &adj, bool notify=false)
 
void addAdjustment (const ossimAdjustmentInfo &adj, bool notify)
 
void getAdjustment (ossimAdjustmentInfo &adj) const
 
void getAdjustment (ossim_uint32 idx, ossimAdjustmentInfo &adj) const
 
ossim_uint32 getNumberOfAdjustments () const
 
ossim_uint32 getCurrentAdjustmentIdx () const
 
void setDirtyFlag (bool flag=true)
 
void setAllDirtyFlag (bool flag=true)
 
bool hasDirtyAdjustments () const
 
virtual void saveCurrentAdjustmentOnly (ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 Saves the current active adjustment to the KWL file. More...
 
bool saveAdjustments (ossimKeywordlist &kwl, const ossimString &prefix=ossimString("")) const
 Save all adjustments to the KWL file. More...
 
bool loadAdjustments (const ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 
std::ostream & print (std::ostream &out) const
 Dumps the currently active adjustment to ostream. More...
 

Protected Attributes

double _nbCol
 Number of columns. More...
 
double _SrGr_R0
 Slant Range for each Ground Range Projection reference point. More...
 
std::vector< double > _SrGr_coeffs
 Slant Range for each Ground Range Projection coefficients. More...
 
double _sceneCenterRangeTime
 Scene Center range time. More...
 
double _pixel_spacing
 Pixel spacing. 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
 

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 UtcDateTimeStringToCivilDate (const std::string &utcString, CivilDateTime &outputDate)
 

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...
 

Detailed Description

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

Definition at line 37 of file ossimCosmoSkymedModel.h.

Constructor & Destructor Documentation

◆ ossimCosmoSkymedModel()

ossimplugins::ossimCosmoSkymedModel::ossimCosmoSkymedModel ( )

Constructor.

Definition at line 31 of file ossimCosmoSkymedModel.cpp.

31  :
32  _nbCol(0),
33  _SrGr_R0(0),
36 {
37 }
double _SrGr_R0
Slant Range for each Ground Range Projection reference point.
double _sceneCenterRangeTime
Scene Center range time.

◆ ~ossimCosmoSkymedModel()

ossimplugins::ossimCosmoSkymedModel::~ossimCosmoSkymedModel ( )

Destructor.

Definition at line 39 of file ossimCosmoSkymedModel.cpp.

40 {
41 }

Member Function Documentation

◆ getSlantRangeFromGeoreferenced()

double ossimplugins::ossimCosmoSkymedModel::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 43 of file ossimCosmoSkymedModel.cpp.

References _pixel_spacing, ossimplugins::ossimGeometricSarSensorModel::_refPoint, ossimplugins::ossimGeometricSarSensorModel::_sensor, _SrGr_coeffs, _SrGr_R0, ossimplugins::SensorParams::get_col_direction(), ossimplugins::RefPoint::get_distance(), and ossimplugins::RefPoint::get_pix_col().

44 {
45  // in the case of Georeferenced images, _refPoint->get_distance() contains the ground range
46  double relativeGroundRange = _refPoint->get_distance() + _sensor->get_col_direction() * (col-_refPoint->get_pix_col())* _pixel_spacing ;
47 
48  double slantRange = _SrGr_coeffs[0]
49  + _SrGr_coeffs[1]*(relativeGroundRange-_SrGr_R0)
50  + _SrGr_coeffs[2]*(pow(relativeGroundRange,2)-_SrGr_R0)
51  + _SrGr_coeffs[3]*(pow(relativeGroundRange,3)-_SrGr_R0)
52  + _SrGr_coeffs[4]*(pow(relativeGroundRange,4)-_SrGr_R0)
53  + _SrGr_coeffs[5]*(pow(relativeGroundRange,5)-_SrGr_R0);
54 
55  return slantRange ;
56 }
double _SrGr_R0
Slant Range for each Ground Range Projection reference point.
double get_distance() const
Definition: RefPoint.cpp:95
std::vector< double > _SrGr_coeffs
Slant Range for each Ground Range Projection coefficients.
double get_pix_col() const
Definition: RefPoint.cpp:105

◆ InitPlatformPosition()

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

Initializes the Platform Position from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 128 of file ossimCosmoSkymedModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_platformPosition, ossimKeywordlist::find(), ossimplugins::CivilDateTime::get_day(), ossimplugins::CivilDateTime::get_month(), ossimplugins::CivilDateTime::get_year(), and UtcDateTimeStringToCivilDate().

129 {
130  /*
131  * Retrieval of ephemerisis number
132  */
133  const char* neph_str = kwl.find(prefix,"neph");
134  int neph = atoi(neph_str);
135 
136  /*
137  * Retrieval of reference date
138  */
139  const char* referenceUTC_str = kwl.find(prefix,"referenceUTC");
140  std::string referenceUTC(referenceUTC_str) ;
141  CivilDateTime ref_civil_date;
142  if (! UtcDateTimeStringToCivilDate(referenceUTC, ref_civil_date)) return false;
143 
144  /*
145  * Retrieval of ephemerisis
146  */
147  Ephemeris** ephemeris = new Ephemeris*[neph];
148  for (int i = 0; i < neph; ++i)
149  {
150  double pos[3];
151  double vit[3];
152  char name[64];
153 
154  sprintf(name,"eph%i_date",i);
155  const char* date_str = kwl.find(prefix,name);
156  float relative_date = atof(date_str);
157 
158  sprintf(name,"eph%i_posX",i);
159  const char* px_str = kwl.find(prefix,name);
160  pos[0] = atof(px_str);
161 
162  sprintf(name,"eph%i_posY",i);
163  const char* py_str = kwl.find(prefix,name);
164  pos[1] = atof(py_str);
165 
166  sprintf(name,"eph%i_posZ",i);
167  const char* pz_str = kwl.find(prefix,name);
168  pos[2] = atof(pz_str);
169 
170  sprintf(name,"eph%i_velX",i);
171  const char* vx_str = kwl.find(prefix,name);
172  vit[0] = atof(vx_str) ;
173 
174  sprintf(name,"eph%i_velY",i);
175  const char* vy_str = kwl.find(prefix,name);
176  vit[1] = atof(vy_str) ;
177 
178  sprintf(name,"eph%i_velZ",i);
179  const char* vz_str = kwl.find(prefix,name);
180  vit[2] = atof(vz_str) ;
181  /*
182  * Conversion to JSD Date
183  */
184  int second = (int) relative_date ;
185  double decimal = relative_date - second ;
186  CivilDateTime eph_civil_date(ref_civil_date.get_year(), ref_civil_date.get_month(), ref_civil_date.get_day(), second, decimal);
187  JSDDateTime eph_jsd_date(eph_civil_date);
188 
189  GeographicEphemeris* eph = new GeographicEphemeris(eph_jsd_date,pos,vit);
190 
191  ephemeris[i] = eph;
192  }
193 
194  /*
195  * Creation of the platform position interpolator
196  */
197  if (_platformPosition != NULL)
198  {
199  delete _platformPosition;
200  }
201  _platformPosition = new PlatformPosition(ephemeris,neph);
202 
203  /*
204  * Free of memory used by ephemerisis list : the constructor copies the ephemerisis
205  */
206  for (int i=0;i<neph;i++)
207  {
208  delete ephemeris[i];
209  }
210  delete[] ephemeris;
211 
212  return true;
213 }
const char * find(const char *key) const
bool UtcDateTimeStringToCivilDate(const std::string &utcString, CivilDateTime &outputDate)
PlatformPosition * _platformPosition
Handle the position of the platform.

◆ InitRefPoint()

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

Initializes the Reference Point from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 215 of file ossimCosmoSkymedModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_isProductGeoreferenced, _pixel_spacing, ossimplugins::ossimGeometricSarSensorModel::_platformPosition, ossimplugins::ossimGeometricSarSensorModel::_refPoint, ossimplugins::ossimGeometricSarSensorModel::_sensor, distance(), ossimKeywordlist::find(), ossimplugins::CivilDateTime::get_day(), ossimplugins::CivilDateTime::get_month(), ossimplugins::SensorParams::get_nRangeLook(), ossimplugins::RefPoint::get_pix_col(), ossimplugins::SensorParams::get_prf(), ossimplugins::SensorParams::get_sf(), ossimplugins::CivilDateTime::get_year(), ossimplugins::PlatformPosition::Interpolate(), ossimplugins::ossimGeometricSarSensorModel::optimizeModel(), ossimplugins::RefPoint::set_distance(), ossimplugins::RefPoint::set_ephemeris(), ossimplugins::RefPoint::set_pix_col(), ossimplugins::RefPoint::set_pix_line(), ossimSensorModel::theImageClipRect, ossimSensorModel::theImageSize, UtcDateTimeStringToCivilDate(), ossimIpt::x, and ossimIpt::y.

216 {
217  const char* sc_lin_str = kwl.find(prefix,"sc_lin");
218  double sc_lin = atof(sc_lin_str);
219 
220  const char* sc_pix_str = kwl.find(prefix,"sc_pix");
221  double sc_pix = atof(sc_pix_str);
222 
223  // const char* pixel_spacing_str = kwl.find(prefix,"pixel_spacing");
224  // double pixel_spacing = atof(pixel_spacing_str);
225 
226  const char* azimuthStartTime_str = kwl.find(prefix,"azimuthStartTime");
227  double azimuthStartTime = atof(azimuthStartTime_str);
228 
229  const char* rng_gate_str = kwl.find(prefix,"rng_gate");
230  double rng_gate = atof(rng_gate_str);
231 
232  const char* referenceUTC_str = kwl.find(prefix,"referenceUTC");
233  std::string referenceUTC(referenceUTC_str) ;
234  CivilDateTime ref_civil_date;
235  if (! UtcDateTimeStringToCivilDate(referenceUTC, ref_civil_date)) return false;
236 
237  if(_refPoint == NULL)
238  {
239  _refPoint = new RefPoint();
240  }
241 
242  _refPoint->set_pix_col(sc_pix);
243  _refPoint->set_pix_line(sc_lin);
244 
245  double relative_date = (azimuthStartTime + sc_lin/_sensor->get_prf());
246  int second = (int) relative_date ;
247  double decimal = relative_date - second ;
248 
249  if(_platformPosition != NULL)
250  {
251  CivilDateTime * date = new CivilDateTime(
252  ref_civil_date.get_year(), ref_civil_date.get_month(),
253  ref_civil_date.get_day(), second, decimal);
254 
255  Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)*date);
256  if (ephemeris == NULL) return false ;
257 
258  _refPoint->set_ephemeris(ephemeris);
259 
260  delete date;
261  date = 0;
262  delete ephemeris;
263  ephemeris = 0;
264  }
265  else
266  {
267  return false;
268  }
269 
270  double c = 2.99792458e+8;
271  double distance = (rng_gate + sc_pix*_sensor->get_nRangeLook()/_sensor->get_sf()) * (c/2.0);
272 
273  // in the case of Georeferenced images, the "relative" ground range is stored in place of the slant range
274  // (used for SlantRange computation relative to reference point, necessary for optimization)
275  // here, the pixelDirection is ignored since the CSKS reference point is always at the scene centre
278  }
279 
281 
282 
283  // in order to use ossimSensorModel::lineSampleToWorld
284  const char* nbCol_str = kwl.find(prefix,"nbCol");
285  const char* nbLin_str = kwl.find(prefix,"nbLin");
286  theImageSize.x = atoi(nbCol_str);
287  theImageSize.y = atoi(nbLin_str);
289 
290 
291  // Ground Control Points extracted from the model : scene center and corners
292  std::list<ossimGpt> groundGcpCoordinates ;
293  std::list<ossimDpt> imageGcpCoordinates ;
294  char name[64];
295  for (int k=0 ; k<5 ; k++) {
296  sprintf(name,"cornersCol%i",k);
297  const char* i_str = kwl.find(name);
298  int i = atoi(i_str);
299  sprintf(name,"cornersLin%i",k);
300  const char* j_str = kwl.find(name);
301  int j = atoi(j_str);
302  sprintf(name,"cornersLon%i",k);
303  const char* lon_str = kwl.find(name);
304  double lon = atof(lon_str);
305  sprintf(name,"cornersLat%i",k);
306  const char* lat_str = kwl.find(name);
307  double lat = atof(lat_str);
308  sprintf(name,"cornersHeight%i",k);
309  const char* height_str = kwl.find(name);
310  double height = atof(height_str) ;
311 
312  ossimDpt imageGCP(i,j);
313  ossimGpt groundGCP(lat, lon, height);
314  groundGcpCoordinates.push_back(groundGCP) ;
315  imageGcpCoordinates.push_back(imageGCP) ;
316  }
317 
318  // Default optimization
319  optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ;
320 
321  return true;
322 }
const char * find(const char *key) const
double get_nRangeLook() const
Definition: SensorParams.h:118
Ephemeris * Interpolate(JSDDateTime date) const
This function interpolates its ephemeris to create a new ephemeris at the given date and time...
void set_pix_line(double pix_line)
Definition: RefPoint.cpp:80
void set_pix_col(double pix_col)
Definition: RefPoint.cpp:85
bool _isProductGeoreferenced
True iff the product is ground range.
double get_pix_col() const
Definition: RefPoint.cpp:105
bool UtcDateTimeStringToCivilDate(const std::string &utcString, CivilDateTime &outputDate)
ossimDrect theImageClipRect
PlatformPosition * _platformPosition
Handle the position of the platform.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
virtual bool optimizeModel(const std::list< ossimGpt > &groundCoordinates, const std::list< ossimDpt > &imageCoordinates)
This function optimizes the model according to a list of Ground Control Points.
void set_ephemeris(Ephemeris *ephemeris)
Definition: RefPoint.cpp:65
float distance(double lat1, double lon1, double lat2, double lon2, int units)
void set_distance(double distance)
Definition: RefPoint.cpp:75

◆ InitSensorParams()

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

Initializes the Sensor Params from a projection keywordlist.

Todo:
: � voir sur de vrais produits (exemples de DESCENDING et ASCENDING)

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 58 of file ossimCosmoSkymedModel.cpp.

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

59 {
60  const char* central_freq_str = kwl.find(prefix,"central_freq");
61  double central_freq = atof(central_freq_str);
62  const char* fr_str = kwl.find(prefix,"fr");
63  double fr = atof(fr_str);
64  const char* fa_str = kwl.find(prefix,"fa");
65  double fa = atof(fa_str);
66 
67  //number of different looks
68  const char* n_azilok_str = kwl.find(prefix,"n_azilok");
69  double n_azilok = atof(n_azilok_str);
70  const char* n_rnglok_str = kwl.find(prefix,"n_rnglok");
71  double n_rnglok = atof(n_rnglok_str);
72 
73  //ellipsoid parameters
74  const char* ellip_maj_str = kwl.find(prefix,"ellip_maj");
75  double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m
76  const char* ellip_min_str = kwl.find(prefix,"ellip_min");
77  double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m
78 
79  if(_sensor != NULL)
80  {
81  delete _sensor;
82  }
83 
84  _sensor = new SensorParams();
85 
86 
90  const char* orbitDirection_str = kwl.find(prefix,"orbitDirection");
91  std::string orbitDirection(orbitDirection_str) ;
92  int orbitDirectionSign ;
93  if (orbitDirection=="DESCENDING") orbitDirectionSign = 1 ;
94  else orbitDirectionSign = - 1 ;
95 
96  const char* lookDirection_str = kwl.find(prefix,"lookDirection");
97  std::string lookDirection(lookDirection_str) ;
98  if ((lookDirection == "Right")||(lookDirection == "RIGHT")) _sensor->set_sightDirection(SensorParams::Right) ;
100 
101  const char* colsOrder_str = kwl.find(prefix,"colsOrder");
102  std::string colsOrder(colsOrder_str) ;
103  const char* linsOrder_str = kwl.find(prefix,"linsOrder");
104  std::string linsOrder(linsOrder_str) ;
105  if (colsOrder=="NEAR-FAR")
106  _sensor->set_col_direction(orbitDirectionSign);
107  else _sensor->set_col_direction(-orbitDirectionSign);
108  if (linsOrder=="NEAR-FAR")
109  _sensor->set_lin_direction(orbitDirectionSign);
110  else _sensor->set_lin_direction(-orbitDirectionSign);
111 
112  _sensor->set_sf(fr);
113  const double CLUM = 2.99792458e+8 ;
114  double wave_length = CLUM / central_freq ;
115  _sensor->set_rwl(wave_length);
116  _sensor->set_nAzimuthLook(n_azilok);
117  _sensor->set_nRangeLook(n_rnglok);
118 
119  // fa is the processing PRF
120  _sensor->set_prf(fa * n_azilok);
121 
122  _sensor->set_semiMajorAxis(ellip_maj) ;
123  _sensor->set_semiMinorAxis(ellip_min) ;
124 
125  return true;
126 }
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
void set_semiMinorAxis(double value)
Definition: SensorParams.h:158
void set_semiMajorAxis(double value)
Definition: SensorParams.h:153
void set_nRangeLook(double look)
Definition: SensorParams.h:138
void set_nAzimuthLook(double look)
Definition: SensorParams.h:133
void set_prf(double prf)
Definition: SensorParams.h:73
void set_col_direction(int dir)
Definition: SensorParams.h:123
void set_sf(double sf)
Definition: SensorParams.h:78

◆ InitSRGR()

bool ossimplugins::ossimCosmoSkymedModel::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 324 of file ossimCosmoSkymedModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_isProductGeoreferenced, _nbCol, _pixel_spacing, _SrGr_coeffs, _SrGr_R0, and ossimKeywordlist::find().

325 {
326  const char* rangeProjectionType_str = kwl.find(prefix,"rangeProjectionType");
327  std::string rangeProjectionType(rangeProjectionType_str);
328 
329  const char* pixel_spacing_str = kwl.find(prefix,"pixel_spacing");
330  _pixel_spacing= atof(pixel_spacing_str);
331 
332  _isProductGeoreferenced = (rangeProjectionType=="GROUNDRANGE") ;
333 
334  // Number of columns
335  const char* nbCol_str = kwl.find(prefix,"nbCol");
336  _nbCol = atoi(nbCol_str);
337 
338  // SRGR polynomial reference
339  const char* SrGr_R0_str = kwl.find(prefix,"SrGr_R0");
340  _SrGr_R0 = atof(SrGr_R0_str);
341 
342  // SRGR coefficients
343  char name[64];
344  double coeff ;
345  for(int i=0;i<6;i++)
346  {
347  sprintf(name,"SrToGr_coeffs_%i",i);
348  const char* coeff_str = kwl.find(prefix,name);
349  coeff = atof(coeff_str);
350  _SrGr_coeffs.push_back(coeff);
351  }
352 
353  return true;
354 }
double _SrGr_R0
Slant Range for each Ground Range Projection reference point.
const char * find(const char *key) const
bool _isProductGeoreferenced
True iff the product is ground range.
std::vector< double > _SrGr_coeffs
Slant Range for each Ground Range Projection coefficients.

◆ UtcDateTimeStringToCivilDate()

bool ossimplugins::ossimCosmoSkymedModel::UtcDateTimeStringToCivilDate ( const std::string &  utcString,
CivilDateTime outputDate 
)
private

Definition at line 357 of file ossimCosmoSkymedModel.cpp.

References ossimplugins::CivilDateTime::set_day(), ossimplugins::CivilDateTime::set_decimal(), ossimplugins::CivilDateTime::set_month(), ossimplugins::CivilDateTime::set_second(), ossimplugins::CivilDateTime::set_year(), and true.

Referenced by InitPlatformPosition(), and InitRefPoint().

357  {
358  // conversion :
359  // try with date format yyyymmdd
360 
361  if (utcString.size() < 8) return false ;
362  const char* stringUTCDate = utcString.c_str() ;
363 
364  char year_str[5];
365  for (int i=0;i<4;i++)
366  {
367  year_str[i] = stringUTCDate[i];
368  }
369  year_str[4] = '\0';
370 
371  char month_str[3];
372  for (int i=4;i<6;i++)
373  {
374  month_str[i-4] = stringUTCDate[i];
375  }
376  month_str[2] = '\0';
377 
378  char day_str[3];
379  for (int i=6;i<8;i++)
380  {
381  day_str[i-6] = stringUTCDate[i];
382  }
383  day_str[2] = '\0';
384 
385  outputDate.set_year(atoi(year_str));
386  outputDate.set_month(atoi(month_str));
387  outputDate.set_day(atoi(day_str));
388  outputDate.set_second(0);
389  outputDate.set_decimal(0.0);
390 
391  return true ;
392 }

Member Data Documentation

◆ _nbCol

double ossimplugins::ossimCosmoSkymedModel::_nbCol
protected

Number of columns.

Definition at line 61 of file ossimCosmoSkymedModel.h.

Referenced by InitSRGR().

◆ _pixel_spacing

double ossimplugins::ossimCosmoSkymedModel::_pixel_spacing
protected

Pixel spacing.

Definition at line 77 of file ossimCosmoSkymedModel.h.

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

◆ _sceneCenterRangeTime

double ossimplugins::ossimCosmoSkymedModel::_sceneCenterRangeTime
protected

Scene Center range time.

Definition at line 73 of file ossimCosmoSkymedModel.h.

◆ _SrGr_coeffs

std::vector<double> ossimplugins::ossimCosmoSkymedModel::_SrGr_coeffs
protected

Slant Range for each Ground Range Projection coefficients.

Definition at line 69 of file ossimCosmoSkymedModel.h.

Referenced by getSlantRangeFromGeoreferenced(), and InitSRGR().

◆ _SrGr_R0

double ossimplugins::ossimCosmoSkymedModel::_SrGr_R0
protected

Slant Range for each Ground Range Projection reference point.

Definition at line 65 of file ossimCosmoSkymedModel.h.

Referenced by getSlantRangeFromGeoreferenced(), and InitSRGR().


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