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

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

#include <ossimEnvisatAsarModel.h>

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

Public Member Functions

 ossimEnvisatAsarModel ()
 Constructor. More...
 
virtual ~ossimEnvisatAsarModel ()
 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
 
- 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...
 

Protected Attributes

int _n_srgr
 Slant Range to Ground Range (SRGR) number of coefficients sets. More...
 
std::vector< std::vector< double > > _srgr_coefset
 SRGR coefficient sets. More...
 
std::vector< JSDDateTime_srgr_update
 SRGR coefficient sets update times. 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 for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced. More...
 
std::vector< double > FindSRGRSetNumber (JSDDateTime date) const
 Finds the SRGR data set which update time is the closest to the center scene time. More...
 

Private Attributes

TYPE_DATA EnvisatAsarData_EnvisatAsarData
 List of metadata contained in the Data file. More...
 

Additional Inherited Members

- Public Types inherited from ossimSensorModel
enum  CovMatStatus { COV_INVALID = 0, COV_PARTIAL = 1, COV_FULL = 2 }
 
enum  DeriveMode {
  OBS_INIT =-99, EVALUATE =-98, P_WRT_X = -1, P_WRT_Y = -2,
  P_WRT_Z = -3
}
 
- Static Public Member Functions inherited from ossimSensorModel
static void writeGeomTemplate (ostream &os)
 
- Static Public Attributes inherited from ossimplugins::ossimGeometricSarSensorModel
static const char * CREATE_OCG_PREF_KW = "geometric_sar_sensor_model.create_ocg"
 
- Protected 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 is able to direct localisation and indirect localisation using the EnvisatAsar sensor model.

Definition at line 37 of file ossimEnvisatAsarModel.h.

Constructor & Destructor Documentation

◆ ossimEnvisatAsarModel()

ossimplugins::ossimEnvisatAsarModel::ossimEnvisatAsarModel ( )

Constructor.

Definition at line 40 of file ossimEnvisatAsarModel.cpp.

Referenced by dup().

40  :
41  _n_srgr(0),
42  _pixel_spacing(0),
43  _EnvisatAsarData(NULL)
44  {
45  }
int _n_srgr
Slant Range to Ground Range (SRGR) number of coefficients sets.
TYPE_DATA EnvisatAsarData * _EnvisatAsarData
List of metadata contained in the Data file.

◆ ~ossimEnvisatAsarModel()

ossimplugins::ossimEnvisatAsarModel::~ossimEnvisatAsarModel ( )
virtual

Destructor.

Definition at line 49 of file ossimEnvisatAsarModel.cpp.

References _EnvisatAsarData.

50  {
51  if(_EnvisatAsarData != NULL)
52  {
53  delete _EnvisatAsarData;
54  }
55  }
TYPE_DATA EnvisatAsarData * _EnvisatAsarData
List of metadata contained in the Data file.

Member Function Documentation

◆ dup()

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

Returns pointer to a new instance, copy of this.

Implements ossimProjection.

Definition at line 62 of file ossimEnvisatAsarModel.cpp.

References ossimEnvisatAsarModel().

63  {
64  return new ossimEnvisatAsarModel(*this);
65  }

◆ FindSRGRSetNumber()

std::vector< double > ossimplugins::ossimEnvisatAsarModel::FindSRGRSetNumber ( JSDDateTime  date) const
private

Finds the SRGR data set which update time is the closest to the center scene time.

Definition at line 652 of file ossimEnvisatAsarModel.cpp.

References _n_srgr, _srgr_coefset, _srgr_update, ossimplugins::JSDDateTime::get_decimal(), and ossimplugins::JSDDateTime::get_second().

Referenced by getSlantRangeFromGeoreferenced().

653  {
654  //if (_n_srgr==0) return NULL ;
655 
656  std::vector<double> delays;
657  double delay;
658  for (int i=0;i<_n_srgr;i++)
659  {
660  JSDDateTime datetmp(_srgr_update.at(i));
661  delay = date.get_second()+date.get_decimal() - (datetmp.get_second() + datetmp.get_decimal());
662  delays.push_back( fabs(delay) );
663  }
664 
665  int setNumber = 0 ;
666  double min_delay = delays[0] ;
667  for (int i=1;i<_n_srgr;i++)
668  {
669  if (delays[i]<min_delay) {
670  setNumber = i ;
671  min_delay = delays[i] ;
672  }
673  }
674 
675  return _srgr_coefset[setNumber];
676  }
int _n_srgr
Slant Range to Ground Range (SRGR) number of coefficients sets.
std::vector< std::vector< double > > _srgr_coefset
SRGR coefficient sets.
std::vector< JSDDateTime > _srgr_update
SRGR coefficient sets update times.

◆ getClassName()

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

Method to return the class name.

Returns
The name of this class.

Reimplemented from ossimObject.

Definition at line 57 of file ossimEnvisatAsarModel.cpp.

58  {
59  return ossimString("ossimEnvisatAsarModel");
60  }

◆ getSlantRangeFromGeoreferenced()

double ossimplugins::ossimEnvisatAsarModel::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 67 of file ossimEnvisatAsarModel.cpp.

References _n_srgr, _pixel_spacing, ossimplugins::ossimGeometricSarSensorModel::_refPoint, ossimplugins::ossimGeometricSarSensorModel::_sensor, FindSRGRSetNumber(), ossimplugins::SensorParams::get_col_direction(), and ossimplugins::RefPoint::get_ephemeris().

