OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFormosatDimapSupportData.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 //----------------------------------------------------------------------------
10 // $Id$
11 
12 #ifndef ossimFormosatDimapSupportData_HEADER
13 #define ossimFormosatDimapSupportData_HEADER 1
14 
16 
18 #include <ossim/base/ossimObject.h>
19 #include <ossim/base/ossimRefPtr.h>
21 #include <ossim/base/ossimString.h>
23 #include <ossim/base/ossimDpt.h>
24 #include <ossim/base/ossimDpt3d.h>
25 #include <ossim/base/ossimDrect.h>
26 #include <ossim/base/ossimGpt.h>
28 
29 #include <vector>
30 #include <iostream>
31 
32 class ossimKeywordlist;
33 // class ossimRefPtr;
34 class ossimXmlDocument;
35 
38 {
39 public:
40 
43  {
44  OSSIM_FORMOSAT_METADATA_VERSION_UNKNOWN = 0,
45  OSSIM_FORMOSAT_METADATA_VERSION_1_0 = 1,
46  OSSIM_FORMOSAT_METADATA_VERSION_1_1 = 2
47  };
48 
50 
51 
54 
55  virtual ossimObject* dup()const;
56 
57  void clearFields();
58  bool loadXmlFile(const ossimFilename& file);
59 
60  ossimString getSensorID() const;
61  ossimString getMetadataVersionString() const;
62  ossimString getAcquisitionDate() const;
63  ossimString getProductionDate() const;
64  ossimString getSoftwareVersion() const;
65  ossimString getImageID() const;
66  ossimString getInstrument() const;
67  ossim_uint32 getInstrumentIndex() const;
68  ossimFilename getMetadataFile() const;
69  void getSunAzimuth(ossim_float64& az) const;
70  void getSunElevation(ossim_float64& el) const;
71  void getSatAzimuth(ossim_float64& az) 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 getViewingAngleAlongTrack(ossim_float64& va) const;
77  void getViewingAngleAcrossTrack(ossim_float64& va) const;
78  void getSceneOrientation(ossim_float64& so) const;
79  ossim_uint32 getNumberOfBands() const;
80  bool isStarTrackerUsed() const;
81  bool isSwirDataUsed() const;
82 
83  //---
84  // Image center point:
85  //---
86 
88  void getRefGroundPoint(ossimGpt& gp) const;
89 
91  void getRefImagePoint(ossimDpt& rp) const;
92 
93  void getRefLineTime(ossim_float64& rt) const;
94 
96  void getRefLineTimeLine(ossim_float64& rtl) const;
97 
99  void getImageRect(ossimDrect& rect)const;
100 
101  //---
102  // Sub image offset:
103  //---
104  void getSubImageOffset(ossimDpt& offset) const;
105 
106  //---
107  // Ephemeris (m & m/s):
108  //---
109  void getPositionEcf(ossim_uint32 sample, ossimEcefPoint& pe) const;
110  void getPositionEcf(const ossim_float64& time, ossimEcefPoint& pe) const;
111  void getVelocityEcf(ossim_uint32 sample, ossimEcefPoint& ve) const;
112  void getVelocityEcf(const ossim_float64& time, ossimEcefPoint& ve) const;
113  void getEphSampTime(ossim_uint32 sample, ossim_float64& et) const;
114 
115  ossim_uint32 getNumEphSamples() const;
116 
117  //---
118  // Attitude Angles in RADIANS:
119  //---
120  void getAttitude(ossim_uint32 sample, ossimDpt3d& at) const;
121  void getAttitude(const ossim_float64& time, ossimDpt3d& at) const;
122  void getAttSampTime(ossim_uint32 sample, ossim_float64& at) const;
123  ossim_uint32 getNumAttSamples() const;
124 
125  //---
126  // Polynomial instrument look angle in RADIANS:
127  //---
128  void getPixelLookAngleX (ossim_uint32 sample, ossim_float64& pa) const;
129  void getPixelLookAngleX (const ossim_float64& sample,
130  ossim_float64& pa) const;
131  void getPixelLookAngleY (ossim_uint32 sample, ossim_float64& pa) const;
132  void getPixelLookAngleY (const ossim_float64& sample,
133  ossim_float64& pa) const;
134 
135  //---
136  // Geoposition points provided in the file (most likely just corner points):
137  //---
138  ossim_uint32 getNumGeoPosPoints() const;
139  void getGeoPosPoint (ossim_uint32 point, ossimDpt& ip, ossimGpt& gp) const;
140 
141  //---
142  // Corner points:
143  //---
144  void getUlCorner(ossimGpt& pt) const;
145  void getUrCorner(ossimGpt& pt) const;
146  void getLrCorner(ossimGpt& pt) const;
147  void getLlCorner(ossimGpt& pt) const;
148 
149  //---
150  // Convenient method to print important image info:
151  //---
152  void printInfo (ostream& os) const;
153 
154  virtual bool saveState(ossimKeywordlist& kwl,
155  const char* prefix = 0)const;
156  virtual bool loadState(const ossimKeywordlist& kwl,
157  const char* prefix = 0);
158 protected:
160 
161 private:
162  void getLagrangeInterpolation(const ossim_float64& t,
163  const std::vector<ossimDpt3d>& V,
164  const std::vector<ossim_float64>& T,
165  ossimDpt3d& li )const;
166 
167  void getBilinearInterpolation(const ossim_float64& t,
168  const std::vector<ossimDpt3d>& V,
169  const std::vector<ossim_float64>& T,
170  ossimDpt3d& li )const;
171 
172  void getInterpolatedLookAngle(const ossim_float64& p,
173  const std::vector<ossim_float64>& angles,
174  ossim_float64& la) const;
175 
176  ossim_float64 convertTimeStamp(const ossimString& time_stamp) const;
177 
178  void convertTimeStamp(const ossimString& time_stamp,
179  ossim_float64& ti) const;
180 
185  bool initMetadataVersion(ossimRefPtr<ossimXmlDocument> xmlDocument);
186 
191  bool initImageId(ossimRefPtr<ossimXmlDocument> xmlDocument);
192 
204  bool initSceneSource(ossimRefPtr<ossimXmlDocument> xmlDocument);
205 
222  bool initFramePoints(ossimRefPtr<ossimXmlDocument> xmlDocument);
223 
232 
233  /*
234  * From xml section:
235  * /Dimap_Document/Dataset_Sources/Source_Information/
236  * Scene_Source
237  */
246 
248 
251 
254 
256 
259 
262 
264 
266  std::vector<ossim_float64> thePolynomialLookAngleX;
267  std::vector<ossim_float64> thePolynomialLookAngleY;
268  std::vector<ossimDpt3d> theAttitudeSamples; // x=pitch, y=roll, z=yaw
269  std::vector<ossim_float64> theAttSampTimes;
270  std::vector<ossimDpt3d> thePosEcfSamples;
271  std::vector<ossimDpt3d> theVelEcfSamples;
272  std::vector<ossim_float64> theEphSampTimes;
276 
277 
278  //---
279  // Corner points:
280  //---
281  //ossimGpt theUlCorner;
282  //ossimGpt theUrCorner;
283  //ossimGpt theLrCorner;
284  //ossimGpt theLlCorner;
285  std::vector <ossimDpt> theFrameVertexPosImagePoints;
286  std::vector <ossimGpt> theFrameVertexPosGroundPoints;
287 
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 ossimFormosatDimapSupportData_HEADER */
std::vector< ossim_float64 > thePolynomialLookAngleX
holds the size of thePixelLookAngleX/Y
std::vector< ossim_float64 > thePhysicalGain
std::vector< ossimDpt > theFrameVertexPosImagePoints
Represents serializable keyword/value map.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Definition: ossimObject.cpp:95
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
std::vector< ossimDpt3d > theAttitudeSamples
double ossim_float64
ossimFormosatMetadataVersion theMetadataVersion
std::vector< ossim_float64 > theSolarIrradiance
ossim_float64 theRefLineTime
relative to full image
unsigned int ossim_uint32
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
std::vector< ossim_float64 > thePolynomialLookAngleY
#define OSSIM_PLUGINS_DLL
ossimFormosatMetadataVersion
metadata.dim format version
std::vector< ossimGpt > theFrameVertexPosGroundPoints
ossim_float64 theRefLineTimeLine
relative to full image
std::vector< ossim_float64 > theEphSampTimes
virtual ossimObject * dup() const
Definition: ossimObject.cpp:29
std::vector< ossim_float64 > theAttSampTimes
ossimDpt theRefImagePoint
Zero based center of frame.
std::vector< ossim_float64 > thePhysicalBias
callibration information for radiometric corrections
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23