OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimSpotDimapSupportData.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 //
6 // Author: Oscar Kramer (ossim port by D. Burken)
7 //
8 // Description:
9 //
10 // Contains declaration of class ossimSpotDimapSupportData.
11 //
12 //*****************************************************************************
13 // $Id: ossimSpotDimapSupportData.h 17814 2010-08-03 12:44:02Z dburken $
14 #ifndef ossimSpotDimapSupportData_HEADER
15 #define ossimSpotDimapSupportData_HEADER
16 
17 #include <vector>
18 #include <iostream>
19 
21 #include <ossim/base/ossimObject.h>
22 #include <ossim/base/ossimRefPtr.h>
24 #include <ossim/base/ossimString.h>
26 #include <ossim/base/ossimDpt.h>
27 #include <ossim/base/ossimDpt3d.h>
28 #include <ossim/base/ossimDrect.h>
29 #include <ossim/base/ossimGpt.h>
31 
32 class ossimKeywordlist;
33 // class ossimRefPtr;
34 class ossimXmlDocument;
35 
38 {
39 public:
40 
43  {
47  };
48 
50 
51 
54  bool processSwir=false);
55 
56  virtual ossimObject* dup()const;
57 
58  void clearFields();
59  bool loadXmlFile(const ossimFilename& file,
60  bool processSwir=false);
61 
62  ossimString getSensorID() const;
66  ossimString getImageID() const;
67  ossimString getInstrument() const;
70  void getSunAzimuth(ossim_float64& az) const;
71  void getSunElevation(ossim_float64& el) const;
72  void getImageSize(ossimDpt& sz) const;
73  void getLineSamplingPeriod(ossim_float64& pe) const;
74  void getIncidenceAngle(ossim_float64& ia) const;
75  void getViewingAngle(ossim_float64& va) const;
76  void getSceneOrientation(ossim_float64& so) const;
78  ossim_uint32 getStepCount() const;
79  bool isStarTrackerUsed() const;
80  bool isSwirDataUsed() const;
81 
82  //---
83  // Image center point:
84  //---
85 
87  void getRefGroundPoint(ossimGpt& gp) const;
88 
90  void getRefImagePoint(ossimDpt& rp) const;
91 
92  void getRefLineTime(ossim_float64& rt) const;
93 
95  void getRefLineTimeLine(ossim_float64& rtl) const;
96 
98  void getImageRect(ossimDrect& rect)const;
99 
100  //---
101  // Sub image offset:
102  //---
103  void getSubImageOffset(ossimDpt& offset) const;
104 
105  //---
106  // Ephemeris (m & m/s):
107  //---
108  void getPositionEcf(ossim_uint32 sample, ossimEcefPoint& pe) const;
109  void getPositionEcf(const ossim_float64& time, ossimEcefPoint& pe) const;
110  void getVelocityEcf(ossim_uint32 sample, ossimEcefPoint& ve) const;
111  void getVelocityEcf(const ossim_float64& time, ossimEcefPoint& ve) const;
112  void getEphSampTime(ossim_uint32 sample, ossim_float64& et) const;
113 
115 
116  //---
117  // Attitude Angles in RADIANS:
118  //---
119  void getAttitude(ossim_uint32 sample, ossimDpt3d& at) const;
120  void getAttitude(const ossim_float64& time, ossimDpt3d& at) const;
121  void getAttSampTime(ossim_uint32 sample, ossim_float64& at) const;
123 
124  //---
125  // Pixel Pointing/Mirror tilt Angles in RADIANS:
126  //---
127  void getPixelLookAngleX (ossim_uint32 sample, ossim_float64& pa) const;
128  void getPixelLookAngleX (const ossim_float64& sample,
129  ossim_float64& pa) const;
130  void getPixelLookAngleY (ossim_uint32 sample, ossim_float64& pa) const;
131  void getPixelLookAngleY (const ossim_float64& sample,
132  ossim_float64& pa) const;
133 
134  //---
135  // Geoposition points provided in the file (most likely just corner points):
136  //---
138  void getGeoPosPoint (ossim_uint32 point, ossimDpt& ip, ossimGpt& gp) const;
139 
140  //---
141  // Corner points:
142  //---
143  void getUlCorner(ossimGpt& pt) const;
144  void getUrCorner(ossimGpt& pt) const;
145  void getLrCorner(ossimGpt& pt) const;
146  void getLlCorner(ossimGpt& pt) const;
147 
148  //---
149  // Convenient method to print important image info:
150  //---
151  void printInfo (ostream& os) const;
152 
153  virtual bool saveState(ossimKeywordlist& kwl,
154  const char* prefix = 0)const;
155  virtual bool loadState(const ossimKeywordlist& kwl,
156  const char* prefix = 0);
157 protected:
158  virtual ~ossimSpotDimapSupportData();
159 
160 private:
162  const std::vector<ossimDpt3d>& V,
163  const std::vector<ossim_float64>& T,
164  ossimDpt3d& li )const;
165 
167  const std::vector<ossimDpt3d>& V,
168  const std::vector<ossim_float64>& T,
169  ossimDpt3d& li )const;
170 
172  const std::vector<ossim_float64>& angles,
173  ossim_float64& la) const;
174 
175  ossim_float64 convertTimeStamp(const ossimString& time_stamp) const;
176 
177  void convertTimeStamp(const ossimString& time_stamp,
178  ossim_float64& ti) const;
179 
185 
190  bool initImageId(ossimRefPtr<ossimXmlDocument> xmlDocument);
191 
203 
223 
224  // Extrapolates the attitude for imaging times outside the defined range:
225  void extrapolateAttitude(const ossim_float64& time, ossimDpt3d& at) const;
226 
227 
235 
236  /*
237  * From xml section:
238  * /Dimap_Document/Dataset_Sources/Source_Information/
239  * Scene_Source
240  */
246 
248 
251 
254 
256 
259 
262 
264 
267  std::vector<ossim_float64> thePixelLookAngleX;
268  std::vector<ossim_float64> thePixelLookAngleY;
269  std::vector<ossimDpt3d> theAttitudeSamples; // x=pitch, y=roll, z=yaw
270  std::vector<ossim_float64> theAttSampTimes;
271  std::vector<ossimDpt3d> thePosEcfSamples;
272  std::vector<ossimDpt3d> theVelEcfSamples;
273  std::vector<ossim_float64> theEphSampTimes;
279 
280 
281  //---
282  // Corner points:
283  //---
288 
289  //---
290  // Geoposition Points:
291  //---
292  std::vector <ossimDpt> theGeoPosImagePoints;
293  std::vector <ossimGpt> theGeoPosGroundPoints;
294 
295  ossimGpt createGround(const ossimString& s)const;
296  ossimDpt createDpt(const ossimString& s)const;
297 
300  std::vector<ossim_float64> thePhysicalBias;
301  std::vector<ossim_float64> thePhysicalGain;
302 
303  std::vector<ossim_float64> theSolarIrradiance;
304 
315  bool parsePart1(ossimRefPtr<ossimXmlDocument> xmlDocument);
316  bool parsePart2(ossimRefPtr<ossimXmlDocument> xmlDocument);
317  bool parsePart3(ossimRefPtr<ossimXmlDocument> xmlDocument);
318  bool parsePart4(ossimRefPtr<ossimXmlDocument> xmlDocument);
319 };
320 
321 #endif /* #ifndef ossimSpotDimapSupportData_HEADER */
void getGeoPosPoint(ossim_uint32 point, ossimDpt &ip, ossimGpt &gp) const
void getEphSampTime(ossim_uint32 sample, ossim_float64 &et) const
void extrapolateAttitude(const ossim_float64 &time, ossimDpt3d &at) const
ossim_float64 convertTimeStamp(const ossimString &time_stamp) const
bool parsePart2(ossimRefPtr< ossimXmlDocument > xmlDocument)
void getSceneOrientation(ossim_float64 &so) const
bool initFramePoints(ossimRefPtr< ossimXmlDocument > xmlDocument)
Frame points:
std::vector< ossimDpt3d > theAttitudeSamples
bool loadXmlFile(const ossimFilename &file, bool processSwir=false)
std::vector< ossim_float64 > thePixelLookAngleY
void getPixelLookAngleX(ossim_uint32 sample, ossim_float64 &pa) const
ossimString getMetadataVersionString() const
bool parsePart3(ossimRefPtr< ossimXmlDocument > xmlDocument)
bool parsePart1(ossimRefPtr< ossimXmlDocument > xmlDocument)
Private parse methods called by loadXml.
Represents serializable keyword/value map.
bool initImageId(ossimRefPtr< ossimXmlDocument > xmlDocument)
Initializes theImageId.
void getImageRect(ossimDrect &rect) const
Zero based image rectangle, sub image if there is one.
void getInterpolatedLookAngle(const ossim_float64 &p, const std::vector< ossim_float64 > &angles, ossim_float64 &la) const
void getSunAzimuth(ossim_float64 &az) const
std::vector< ossim_float64 > theEphSampTimes
void getRefImagePoint(ossimDpt &rp) const
zero base center point
void getViewingAngle(ossim_float64 &va) const
ossim_float64 theRefLineTime
relative to full image
void getUrCorner(ossimGpt &pt) const
void getAttitude(ossim_uint32 sample, ossimDpt3d &at) const
void getVelocityEcf(ossim_uint32 sample, ossimEcefPoint &ve) const
void getPixelLookAngleY(ossim_uint32 sample, ossim_float64 &pa) const
void getImageSize(ossimDpt &sz) const
ossimSpotMetadataVersion
metadata.dim format version
double ossim_float64
ossimDpt theRefImagePoint
Zero based center of frame.
std::vector< ossim_float64 > theSolarIrradiance
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
ossim_float64 theRefLineTimeLine
relative to full image
void getUlCorner(ossimGpt &pt) const
ossimDpt createDpt(const ossimString &s) const
void getLagrangeInterpolation(const ossim_float64 &t, const std::vector< ossimDpt3d > &V, const std::vector< ossim_float64 > &T, ossimDpt3d &li) const
ossimSpotMetadataVersion theMetadataVersion
std::vector< ossim_float64 > thePhysicalBias
callibration information for radiometric corrections
unsigned int ossim_uint32
void getSunElevation(ossim_float64 &el) const
std::vector< ossimDpt > theGeoPosImagePoints
ossimGpt createGround(const ossimString &s) const
void getRefLineTimeLine(ossim_float64 &rtl) const
relative to full frame.
void getRefGroundPoint(ossimGpt &gp) const
Center of frame, sub image if there is one.
bool initSceneSource(ossimRefPtr< ossimXmlDocument > xmlDocument)
From xml section: /Dimap_Document/Dataset_Sources/Source_Information/Scene_Source.
bool parsePart4(ossimRefPtr< ossimXmlDocument > xmlDocument)
void getAttSampTime(ossim_uint32 sample, ossim_float64 &at) const
void getLineSamplingPeriod(ossim_float64 &pe) const
std::vector< ossimDpt3d > thePosEcfSamples
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
std::vector< ossimDpt3d > theVelEcfSamples
void getLlCorner(ossimGpt &pt) const
bool initMetadataVersion(ossimRefPtr< ossimXmlDocument > xmlDocument)
Initializes theMetadataVersion.
std::vector< ossim_float64 > thePixelLookAngleX
std::vector< ossimGpt > theGeoPosGroundPoints
virtual ossimObject * dup() const
void getPositionEcf(ossim_uint32 sample, ossimEcefPoint &pe) const
void getIncidenceAngle(ossim_float64 &ia) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
ossim_uint32 theDetectorCount
holds the size of thePixelLookAngleX/Y
void getSubImageOffset(ossimDpt &offset) const
std::vector< ossim_float64 > theAttSampTimes
std::vector< ossim_float64 > thePhysicalGain
void getRefLineTime(ossim_float64 &rt) const
void getBilinearInterpolation(const ossim_float64 &t, const std::vector< ossimDpt3d > &V, const std::vector< ossim_float64 > &T, ossimDpt3d &li) const
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
void getLrCorner(ossimGpt &pt) const