68  {
69  // const double CLUM = 2.99792458e+8 ;
70 
71  double GR, GR0, relativeGroundRange, slantRange; // , slantrangetime;
72 
73  if (_n_srgr==0) return(-1) ;
74 
75  std::vector<double> coefset = FindSRGRSetNumber((_refPoint->get_ephemeris())->get_date()) ;
76 
77  GR = _sensor->get_col_direction() * (col)* _pixel_spacing ;
78  GR0 = coefset[0];
79  relativeGroundRange = GR-GR0;
80  slantRange = coefset[1]
81  + coefset[2]*relativeGroundRange
82  + coefset[3]*pow(relativeGroundRange,2)
83  + coefset[4]*pow(relativeGroundRange,3)
84  + coefset[5]*pow(relativeGroundRange,4);
85 
86  // slantrangetime = 2.0*slantRange / (CLUM);
87  return slantRange ;
88  }
Ephemeris * get_ephemeris()
Definition: RefPoint.cpp:90
std::vector< double > FindSRGRSetNumber(JSDDateTime date) const
Finds the SRGR data set which update time is the closest to the center scene time.
int _n_srgr
Slant Range to Ground Range (SRGR) number of coefficients sets.

◆ InitPlatformPosition()

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

Initializes the Platform Position from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 430 of file ossimEnvisatAsarModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_platformPosition, and ossimKeywordlist::find().

Referenced by loadState().

431  {
432  const int neph = 5;
433  // long val_long;
434  // unsigned long val_ulong1;
435  // unsigned long val_ulong2;
436  CivilDateTime ref_civil_date;
437 
438  Ephemeris** ephemeris = new Ephemeris*[neph];
439 
440  for (int i=1;i<=neph;i++)
441  {
442  double pos[3];
443  double vel[3];
444  char name[64];
445 
446  /*
447  * Date de l'ephemeride
448  */
449  sprintf(name,"state_vector_time_%i_day",i);
450  long day = (long) atof(kwl.find(prefix,name));
451  sprintf(name,"state_vector_time_%i_sec",i);
452  unsigned long sec = (unsigned long) atof(kwl.find(prefix,name));
453  sprintf(name,"state_vector_time_%i_microsec",i);
454  unsigned long microsec = (unsigned long) atof(kwl.find(prefix,name));
455  MJDDateTime mjdDate(day, sec, microsec);
456  JSDDateTime jsd_date(mjdDate);
457  /*
458  * Position de l'ephemeride
459  */
460  sprintf(name,"x_pos_%i",i);
461  pos[0] = (double) atoi(kwl.find(prefix,name)) * 1.0e-2;
462  sprintf(name,"y_pos_%i",i);
463  pos[1] = (double) atoi(kwl.find(prefix,name)) * 1.0e-2;
464  sprintf(name,"z_pos_%i",i);
465  pos[2] = (double) atoi(kwl.find(prefix,name)) * 1.0e-2;
466  /*
467  * Vitesse de l'ephemeride
468  */
469  sprintf(name,"x_vel_%i",i);
470  vel[0] = (double) atoi(kwl.find(prefix,name)) * 1.0e-5;
471  sprintf(name,"y_vel_%i",i);
472  vel[1] = (double) atoi(kwl.find(prefix,name)) * 1.0e-5;
473  sprintf(name,"z_vel_%i",i);
474  vel[2] = (double) atoi(kwl.find(prefix,name)) * 1.0e-5;
475 
476  GeographicEphemeris* eph = new GeographicEphemeris(jsd_date, pos, vel);
477 
478  ephemeris[i-1] = eph;
479  }
480 
481  if (_platformPosition != NULL)
482  {
483  delete _platformPosition;
484  }
485  _platformPosition = new PlatformPosition(ephemeris,neph);
486 
487  /*
488  * Liberation de la memoire utilis�e par la liste des ephemerides
489  * ->Le constructeur effectue une copie des ephemerides
490  */
491  for (int i=0;i<neph;i++)
492  {
493  delete ephemeris[i];
494  }
495  delete[] ephemeris;
496 
497  return true;
498  }
const char * find(const char *key) const
PlatformPosition * _platformPosition
Handle the position of the platform.

◆ InitRefPoint()

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

Initializes the Reference Point from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 502 of file ossimEnvisatAsarModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_platformPosition, ossimplugins::ossimGeometricSarSensorModel::_refPoint, distance(), ossimKeywordlist::find(), 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, ossimIpt::x, and ossimIpt::y.

Referenced by loadState().

503  {
504 
505  // Reference image position
506  if(_refPoint == NULL)
507  {
508  _refPoint = new RefPoint();
509  }
510  double sc_pix = atof(kwl.find(prefix,"samp_num")) - 1.0;
511  _refPoint->set_pix_col(sc_pix);
512  double sc_lin = atof(kwl.find(prefix,"line_num")) - 1.0;
513  _refPoint->set_pix_line(sc_lin);
514 
515  // Reference Point distance
516  double c = 2.99792458e+8;
517  double distance = atof(kwl.find(prefix,"slant_range_time")) * (c/2.0) * 1.0e-9;
519 
520 
521  // Reference Point Ephemeris
522  long day_ref = (long)atof(kwl.find(prefix,"first_zero_doppler_time_day"));
523  unsigned long sec_ref = (unsigned long)atof(kwl.find(prefix,"first_zero_doppler_time_sec"));
524  unsigned long microsec_ref = (unsigned long)atof(kwl.find(prefix,"first_zero_doppler_time_microsec"));
525 
526  MJDDateTime mjdDate_ref(day_ref, sec_ref, microsec_ref);
527  JSDDateTime jsd_date_ref(mjdDate_ref);
528 
529  if(_platformPosition != NULL)
530  {
531  Ephemeris * ephemeris = _platformPosition->Interpolate(jsd_date_ref);
532  if (ephemeris == NULL) return false ;
533  _refPoint->set_ephemeris(ephemeris);
534  delete ephemeris;
535  }
536  else return false;
537 
538  // Adjustement of the model using the four corner points
539  // in order to use ossimSensorModel::lineSampleToWorld
540  const char* nbCol_str = kwl.find(prefix,"num_pix");
541  const char* nbLin_str = kwl.find(prefix,"num_lines");
542  theImageSize.x = atoi(nbCol_str);
543  theImageSize.y = atoi(nbLin_str);
545 
546  // Ground Control Points extracted from the model : corner points
547  std::list<ossimGpt> groundGcpCoordinates ;
548  std::list<ossimDpt> imageGcpCoordinates ;
549  double h = atof(kwl.find("avg_scene_height"));
550 
551  // first line first pix
552  double line = atof(kwl.find("UL_line")) - 1;
553  double col = atof(kwl.find("UL_col")) - 1;
554  double lon = atof(kwl.find("UL_lon")) * 1e-6;
555  double lat = atof(kwl.find("UL_lat")) * 1e-6;
556  if (lon > 180.0) lon -= 360.0;
557  ossimDpt imageGCP1(col,line);
558  ossimGpt groundGCP1(lat, lon, h);
559  groundGcpCoordinates.push_back(groundGCP1) ;
560  imageGcpCoordinates.push_back(imageGCP1) ;
561  // first line last pix
562  line = atof(kwl.find("UR_line")) - 1;
563  col = atof(kwl.find("UR_col")) - 1;
564  lon = atof(kwl.find("UR_lon")) * 1e-6;
565  lat = atof(kwl.find("UR_lat")) * 1e-6;
566  if (lon > 180.0) lon -= 360.0;
567  ossimDpt imageGCP2(col,line);
568  ossimGpt groundGCP2(lat, lon, h);
569  groundGcpCoordinates.push_back(groundGCP2) ;
570  imageGcpCoordinates.push_back(imageGCP2) ;
571  // last line last pix
572  line = atof(kwl.find("LR_line")) - 1;
573  col = atof(kwl.find("LR_col")) - 1;
574  lon = atof(kwl.find("LR_lon")) * 1e-6;
575  lat = atof(kwl.find("LR_lat")) * 1e-6;
576  if (lon > 180.0) lon -= 360.0;
577  ossimDpt imageGCP3(col,line);
578  ossimGpt groundGCP3(lat, lon, h);
579  groundGcpCoordinates.push_back(groundGCP3) ;
580  imageGcpCoordinates.push_back(imageGCP3) ;
581  // last line first pix
582  line = atof(kwl.find("LL_line")) - 1;
583  col = atof(kwl.find("LL_col")) - 1;
584  lon = atof(kwl.find("LL_lon")) * 1e-6;
585  lat = atof(kwl.find("LL_lat")) * 1e-6;
586  if (lon > 180.0) lon -= 360.0;
587  ossimDpt imageGCP4(col,line);
588  ossimGpt groundGCP4(lat, lon, h);
589  groundGcpCoordinates.push_back(groundGCP4) ;
590  imageGcpCoordinates.push_back(imageGCP4) ;
591 
592  // Default optimization
593  optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ;
594 
595  return true;
596  }
const char * find(const char *key) const
Ephemeris * Interpolate(JSDDateTime date) const
This function interpolates its ephemeris to create a new ephemeris at the given date and time...
void set_pix_line(double pix_line)
Definition: RefPoint.cpp:80
void set_pix_col(double pix_col)
Definition: RefPoint.cpp:85
ossimDrect theImageClipRect
PlatformPosition * _platformPosition
Handle the position of the platform.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
virtual bool optimizeModel(const std::list< ossimGpt > &groundCoordinates, const std::list< ossimDpt > &imageCoordinates)
This function optimizes the model according to a list of Ground Control Points.
void set_ephemeris(Ephemeris *ephemeris)
Definition: RefPoint.cpp:65
float distance(double lat1, double lon1, double lat2, double lon2, int units)
void set_distance(double distance)
Definition: RefPoint.cpp:75

◆ InitSensorParams()

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

Initializes the Sensor Params from a projection keywordlist.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 372 of file ossimEnvisatAsarModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_isProductGeoreferenced, ossimplugins::ossimGeometricSarSensorModel::_sensor, ossimKeywordlist::find(), ossimplugins::SensorParams::set_col_direction(), ossimplugins::SensorParams::set_lin_direction(), ossimplugins::SensorParams::set_prf(), ossimplugins::SensorParams::set_rwl(), and ossimplugins::SensorParams::set_sf().

Referenced by loadState().

373  {
374  const double CLUM = 2.99792458e+8;
375  const char* wave_length_str = kwl.find(prefix,"wave_length");
376  double wave_length = CLUM / atof(wave_length_str);
377  const char* fr_str = kwl.find(prefix,"range_sampling_rate");
378  double fr = atof(fr_str);
379 
380  // product type : Slant Range or Ground Range
381  _isProductGeoreferenced = atoi(kwl.find(prefix,"is_groundrange"));
382  double fa;
384  {
385  const char* fa_str = kwl.find(prefix,"prf");
386  fa = atof(fa_str);
387  }
388  else
389  {
390  const char* fa_str = kwl.find(prefix,"line_time_interval");
391  fa = 1.0/atof(fa_str);
392  }
393 
394  // TODO : v�rifier que ceci est ok pour les produits IMP
395  const char* time_dir_pix = "INCREASE";
396  const char* time_dir_lin = "INCREASE";
397 
398  if(_sensor != NULL)
399  {
400  delete _sensor;
401  }
402 
403  _sensor = new SensorParams();
404 
405  if(strcmp(time_dir_pix, "INCREASE") == 0)
406  {
408  }
409  else
410  {
412  }
413 
414  if(strcmp(time_dir_lin, "INCREASE") == 0)
415  {
417  }
418  else
419  {
421  }
422 
423  _sensor->set_prf(fa);
424  _sensor->set_sf(fr);
425  _sensor->set_rwl(wave_length);
426 
427  return true;
428  }
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_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::ossimEnvisatAsarModel::InitSRGR ( const ossimKeywordlist kwl,
const char *  prefix 
)
privatevirtual

Initializes the Slant Range for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced.

Implements ossimplugins::ossimGeometricSarSensorModel.

Definition at line 597 of file ossimEnvisatAsarModel.cpp.

References ossimplugins::ossimGeometricSarSensorModel::_isProductGeoreferenced, _n_srgr, _pixel_spacing, _srgr_coefset, _srgr_update, and ossimKeywordlist::find().

Referenced by loadState().

598  {
599  // product type : Slant Range or Ground Range
600  _isProductGeoreferenced = atoi(kwl.find(prefix,"is_groundrange"));
601 
602  // pixel spacing
603  _pixel_spacing = atof(kwl.find(prefix,"pixel_spacing"));
604 
605  // number of SRGR sets
606  _n_srgr = atoi(kwl.find(prefix,"n_srgr"));
607 
608 
609  char name[64];
610  for (int i=0;i<_n_srgr;i++)
611  {
612  // SRGR update time
613  sprintf(name,"srgr_update_day%i",i);
614  long day_ref = (long)atof(kwl.find(prefix,name));
615  sprintf(name,"srgr_update_sec%i",i);
616  unsigned long sec_ref = (unsigned long)atof(kwl.find(prefix,name));
617  sprintf(name,"srgr_update_microsec%i",i);
618  unsigned long microsec_ref = (unsigned long)atof(kwl.find(prefix,name));
619  MJDDateTime mjdDate_ref(day_ref, sec_ref, microsec_ref);
620  JSDDateTime jsd_date_ref(mjdDate_ref);
621  _srgr_update.push_back(jsd_date_ref);
622 
623  std::vector<double> srgr_set;
624  // SRGR coefficients
625  sprintf(name,"srgr_coef%iA",i);
626  const char* srgr_coef_strA = kwl.find(prefix,name);
627  srgr_set.push_back(atof(srgr_coef_strA));
628  sprintf(name,"srgr_coef%iB",i);
629  const char* srgr_coef_strB = kwl.find(prefix,name);
630  srgr_set.push_back(atof(srgr_coef_strB));
631  sprintf(name,"srgr_coef%iC",i);
632  const char* srgr_coef_strC = kwl.find(prefix,name);
633  srgr_set.push_back(atof(srgr_coef_strC));
634  sprintf(name,"srgr_coef%iD",i);
635  const char* srgr_coef_strD = kwl.find(prefix,name);
636  srgr_set.push_back(atof(srgr_coef_strD));
637  sprintf(name,"srgr_coef%iE",i);
638  const char* srgr_coef_strE = kwl.find(prefix,name);
639  srgr_set.push_back(atof(srgr_coef_strE)*1e-10);
640  sprintf(name,"srgr_coef%iF",i);
641  const char* srgr_coef_strF = kwl.find(prefix,name);
642  srgr_set.push_back(atof(srgr_coef_strF)*1e-10);
643 
644  _srgr_coefset.push_back(srgr_set);
645  }
646 
647 
648  return true;
649  }
const char * find(const char *key) const
bool _isProductGeoreferenced
True iff the product is ground range.
int _n_srgr
Slant Range to Ground Range (SRGR) number of coefficients sets.
std::vector< std::vector< double > > _srgr_coefset
SRGR coefficient sets.
std::vector< JSDDateTime > _srgr_update
SRGR coefficient sets update times.

◆ loadState()

bool ossimplugins::ossimEnvisatAsarModel::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 343 of file ossimEnvisatAsarModel.cpp.

References InitPlatformPosition(), InitRefPoint(), InitSensorParams(), and InitSRGR().

345  {
346  InitSensorParams(kwl, prefix);
347  InitPlatformPosition(kwl, prefix);
348  InitRefPoint(kwl, prefix);
349  InitSRGR(kwl, prefix);
350  return true;
351  }
virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Slant Range for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced.
virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Reference Point from a projection keywordlist.
virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Sensor Params from a projection keywordlist.
virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Platform Position from a projection keywordlist.

◆ open()

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

Method to intantial model from a file.

Parameters
file
Returns
true on success, false on error.

Definition at line 91 of file ossimEnvisatAsarModel.cpp.

References _EnvisatAsarData, ossimString::c_str(), ossimNotify(), and ossimNotifyLevel_DEBUG.

92  {
93  bool retValue = true;
94 
95  if (traceDebug())
96  {
97  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimEnvisatAsarTileSource::open(filename) DEBUG: entered..." << std::endl
98  << "Attempting to open file " << file << std::endl;
99  }
100 
101  /*
102  * Creation of the class allowing to store EnvisatAsarData file metadata
103  */
104  if (_EnvisatAsarData != NULL)
105  {
106  delete _EnvisatAsarData;
107  _EnvisatAsarData = NULL;
108  }
109 
110  /*
111  * Opening and test of the file
112  */
113  ossimFilename Filename = file;
114  ifstream dataFile(Filename.c_str(), ios::in | ios::binary);
115  if (dataFile.eof())
116  {
117  dataFile.close();
118  retValue = false;
119  }
120  else
121  {
122  mph mph_rec;
123  dataFile >> mph_rec;
124 
125  // test if it is an ENVISAT Data file
126  if (mph_rec.is_valid())
127  {
128  if (traceDebug())
129  {
130  ossimNotify(ossimNotifyLevel_DEBUG) << "Begin reading EnvisatAsar file" << std::endl;
131  }
132  /*
133  * Reading EnvisatAsarData file data
134  */
135  dataFile.seekg(0);
136  _EnvisatAsarData = new EnvisatAsarData();
137  dataFile >> *_EnvisatAsarData;
138  dataFile.close();
139  if (traceDebug())
140  {
141  ossimNotify(ossimNotifyLevel_DEBUG) << "End reading EnvisatAsar file" << std::endl;
142  }
143  }
144  else
145  {
146  dataFile.close();
147  retValue = false;
148  }
149  }
150 
151  if (traceDebug())
152  {
153  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimEnvisatAsarTileSource::open() DEBUG: returning..." << std::endl;
154  }
155 
156  return retValue;
157  }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
TYPE_DATA EnvisatAsarData * _EnvisatAsarData
List of metadata contained in the Data file.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ print()

std::ostream & ossimplugins::ossimEnvisatAsarModel::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 353 of file ossimEnvisatAsarModel.cpp.

References _n_srgr, _pixel_spacing, and ossimplugins::ossimGeometricSarSensorModel::print().

354  {
355  // Capture the original flags.
356  std::ios_base::fmtflags f = out.flags();
357 
358  out << setprecision(15) << setiosflags(ios::fixed)
359  << "\nossimEnvisatAsarModel data members:\n"
360  << "_pixel_spacing: " << _pixel_spacing << "\n"
361  << "_n_srgr: " << _n_srgr << "\n";
362 
364 
365  // Reset flags.
366  out.setf(f);
367 
368 
369  return out;
370  }
int _n_srgr
Slant Range to Ground Range (SRGR) number of coefficients sets.
virtual std::ostream & print(std::ostream &out) const

◆ saveState()

bool ossimplugins::ossimEnvisatAsarModel::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 160 of file ossimEnvisatAsarModel.cpp.

References _EnvisatAsarData, ossimKeywordlist::add(), ossimplugins::MainProcessingParameters::get_avg_scene_height_ellpsoid(), ossimplugins::GeolocationGrid::get_first_zero_doppler_time_day(), ossimplugins::SRGRConversionParameters::get_first_zero_doppler_time_day(), ossimplugins::GeolocationGrid::get_first_zero_doppler_time_microsec(), ossimplugins::SRGRConversionParameters::get_first_zero_doppler_time_microsec(), ossimplugins::GeolocationGrid::get_first_zero_doppler_time_sec(), ossimplugins::SRGRConversionParameters::get_first_zero_doppler_time_sec(), ossimplugins::EnvisatAsarData::get_GeolocationGrid(), ossimplugins::SRGRConversionParameters::get_ground_range_origin(), ossimplugins::GeolocationGrid::get_lats(), ossimplugins::GeolocationGrid::get_line_num(), ossimplugins::sph::get_line_time_interval(), ossimplugins::GeolocationGrid::get_longs(), ossimplugins::EnvisatAsarData::get_MainProcessingParameters(), ossimplugins::EnvisatAsarData::get_num_ds(), ossimplugins::MainProcessingParameters::get_num_output_lines(), ossimplugins::MainProcessingParameters::get_num_samples_per_line(), ossimplugins::MainProcessingParameters::get_prf(), ossimplugins::MainProcessingParameters::get_radar_freq(), ossimplugins::MainProcessingParameters::get_range_samp_rate(), ossimplugins::sph::get_range_spacing(), ossimplugins::GeolocationGrid::get_samp_numbers(), ossimplugins::GeolocationGrid::get_slant_range_times(), ossimplugins::EnvisatAsarData::get_sph(), ossimplugins::SRGRConversionParameters::get_srgr_coef(), ossimplugins::MainProcessingParameters::get_srgr_flag(), ossimplugins::EnvisatAsarData::get_SRGRConversionParameters(), ossimplugins::MainProcessingParameters::get_state_vector_time_1_day(), ossimplugins::MainProcessingParameters::get_state_vector_time_1_microsec(), ossimplugins::MainProcessingParameters::get_state_vector_time_1_sec(), ossimplugins::MainProcessingParameters::get_state_vector_time_2_day(), ossimplugins::MainProcessingParameters::get_state_vector_time_2_microsec(), ossimplugins::MainProcessingParameters::get_state_vector_time_2_sec(), ossimplugins::MainProcessingParameters::get_state_vector_time_3_day(), ossimplugins::MainProcessingParameters::get_state_vector_time_3_microsec(), ossimplugins::MainProcessingParameters::get_state_vector_time_3_sec(), ossimplugins::MainProcessingParameters::get_state_vector_time_4_day(), ossimplugins::MainProcessingParameters::get_state_vector_time_4_microsec(), ossimplugins::MainProcessingParameters::get_state_vector_time_4_sec(), ossimplugins::MainProcessingParameters::get_state_vector_time_5_day(), ossimplugins::MainProcessingParameters::get_state_vector_time_5_microsec(), ossimplugins::MainProcessingParameters::get_state_vector_time_5_sec(), ossimplugins::MainProcessingParameters::get_x_pos_1(), ossimplugins::MainProcessingParameters::get_x_pos_2(), ossimplugins::MainProcessingParameters::get_x_pos_3(), ossimplugins::MainProcessingParameters::get_x_pos_4(), ossimplugins::MainProcessingParameters::get_x_pos_5(), ossimplugins::MainProcessingParameters::get_x_vel_1(), ossimplugins::MainProcessingParameters::get_x_vel_2(), ossimplugins::MainProcessingParameters::get_x_vel_3(), ossimplugins::MainProcessingParameters::get_x_vel_4(), ossimplugins::MainProcessingParameters::get_x_vel_5(), ossimplugins::MainProcessingParameters::get_y_pos_1(), ossimplugins::MainProcessingParameters::get_y_pos_2(), ossimplugins::MainProcessingParameters::get_y_pos_3(), ossimplugins::MainProcessingParameters::get_y_pos_4(), ossimplugins::MainProcessingParameters::get_y_pos_5(), ossimplugins::MainProcessingParameters::get_y_vel_1(), ossimplugins::MainProcessingParameters::get_y_vel_2(), ossimplugins::MainProcessingParameters::get_y_vel_3(), ossimplugins::MainProcessingParameters::get_y_vel_4(), ossimplugins::MainProcessingParameters::get_y_vel_5(), ossimplugins::MainProcessingParameters::get_z_pos_1(), ossimplugins::MainProcessingParameters::get_z_pos_2(), ossimplugins::MainProcessingParameters::get_z_pos_3(), ossimplugins::MainProcessingParameters::get_z_pos_4(), ossimplugins::MainProcessingParameters::get_z_pos_5(), ossimplugins::MainProcessingParameters::get_z_vel_1(), ossimplugins::MainProcessingParameters::get_z_vel_2(), ossimplugins::MainProcessingParameters::get_z_vel_3(), ossimplugins::MainProcessingParameters::get_z_vel_4(), ossimplugins::MainProcessingParameters::get_z_vel_5(), true, and ossimKeywordNames::TYPE_KW.

162  {
163  char name[64];
164 
165  kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimEnvisatAsarModel", true);
166 
167  /*
168  * Adding metadata necessary to the sensor model into the keywordlist
169  * Data derived from the SPH record
170  */
171  sph* sph_rec = _EnvisatAsarData->get_sph();
172  if(sph_rec != NULL)
173  {
174  kwl.add(prefix, "pixel_spacing", sph_rec->get_range_spacing().c_str(), true );
175  kwl.add(prefix, "line_time_interval", sph_rec->get_line_time_interval().c_str(), true );
176  }
177  else
178  {
179  return false;
180  }
181  /*
182  * Adding metadata necessary to the sensor model into the keywordlist
183  * Data derived from the Main Processing Parameters record
184  */
185  MainProcessingParameters* MPP_rec = _EnvisatAsarData->get_MainProcessingParameters();
186  if(MPP_rec != NULL)
187  {
188  kwl.add(prefix, "num_pix", (double)MPP_rec->get_num_samples_per_line(), true );
189  kwl.add(prefix, "num_lines", (double)MPP_rec->get_num_output_lines(), true );
190  kwl.add(prefix, "wave_length", MPP_rec->get_radar_freq(), true );
191  kwl.add(prefix, "range_sampling_rate", MPP_rec->get_range_samp_rate(), true );
192  kwl.add(prefix, "prf", MPP_rec->get_prf(), true );
193  kwl.add(prefix, "avg_scene_height", MPP_rec->get_avg_scene_height_ellpsoid(), true );
194  kwl.add(prefix, "is_groundrange", MPP_rec->get_srgr_flag(), true );
195  kwl.add(prefix, "state_vector_time_1_day", (double)MPP_rec->get_state_vector_time_1_day(), true );
196  kwl.add(prefix, "state_vector_time_1_sec", (double)MPP_rec->get_state_vector_time_1_sec(), true );
197  kwl.add(prefix, "state_vector_time_1_microsec", (double)MPP_rec->get_state_vector_time_1_microsec(), true );
198  kwl.add(prefix, "x_pos_1", (double)MPP_rec->get_x_pos_1(), true );
199  kwl.add(prefix, "y_pos_1", (double)MPP_rec->get_y_pos_1(), true );
200  kwl.add(prefix, "z_pos_1", (double)MPP_rec->get_z_pos_1(), true );
201  kwl.add(prefix, "x_vel_1", (double)MPP_rec->get_x_vel_1(), true );
202  kwl.add(prefix, "y_vel_1", (double)MPP_rec->get_y_vel_1(), true );
203  kwl.add(prefix, "z_vel_1", (double)MPP_rec->get_z_vel_1(), true );
204  kwl.add(prefix, "state_vector_time_2_day",(double) MPP_rec->get_state_vector_time_2_day(), true );
205  kwl.add(prefix, "state_vector_time_2_sec", (double)MPP_rec->get_state_vector_time_2_sec(), true );
206  kwl.add(prefix, "state_vector_time_2_microsec", (double)MPP_rec->get_state_vector_time_2_microsec(), true );
207  kwl.add(prefix, "x_pos_2", (double)MPP_rec->get_x_pos_2(), true );
208  kwl.add(prefix, "y_pos_2", (double)MPP_rec->get_y_pos_2(), true );
209  kwl.add(prefix, "z_pos_2", (double)MPP_rec->get_z_pos_2(), true );
210  kwl.add(prefix, "x_vel_2", (double)MPP_rec->get_x_vel_2(), true );
211  kwl.add(prefix, "y_vel_2", (double)MPP_rec->get_y_vel_2(), true );
212  kwl.add(prefix, "z_vel_2", (double)MPP_rec->get_z_vel_2(), true );
213  kwl.add(prefix, "state_vector_time_3_day", (double)MPP_rec->get_state_vector_time_3_day(), true );
214  kwl.add(prefix, "state_vector_time_3_sec", (double)MPP_rec->get_state_vector_time_3_sec(), true );
215  kwl.add(prefix, "state_vector_time_3_microsec", (double)MPP_rec->get_state_vector_time_3_microsec(), true );
216  kwl.add(prefix, "x_pos_3", (double)MPP_rec->get_x_pos_3(), true );
217  kwl.add(prefix, "y_pos_3", (double)MPP_rec->get_y_pos_3(), true );
218  kwl.add(prefix, "z_pos_3", (double)MPP_rec->get_z_pos_3(), true );
219  kwl.add(prefix, "x_vel_3", (double)MPP_rec->get_x_vel_3(), true );
220  kwl.add(prefix, "y_vel_3", (double)MPP_rec->get_y_vel_3(), true );
221  kwl.add(prefix, "z_vel_3", (double)MPP_rec->get_z_vel_3(), true );
222  kwl.add(prefix, "state_vector_time_4_day", (double)MPP_rec->get_state_vector_time_4_day(), true );
223  kwl.add(prefix, "state_vector_time_4_sec", (double)MPP_rec->get_state_vector_time_4_sec(), true );
224  kwl.add(prefix, "state_vector_time_4_microsec", (double)MPP_rec->get_state_vector_time_4_microsec(), true );
225  kwl.add(prefix, "x_pos_4", (double)MPP_rec->get_x_pos_4(), true );
226  kwl.add(prefix, "y_pos_4", (double)MPP_rec->get_y_pos_4(), true );
227  kwl.add(prefix, "z_pos_4", (double)MPP_rec->get_z_pos_4(), true );
228  kwl.add(prefix, "x_vel_4", (double)MPP_rec->get_x_vel_4(), true );
229  kwl.add(prefix, "y_vel_4", (double)MPP_rec->get_y_vel_4(), true );
230  kwl.add(prefix, "z_vel_4", (double)MPP_rec->get_z_vel_4(), true );
231  kwl.add(prefix, "state_vector_time_5_day", (double)MPP_rec->get_state_vector_time_5_day(), true );
232  kwl.add(prefix, "state_vector_time_5_sec", (double)MPP_rec->get_state_vector_time_5_sec(), true );
233  kwl.add(prefix, "state_vector_time_5_microsec", (double)MPP_rec->get_state_vector_time_5_microsec(), true );
234  kwl.add(prefix, "x_pos_5", (double)MPP_rec->get_x_pos_5(), true );
235  kwl.add(prefix, "y_pos_5",(double) MPP_rec->get_y_pos_5(), true );
236  kwl.add(prefix, "z_pos_5", (double)MPP_rec->get_z_pos_5(), true );
237  kwl.add(prefix, "x_vel_5", (double)MPP_rec->get_x_vel_5(), true );
238  kwl.add(prefix, "y_vel_5", (double)MPP_rec->get_y_vel_5(), true );
239  kwl.add(prefix, "z_vel_5", (double)MPP_rec->get_z_vel_5(), true );
240  }
241  else
242  {
243  return false;
244  }
245  /*
246  * Adding metadata necessary to the sensor model into the keywordlist
247  * Data derived from the Geolocation Grid record - Reference Point
248  */
249  GeolocationGrid* GG_rec = _EnvisatAsarData->get_GeolocationGrid(0);
250  if(GG_rec != NULL)
251  {
252  kwl.add(prefix, "first_zero_doppler_time_day", (double)GG_rec->get_first_zero_doppler_time_day(), true );
253  kwl.add(prefix, "first_zero_doppler_time_sec", (double)GG_rec->get_first_zero_doppler_time_sec(), true );
254  kwl.add(prefix, "first_zero_doppler_time_microsec", (double)GG_rec->get_first_zero_doppler_time_microsec(), true );
255  kwl.add(prefix, "line_num", (double)GG_rec->get_line_num(), true );
256  kwl.add(prefix, "samp_num", (double)(GG_rec->get_samp_numbers())[0], true );
257  kwl.add(prefix, "slant_range_time", (double)(GG_rec->get_slant_range_times())[0], true );
258  }
259  else
260  {
261  return false;
262  }
263  /*
264  * Adding metadata necessary to the sensor model into the keywordlist
265  * Data derived from the Geolocation Grid record - Corners
266  */
268  if(GG_rec != NULL)
269  {
270  kwl.add(prefix, "UL_line", (double)GG_rec->get_line_num(), true );
271  kwl.add(prefix, "UL_col", (double)(GG_rec->get_samp_numbers())[0], true );
272  kwl.add(prefix, "UL_lat", (double)(GG_rec->get_lats())[0], true );
273  kwl.add(prefix, "UL_lon", (double)(GG_rec->get_longs())[0], true );
274  kwl.add(prefix, "UR_line", (double)GG_rec->get_line_num(), true );
275  kwl.add(prefix, "UR_col", (double)(GG_rec->get_samp_numbers())[10], true );
276  kwl.add(prefix, "UR_lat", (double)(GG_rec->get_lats())[10], true );
277  kwl.add(prefix, "UR_lon", (double)(GG_rec->get_longs())[10], true );
278  }
279  else
280  {
281  return false;
282  }
284  if(GG_rec != NULL)
285  {
286  kwl.add(prefix, "LL_line", (double)GG_rec->get_line_num(), true );
287  kwl.add(prefix, "LL_col", (double)(GG_rec->get_samp_numbers())[0], true );
288  kwl.add(prefix, "LL_lat", (double)(GG_rec->get_lats())[0], true );
289  kwl.add(prefix, "LL_lon", (double)(GG_rec->get_longs())[0], true );
290  kwl.add(prefix, "LR_line", (double)GG_rec->get_line_num(), true );
291  kwl.add(prefix, "LR_col", (double)(GG_rec->get_samp_numbers())[10], true );
292  kwl.add(prefix, "LR_lat", (double)(GG_rec->get_lats())[10], true );
293  kwl.add(prefix, "LR_lon", (double)(GG_rec->get_longs())[10], true );
294  }
295  else
296  {
297  return false;
298  }
299 
300  /*
301  * Adding metadata necessary to the sensor model into the keywordlist
302  */
303  int n_srgr = 0;
304  SRGRConversionParameters * SRGRParameters = _EnvisatAsarData->get_SRGRConversionParameters(0);
305  if(SRGRParameters != NULL)
306  {
307  n_srgr = _EnvisatAsarData->get_num_ds(SRGRParameters);
308 
309  for (int i=0;i<n_srgr;i++)
310  {
311  SRGRConversionParameters * SRGR = _EnvisatAsarData->get_SRGRConversionParameters(i);
312 
313  sprintf(name,"srgr_update_day%i",i);
314  kwl.add(prefix, name, (double)SRGR->get_first_zero_doppler_time_day(),true);
315 
316  sprintf(name,"srgr_update_sec%i",i);
317  kwl.add(prefix, name, (double)SRGR->get_first_zero_doppler_time_sec(),true);
318 
319  sprintf(name,"srgr_update_microsec%i",i);
320  kwl.add(prefix, name, (double)SRGR->get_first_zero_doppler_time_microsec(),true);
321 
322  sprintf(name,"srgr_coef%iA",i);
323  kwl.add(prefix, name,(double)SRGR->get_ground_range_origin(),true);
324 
325  sprintf(name,"srgr_coef%iB",i);
326  kwl.add(prefix, name,(double)SRGR->get_srgr_coef()[0],true);
327  sprintf(name,"srgr_coef%iC",i);
328  kwl.add(prefix, name,(double)SRGR->get_srgr_coef()[1],true);
329  sprintf(name,"srgr_coef%iD",i);
330  kwl.add(prefix, name,(double)SRGR->get_srgr_coef()[2],true);
331  sprintf(name,"srgr_coef%iE",i);
332  kwl.add(prefix, name,(double)SRGR->get_srgr_coef()[3]*1e10,true);
333  sprintf(name,"srgr_coef%iF",i);
334  kwl.add(prefix, name,(double)SRGR->get_srgr_coef()[4]*1e10,true);
335  }
336  }
337 
338  kwl.add(prefix, "n_srgr" , n_srgr,true);
339 
340  return true;
341  }
MainProcessingParameters * get_MainProcessingParameters()
GeolocationGrid * get_GeolocationGrid(int num_ds=0)
static const char * TYPE_KW
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
TYPE_DATA EnvisatAsarData * _EnvisatAsarData
List of metadata contained in the Data file.
SRGRConversionParameters * get_SRGRConversionParameters(int pos=0)
int get_num_ds(EnvisatAsarRecord *record)

Member Data Documentation

◆ _EnvisatAsarData

TYPE_DATA EnvisatAsarData* ossimplugins::ossimEnvisatAsarModel::_EnvisatAsarData
private

List of metadata contained in the Data file.

Definition at line 134 of file ossimEnvisatAsarModel.h.

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

◆ _n_srgr

int ossimplugins::ossimEnvisatAsarModel::_n_srgr
protected

Slant Range to Ground Range (SRGR) number of coefficients sets.

Definition at line 103 of file ossimEnvisatAsarModel.h.

Referenced by FindSRGRSetNumber(), getSlantRangeFromGeoreferenced(), InitSRGR(), and print().

◆ _pixel_spacing

double ossimplugins::ossimEnvisatAsarModel::_pixel_spacing
protected

Pixel spacing.

Definition at line 115 of file ossimEnvisatAsarModel.h.

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

◆ _srgr_coefset

std::vector< std::vector<double> > ossimplugins::ossimEnvisatAsarModel::_srgr_coefset
protected

SRGR coefficient sets.

Definition at line 107 of file ossimEnvisatAsarModel.h.

Referenced by FindSRGRSetNumber(), and InitSRGR().

◆ _srgr_update

std::vector<JSDDateTime> ossimplugins::ossimEnvisatAsarModel::_srgr_update
protected

SRGR coefficient sets update times.

Definition at line 111 of file ossimEnvisatAsarModel.h.

Referenced by FindSRGRSetNumber(), and InitSRGR().


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