1 /******************************************************************************
2  *
3  * Purpose: Support for storing and manipulating Orbit information
4  *
5  ******************************************************************************
6  * Copyright (c) 2009
7  * PCI Geomatics, 90 Allstate Parkway, Markham, Ontario, Canada.
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a
10  * copy of this software and associated documentation files (the "Software"),
11  * to deal in the Software without restriction, including without limitation
12  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  * and/or sell copies of the Software, and to permit persons to whom the
14  * Software is furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25  * DEALINGS IN THE SOFTWARE.
26  ****************************************************************************/
27 #ifndef INCLUDE_PCIDSK_ORBIT_INFORMATION_H
28 #define INCLUDE_PCIDSK_ORBIT_INFORMATION_H
29 
30 #include <string>
31 #include <cstring>
32 #include <vector>
33 
34 namespace PCIDSK
35 {
36 /* -------------------------------------------------------------------- */
37 /*      Structure for ephemeris segment (ORBIT segment, type 160).      */
38 /* -------------------------------------------------------------------- */
39 #define EPHEMERIS_BLK           8
40 #define EPHEMERIS_RADAR_BLK     10
41 #define EPHEMERIS_ATT_BLK       9
42 /* -------------------------------------------------------------------- */
43 /*      Structure for Satellite Radar segment.                          */
44 /* -------------------------------------------------------------------- */
45 #define ANC_DATA_PER_BLK        16
46 #define ANC_DATA_SIZE           32
47     /**
48      * Ancillary data structure.
49      */
50     struct AncillaryData_t
51     {
52         /**
53          * Default constructor
54          */
AncillaryData_tAncillaryData_t55         AncillaryData_t() :
56             SlantRangeFstPixel(0),
57             SlantRangeLastPixel(0),
58             FstPixelLat(0.f),
59             MidPixelLat(0.f),
60             LstPixelLat(0.f),
61             FstPixelLong(0.f),
62             MidPixelLong(0.f),
63             LstPixelLong(0.f)
64         {
65         }
66         /**
67          * Copy constructor
68          * @param oAD the ancillary data to copy
69          */
AncillaryData_tAncillaryData_t70         AncillaryData_t(const AncillaryData_t& oAD)
71         {
72             Copy(oAD);
73         }
74 
75         /**
76          * assignment operator
77          * @param oAD the ancillary data to assign
78          */
79         AncillaryData_t& operator=(const AncillaryData_t& oAD)
80         {
81             Copy(oAD);
82             return *this;
83         }
84 
85         /**
86          * Copy function
87          * @param oAD the ancillary data to copy
88          */
CopyAncillaryData_t89         void Copy(const AncillaryData_t& oAD)
90         {
91             if(this == &oAD)
92             {
93                 return;
94             }
95             SlantRangeFstPixel = oAD.SlantRangeFstPixel;
96             SlantRangeLastPixel = oAD.SlantRangeLastPixel;
97             FstPixelLat = oAD.FstPixelLat;
98             MidPixelLat = oAD.MidPixelLat;
99             LstPixelLat = oAD.LstPixelLat;
100             FstPixelLong = oAD.FstPixelLong;
101             MidPixelLong = oAD.MidPixelLong;
102             LstPixelLong = oAD.LstPixelLong;
103         }
104 
105         int   SlantRangeFstPixel;   /* Slant Range to First Pixel (m) */
106         int   SlantRangeLastPixel;  /* Slant Range to Last Pixel (m) */
107         float FstPixelLat;          /* First Pixel Latitude (millionths degrees) */
108         float MidPixelLat;          /* Mid Pixel Latitude (millionths degrees)   */
109         float LstPixelLat;          /* Last Pixel Latitude (millionths degrees)  */
110         float FstPixelLong;         /* First Pixel Longitude (millionths degrees)*/
111         float MidPixelLong;         /* Mid Pixel Longitude (millionths degrees)  */
112         float LstPixelLong;         /* Last Pixel Longitude (millionths degrees) */
113     } ;
114 
115     /**
116      * Radar segment information
117      */
118     struct RadarSeg_t
119     {
120         /**
121          * Default constructor
122          */
RadarSeg_tRadarSeg_t123         RadarSeg_t() :
124             EquatorialRadius(0.0),
125             PolarRadius(0.0),
126             IncidenceAngle(0.0),
127             PixelSpacing(0.0),
128             LineSpacing(0.0),
129             ClockAngle(0.0),
130             NumberBlockData(0),
131             NumberData(0)
132         {
133         }
134         /**
135          * Copy constructor
136          * @param oRS the radar segment to copy
137          */
RadarSeg_tRadarSeg_t138         RadarSeg_t(const RadarSeg_t& oRS)
139         {
140             Copy(oRS);
141         }
142 
143         /**
144          * assignment operator
145          * @param oRS the radar segment to assign
146          */
147         RadarSeg_t& operator=(const RadarSeg_t& oRS)
148         {
149             Copy(oRS);
150             return *this;
151         }
152 
153         /**
154          * Copy function
155          * @param oRS the radar segment to copy
156          */
CopyRadarSeg_t157         void Copy(const RadarSeg_t& oRS)
158         {
159             if(this == &oRS)
160             {
161                 return;
162             }
163             Identifier = oRS.Identifier;
164             Facility = oRS.Facility;
165             Ellipsoid = oRS.Ellipsoid;
166             EquatorialRadius = oRS.EquatorialRadius;
167             PolarRadius = oRS.PolarRadius;
168             IncidenceAngle = oRS.IncidenceAngle;
169             PixelSpacing = oRS.PixelSpacing;
170             LineSpacing = oRS.LineSpacing;
171             ClockAngle = oRS.ClockAngle;
172 
173             NumberBlockData = oRS.NumberBlockData;
174             NumberData = oRS.NumberData;
175 
176             Line = oRS.Line;
177         }
178 
179         std::string   Identifier; /* Product identifier */
180         std::string   Facility; /* Processing facility */
181         std::string   Ellipsoid; /* Ellipsoid designator */
182         double EquatorialRadius; /* Equatorial radius of earth */
183         double PolarRadius; /* Polar radius of earth */
184         double IncidenceAngle; /* Incidence angle */
185         double PixelSpacing; /* Nominal pixel spacing in metre */
186         double LineSpacing; /* Nominal line spacing in metre */
187         double ClockAngle; /* Clock angle in degree */
188 
189         int    NumberBlockData; /* Number of blocks of ancillary data */
190         int  NumberData; /* Number of ancillary data */
191 
192         std::vector<AncillaryData_t> Line; /* Pointer to ancillary line */
193     } ;
194 
195 /* -------------------------------------------------------------------- */
196 /*       Structure for Satellite attitude segment.                      */
197 /* -------------------------------------------------------------------- */
198 #define ATT_SEG_BLK             604
199 #define ATT_SEG_MAX_LINE        6000
200 #define ATT_SEG_LINE_PER_BLOCK  10
201 
202     /**
203      * Attitude line information
204      */
205     struct AttitudeLine_t
206     {
207         /**
208          * Default constructor
209          */
AttitudeLine_tAttitudeLine_t210         AttitudeLine_t():
211             ChangeInAttitude(0.0),
212             ChangeEarthSatelliteDist(0.0)
213         {
214         }
215         /**
216          * Copy constructor
217          * @param oAL the attitude line to copy
218          */
AttitudeLine_tAttitudeLine_t219         AttitudeLine_t(const AttitudeLine_t& oAL)
220         {
221             Copy(oAL);
222         }
223 
224         /**
225          * assignment operator
226          * @param oAL the attitude line to assign
227          */
228         AttitudeLine_t& operator=(const AttitudeLine_t& oAL)
229         {
230             Copy(oAL);
231             return *this;
232         }
233 
234         /**
235          * Copy function
236          * @param oAL the attitude line to copy
237          */
CopyAttitudeLine_t238         void Copy(const AttitudeLine_t& oAL)
239         {
240             if(this == &oAL)
241             {
242                 return;
243             }
244             ChangeInAttitude = oAL.ChangeInAttitude;
245             ChangeEarthSatelliteDist = oAL.ChangeEarthSatelliteDist;
246         }
247 
248         double ChangeInAttitude; /* Change in satellite attitude (D22.16) */
249         double ChangeEarthSatelliteDist; /* Change in earth-satellite distance
250                                          (D22.16) */
251     } ;
252 
253     /**
254      * Attitude segment information
255      */
256     struct AttitudeSeg_t
257     {
258         /**
259          * Default constructor
260          */
AttitudeSeg_tAttitudeSeg_t261         AttitudeSeg_t() :
262             Roll(0.0),
263             Pitch(0.0),
264             Yaw(0.0),
265             NumberOfLine(0),
266             NumberBlockData(0)
267         {
268         }
269         /**
270          * Copy constructor
271          * @param oAS the attitude segment to copy
272          */
AttitudeSeg_tAttitudeSeg_t273         AttitudeSeg_t(const AttitudeSeg_t& oAS)
274         {
275             Copy(oAS);
276         }
277 
278         /**
279          * assignment operator
280          * @param oAS the avhrr segment to assign
281          */
282         AttitudeSeg_t& operator=(const AttitudeSeg_t& oAS)
283         {
284             Copy(oAS);
285             return *this;
286         }
287 
288         /**
289          * Copy function
290          * @param oAS the avhrr segment to copy
291          */
CopyAttitudeSeg_t292         void Copy(const AttitudeSeg_t& oAS)
293         {
294             if(this == &oAS)
295             {
296                 return;
297             }
298             Roll = oAS.Roll;
299             Pitch = oAS.Pitch;
300             Yaw = oAS.Yaw;
301             NumberOfLine = oAS.NumberOfLine;
302             NumberBlockData = oAS.NumberBlockData;
303             Line = oAS.Line;
304         }
305 
306         double Roll; /* Roll (D22.16) */
307         double Pitch; /* Pitch (D22.16) */
308         double Yaw; /* Yaw (D22.16) */
309         int  NumberOfLine; /* No. of Lines (I22) */
310 
311         int NumberBlockData; /* No. of block of data. */
312         std::vector<AttitudeLine_t> Line;
313 
314     } ;
315 
316 /* -------------------------------------------------------------------- */
317 /*      AVHRR orbit segment. Composed of 11 blocks plus extra blocks    */
318 /*      for holding per-scanline information.                           */
319 /* -------------------------------------------------------------------- */
320 #define AVH_SEG_BASE_NUM_BLK    11
321 
322     /**
323      * Avhrr line information
324      */
325     struct AvhrrLine_t
326     {
327         /**
328          * Default constructor
329          */
AvhrrLine_tAvhrrLine_t330         AvhrrLine_t()
331         {
332             nScanLineNum = 0;
333             nStartScanTimeGMTMsec = 0;
334             std::memset(abyScanLineQuality, 0, sizeof(abyScanLineQuality));
335             std::memset(aabyBadBandIndicators, 0, sizeof(aabyBadBandIndicators));
336             std::memset(abySatelliteTimeCode, 0, sizeof(abySatelliteTimeCode));
337             std::memset(anTargetTempData, 0, sizeof(anTargetTempData));
338             std::memset(anTargetScanData, 0, sizeof(anTargetScanData));
339             std::memset(anSpaceScanData, 0, sizeof(anSpaceScanData));
340         }
341         /**
342          * Copy constructor
343          * @param oAL the avhrr line to copy
344          */
AvhrrLine_tAvhrrLine_t345         AvhrrLine_t(const AvhrrLine_t& oAL)
346         {
347             Copy(oAL);
348         }
349 
350         /**
351          * assignment operator
352          * @param oAL the avhrr line to assign
353          */
354         AvhrrLine_t& operator=(const AvhrrLine_t& oAL)
355         {
356             Copy(oAL);
357             return *this;
358         }
359 
360         /**
361          * Copy function
362          * @param oAL the avhrr line to copy
363          */
CopyAvhrrLine_t364         void Copy(const AvhrrLine_t& oAL)
365         {
366             if(this == &oAL)
367             {
368                 return;
369             }
370             nScanLineNum = oAL.nScanLineNum;
371             nStartScanTimeGMTMsec = oAL.nStartScanTimeGMTMsec;
372             for(int i=0 ; i < 10 ; i++)
373                 abyScanLineQuality[i] = oAL.abyScanLineQuality[i];
374             for(int i=0 ; i < 5 ; i++)
375             {
376                 aabyBadBandIndicators[i][0] = oAL.aabyBadBandIndicators[i][0];
377                 aabyBadBandIndicators[i][1] = oAL.aabyBadBandIndicators[i][1];
378                 anSpaceScanData[i] = oAL.anSpaceScanData[i];
379             }
380             for(int i=0 ; i < 8 ; i++)
381                 abySatelliteTimeCode[i] = oAL.abySatelliteTimeCode[i];
382             for(int i=0 ; i < 3 ; i++)
383             {
384                 anTargetTempData[i] = oAL.anTargetTempData[i];
385                 anTargetScanData[i] = oAL.anTargetScanData[i];
386             }
387         }
388 
389         /* For geocoding */
390         int   nScanLineNum;
391         int   nStartScanTimeGMTMsec;
392         unsigned char abyScanLineQuality[10];
393         unsigned char aabyBadBandIndicators[5][2];
394         unsigned char abySatelliteTimeCode[8];
395 
396         /* For thermal/IR calibration */
397         int   anTargetTempData[3];
398         int   anTargetScanData[3];
399         int   anSpaceScanData[5];
400 
401     } ;
402 
403     /**
404      * Avhrr segment information.
405      */
406     struct AvhrrSeg_t
407     {
408         /**
409          * Default constructor
410          */
AvhrrSeg_tAvhrrSeg_t411         AvhrrSeg_t() :
412             nImageXSize(0),
413             nImageYSize(0),
414             bIsAscending(false),
415             bIsImageRotated(false),
416             nRecordSize(0),
417             nBlockSize(0),
418             nNumRecordsPerBlock(0),
419             nNumBlocks(0),
420             nNumScanlineRecords(0)
421         {
422         }
423         /**
424          * Copy constructor
425          * @param oAS the avhrr segment to copy
426          */
AvhrrSeg_tAvhrrSeg_t427         AvhrrSeg_t(const AvhrrSeg_t& oAS)
428         {
429             Copy(oAS);
430         }
431 
432         /**
433          * assignment operator
434          * @param oAS the avhrr segment to assign
435          */
436         AvhrrSeg_t& operator=(const AvhrrSeg_t& oAS)
437         {
438             Copy(oAS);
439             return *this;
440         }
441 
442         /**
443          * Copy function
444          * @param oAS the avhrr segment to copy
445          */
CopyAvhrrSeg_t446         void Copy(const AvhrrSeg_t& oAS)
447         {
448             if(this == &oAS)
449             {
450                 return;
451             }
452             szImageFormat = oAS.szImageFormat;
453             nImageXSize = oAS.nImageXSize;
454             nImageYSize = oAS.nImageYSize;
455             bIsAscending = oAS.bIsAscending;
456             bIsImageRotated = oAS.bIsImageRotated;
457             szOrbitNumber = oAS.szOrbitNumber;
458             szAscendDescendNodeFlag = oAS.szAscendDescendNodeFlag;
459             szEpochYearAndDay = oAS.szEpochYearAndDay;
460             szEpochTimeWithinDay = oAS.szEpochTimeWithinDay;
461             szTimeDiffStationSatelliteMsec = oAS.szTimeDiffStationSatelliteMsec;
462             szActualSensorScanRate = oAS.szActualSensorScanRate;
463             szIdentOfOrbitInfoSource = oAS.szIdentOfOrbitInfoSource;
464             szInternationalDesignator = oAS.szInternationalDesignator;
465             szOrbitNumAtEpoch = oAS.szOrbitNumAtEpoch;
466             szJulianDayAscendNode = oAS.szJulianDayAscendNode;
467             szEpochYear = oAS.szEpochYear;
468             szEpochMonth = oAS.szEpochMonth;
469             szEpochDay = oAS.szEpochDay;
470             szEpochHour = oAS.szEpochHour;
471             szEpochMinute = oAS.szEpochMinute;
472             szEpochSecond = oAS.szEpochSecond;
473             szPointOfAriesDegrees = oAS.szPointOfAriesDegrees;
474             szAnomalisticPeriod = oAS.szAnomalisticPeriod;
475             szNodalPeriod = oAS.szNodalPeriod;
476             szEccentricity = oAS.szEccentricity;
477             szArgumentOfPerigee = oAS.szArgumentOfPerigee;
478             szRAAN = oAS.szRAAN;
479             szInclination = oAS.szInclination;
480             szMeanAnomaly = oAS.szMeanAnomaly;
481             szSemiMajorAxis = oAS.szSemiMajorAxis;
482             nRecordSize = oAS.nRecordSize;
483             nBlockSize = oAS.nBlockSize;
484             nNumRecordsPerBlock = oAS.nNumRecordsPerBlock;
485             nNumBlocks = oAS.nNumBlocks;
486             nNumScanlineRecords = oAS.nNumScanlineRecords;
487             Line = oAS.Line;
488         }
489 
490         /* Ninth Block Part 1 - General/header information */
491         std::string  szImageFormat;
492         int   nImageXSize;
493         int   nImageYSize;
494         bool bIsAscending;
495         bool bIsImageRotated;
496 
497         /* Ninth Block Part 2 - Ephemeris information */
498         std::string  szOrbitNumber;
499         std::string  szAscendDescendNodeFlag;
500         std::string  szEpochYearAndDay;
501         std::string  szEpochTimeWithinDay;
502         std::string  szTimeDiffStationSatelliteMsec;
503         std::string  szActualSensorScanRate;
504         std::string  szIdentOfOrbitInfoSource;
505         std::string  szInternationalDesignator;
506         std::string  szOrbitNumAtEpoch;
507         std::string  szJulianDayAscendNode;
508         std::string  szEpochYear;
509         std::string  szEpochMonth;
510         std::string  szEpochDay;
511         std::string  szEpochHour;
512         std::string  szEpochMinute;
513         std::string  szEpochSecond;
514         std::string  szPointOfAriesDegrees;
515         std::string  szAnomalisticPeriod;
516         std::string  szNodalPeriod;
517         std::string  szEccentricity;
518         std::string  szArgumentOfPerigee;
519         std::string  szRAAN;
520         std::string  szInclination;
521         std::string  szMeanAnomaly;
522         std::string  szSemiMajorAxis;
523 
524         /* 10th Block - Empty, reserved for future use */
525 
526         /* 11th Block - Needed for indexing 12th block onwards */
527         int   nRecordSize;
528         int   nBlockSize;
529         int   nNumRecordsPerBlock;
530         int   nNumBlocks;
531         int   nNumScanlineRecords;
532 
533         /* 12th Block and onwards - Per-scanline records */
534         std::vector<AvhrrLine_t> Line;
535 
536     } ;
537 
538     /**
539      * Possible orbit types.
540      */
541     typedef enum
542     {
543         OrbNone,
544         OrbAttitude,
545         OrbLatLong,
546         OrbAvhrr
547     } OrbitType;
548 
549     /**
550      * Ephemeris segment structure
551      */
552     struct EphemerisSeg_t
553     {
554         /**
555          * Default constructor
556          */
EphemerisSeg_tEphemerisSeg_t557         EphemerisSeg_t()
558         {
559             SupSegExist = false;
560             FieldOfView = 0.0;
561             ViewAngle = 0.0;
562             NumColCentre = 0.0;
563             RadialSpeed = 0.0;
564             Eccentricity = 0.0;
565             Height = 0.0;
566             Inclination = 0.0;
567             TimeInterval = 0.0;
568             NumLineCentre = 0.0;
569             LongCentre = 0.0;
570             AngularSpd = 0.0;
571             AscNodeLong = 0.0;
572             ArgPerigee = 0.0;
573             LatCentre = 0.0;
574             EarthSatelliteDist = 0.0;
575             NominalPitch = 0.0;
576             TimeAtCentre = 0.0;
577             SatelliteArg = 0.0;
578             XCentre = 0.0;
579             YCentre = 0.0;
580             UtmYCentre = 0.0;
581             UtmXCentre = 0.0;
582             PixelRes = 0.0;
583             LineRes = 0.0;
584             CornerAvail = false;
585             XUL = 0.0;
586             YUL = 0.0;
587             XUR = 0.0;
588             YUR = 0.0;
589             XLR = 0.0;
590             YLR = 0.0;
591             XLL = 0.0;
592             YLL = 0.0;
593             UtmYUL = 0.0;
594             UtmXUL = 0.0;
595             UtmYUR = 0.0;
596             UtmXUR = 0.0;
597             UtmYLR = 0.0;
598             UtmXLR = 0.0;
599             UtmYLL = 0.0;
600             UtmXLL = 0.0;
601             LatCentreDeg = 0.0;
602             LongCentreDeg = 0.0;
603             LatUL = 0.0;
604             LongUL = 0.0;
605             LatUR = 0.0;
606             LongUR = 0.0;
607             LatLR = 0.0;
608             LongLR = 0.0;
609             LatLL = 0.0;
610             LongLL = 0.0;
611             HtCentre = 0.0;
612             HtUL = 0.0;
613             HtUR = 0.0;
614             HtLR = 0.0;
615             HtLL = 0.0;
616             std::memset(SPCoeff1B, 0, sizeof(SPCoeff1B));
617             std::memset(SPCoeffSg, 0, sizeof(SPCoeffSg));
618             ImageRecordLength = 0;
619             NumberImageLine = 0;
620             NumberBytePerPixel = 0;
621             NumberSamplePerLine = 0;
622             NumberPrefixBytes = 0;
623             NumberSuffixBytes = 0;
624             SPNCoeff = 0;
625             bDescending = false;
626             Type = OrbNone;
627             AttitudeSeg = nullptr;
628             RadarSeg = nullptr;
629             AvhrrSeg = nullptr;
630         }
631 
632         /**
633          * Destructor
634          */
~EphemerisSeg_tEphemerisSeg_t635         ~EphemerisSeg_t()
636         {
637             delete AttitudeSeg;
638             delete RadarSeg;
639             delete AvhrrSeg;
640         }
641 
642         /**
643          * Copy constructor
644          * @param oES the ephemeris segment to copy
645          */
EphemerisSeg_tEphemerisSeg_t646         EphemerisSeg_t(const EphemerisSeg_t& oES)
647         {
648             AttitudeSeg = nullptr;
649             RadarSeg = nullptr;
650             AvhrrSeg = nullptr;
651             Copy(oES);
652         }
653 
654         /**
655          * assignment operator
656          * @param oES the ephemeris segment to assign
657          */
658         EphemerisSeg_t& operator=(const EphemerisSeg_t& oES)
659         {
660             Copy(oES);
661             return *this;
662         }
663 
664         /**
665          * Copy function
666          * @param oES the ephemeris segment to copy
667          */
CopyEphemerisSeg_t668         void Copy(const EphemerisSeg_t& oES)
669         {
670             if(this == &oES)
671             {
672                 return;
673             }
674             delete AttitudeSeg;
675             delete RadarSeg;
676             delete AvhrrSeg;
677             AttitudeSeg = nullptr;
678             RadarSeg = nullptr;
679             AvhrrSeg = nullptr;
680             if(oES.AttitudeSeg)
681                 AttitudeSeg = new AttitudeSeg_t(*oES.AttitudeSeg);
682             if(oES.RadarSeg)
683                 RadarSeg = new RadarSeg_t(*oES.RadarSeg);
684             if(oES.AvhrrSeg)
685                 AvhrrSeg = new AvhrrSeg_t(*oES.AvhrrSeg);
686 
687             for(int i =0 ; i <39 ; i++)
688                 SPCoeff1B[i] = oES.SPCoeff1B[i];
689             for(int i =0 ; i <4 ; i++)
690                 SPCoeffSg[i] = oES.SPCoeffSg[i];
691 
692             SatelliteDesc = oES.SatelliteDesc;
693             SceneID = oES.SceneID;
694             SatelliteSensor = oES.SatelliteSensor;
695             SensorNo = oES.SensorNo;
696             DateImageTaken = oES.DateImageTaken;
697             SupSegExist = oES.SupSegExist;
698             FieldOfView = oES.FieldOfView;
699             ViewAngle = oES.ViewAngle;
700             NumColCentre = oES.NumColCentre;
701             RadialSpeed = oES.RadialSpeed;
702             Eccentricity = oES.Eccentricity;
703             Height = oES.Height;
704             Inclination = oES.Inclination;
705             TimeInterval = oES.TimeInterval;
706             NumLineCentre = oES.NumLineCentre;
707             LongCentre = oES.LongCentre;
708             AngularSpd = oES.AngularSpd;
709             AscNodeLong = oES.AscNodeLong;
710             ArgPerigee = oES.ArgPerigee;
711             LatCentre = oES.LatCentre;
712             EarthSatelliteDist = oES.EarthSatelliteDist;
713             NominalPitch = oES.NominalPitch;
714             TimeAtCentre = oES.TimeAtCentre;
715             SatelliteArg = oES.SatelliteArg;
716             XCentre = oES.XCentre;
717             YCentre = oES.YCentre;
718             UtmYCentre = oES.UtmYCentre;
719             UtmXCentre = oES.UtmXCentre;
720             PixelRes = oES.PixelRes;
721             LineRes = oES.LineRes;
722             CornerAvail = oES.CornerAvail;
723             MapUnit = oES.MapUnit;
724             XUL = oES.XUL;
725             YUL = oES.YUL;
726             XUR = oES.XUR;
727             YUR = oES.YUR;
728             XLR = oES.XLR;
729             YLR = oES.YLR;
730             XLL = oES.XLL;
731             YLL = oES.YLL;
732             UtmYUL = oES.UtmYUL;
733             UtmXUL = oES.UtmXUL;
734             UtmYUR = oES.UtmYUR;
735             UtmXUR = oES.UtmXUR;
736             UtmYLR = oES.UtmYLR;
737             UtmXLR = oES.UtmXLR;
738             UtmYLL = oES.UtmYLL;
739             UtmXLL = oES.UtmXLL;
740             LatCentreDeg = oES.LatCentreDeg;
741             LongCentreDeg = oES.LongCentreDeg;
742             LatUL = oES.LatUL;
743             LongUL = oES.LongUL;
744             LatUR = oES.LatUR;
745             LongUR = oES.LongUR;
746             LatLR = oES.LatLR;
747             LongLR = oES.LongLR;
748             LatLL = oES.LatLL;
749             LongLL = oES.LongLL;
750             HtCentre = oES.HtCentre;
751             HtUL = oES.HtUL;
752             HtUR = oES.HtUR;
753             HtLR = oES.HtLR;
754             HtLL = oES.HtLL;
755             ImageRecordLength = oES.ImageRecordLength;
756             NumberImageLine = oES.NumberImageLine;
757             NumberBytePerPixel = oES.NumberBytePerPixel;
758             NumberSamplePerLine = oES.NumberSamplePerLine;
759             NumberPrefixBytes = oES.NumberPrefixBytes;
760             NumberSuffixBytes = oES.NumberSuffixBytes;
761             SPNCoeff = oES.SPNCoeff;
762             bDescending = oES.bDescending;
763             Type = oES.Type;
764         }
765 
766         /// Satellite description
767         std::string SatelliteDesc;
768         /// Scene ID
769         std::string SceneID;
770 
771         /// Satellite sensor
772         std::string SatelliteSensor;
773         /// Satellite sensor no.
774         std::string SensorNo;
775         /// Date of image taken
776         std::string DateImageTaken;
777         /// Flag to indicate supplemental segment
778         bool SupSegExist;
779         /// Scanner field of view (ALPHA)
780         double FieldOfView;
781         /// Viewing angle (BETA)
782         double ViewAngle;
783         /// Number of column at center (C0)
784         double NumColCentre;
785         /// Radial speed (DELIRO)
786         double RadialSpeed;
787         /// Eccentricity (ES)
788         double Eccentricity;
789         /// Height (H0)
790         double Height;
791         /// Inclination (I)
792         double Inclination;
793         /// Time interval (K)
794         double TimeInterval;
795         /// Number of line at center (L0)
796         double NumLineCentre;
797         /// Longitude of center (LAMBDA)
798         double LongCentre;
799         /// Angular speed (N)
800         double AngularSpd;
801         /// Ascending node Longitude (OMEGA-MAJ)
802         double AscNodeLong;
803         /// Argument Perigee (OMEGA-MIN)
804         double ArgPerigee;
805         /// Latitude of center (PHI)
806         double LatCentre;
807         /// Earth Satellite distance (RHO)
808         double EarthSatelliteDist;
809         /// Nominal pitch (T)
810         double NominalPitch;
811         /// Time at centre (T0)
812         double TimeAtCentre;
813         /// Satellite argument (WP)
814         double SatelliteArg;
815 
816         /// Scene center pixel coordinate
817         double XCentre;
818         /// Scene center line coordinate
819         double YCentre;
820         /// Scene centre UTM northing
821         double UtmYCentre;
822         /// Scene centre UTM easting
823         double UtmXCentre;
824         /// Pixel resolution in x direction
825         double PixelRes;
826         /// Pixel resolution in y direction
827         double LineRes;
828         /// Flag to tell corner coordinate available
829         bool CornerAvail;
830         /// Map units
831         std::string MapUnit;
832         /// Pixel coordinate of upper left corner
833         double XUL;
834         /// Line coordinate of upper left corner
835         double YUL;
836         /// Pixel coordinate of upper right corner
837         double XUR;
838         /// Line coordinate of upper right corner
839         double YUR;
840         /// Pixel coordinate of lower right corner
841         double XLR;
842         /// Line coordinate of lower right corner
843         double YLR;
844         /// Pixel coordinate of lower left corner
845         double XLL;
846         /// Line coordinate of lower left corner
847         double YLL;
848         /// UTM Northing of upper left corner
849         double UtmYUL;
850         /// UTM Easting of upper left corner
851         double UtmXUL;
852         /// UTM Northing of upper right corner
853         double UtmYUR;
854         /// UTM Easting of upper right corner
855         double UtmXUR;
856         /// UTM Northing of lower right corner
857         double UtmYLR;
858         /// UTM Easting of lower right corner
859         double UtmXLR;
860         /// Utm Northing of lower left corner
861         double UtmYLL;
862         /// Utm Easting of lower left corner
863         double UtmXLL;
864 
865         /// Scene centre latitude (deg)
866         double LatCentreDeg;
867         /// Scene centre longitude (deg)
868         double LongCentreDeg;
869         /// Upper left latitude (deg)
870         double LatUL;
871         /// Upper left longitude (deg)
872         double LongUL;
873         /// Upper right latitude (deg)
874         double LatUR;
875         /// Upper right longitude (deg)
876         double LongUR;
877         /// Lower right latitude (deg)
878         double LatLR;
879         /// Lower right longitude (deg)
880         double LongLR;
881         /// Lower left latitude (deg)
882         double LatLL;
883         /// Lower left longitude (deg)
884         double LongLL;
885         /// Centre Height (m)
886         double HtCentre;
887         /// UL Height (m)
888         double HtUL;
889         /// UR Height (m)
890         double HtUR;
891         /// LR Height (m)
892         double HtLR;
893         /// LL Height (m)
894         double HtLL;
895 
896         /// SPOT 1B coefficients
897         double SPCoeff1B[39];
898         /// SPOT 1B segment coefficients
899         int    SPCoeffSg[4];
900 
901         /// Image record length
902         int    ImageRecordLength;
903         /// Number of image line
904         int    NumberImageLine;
905         /// Number of bytes per pixel
906         int    NumberBytePerPixel;
907         /// Number of samples per line
908         int    NumberSamplePerLine;
909         /// Number of prefix bytes
910         int    NumberPrefixBytes;
911         /// Number of suffix bytes
912         int    NumberSuffixBytes;
913         /// Number of coefficients for SPOT 1B
914         int    SPNCoeff;
915 
916         /// Flag to indicate ascending or descending
917         bool  bDescending;
918 
919         /// Orbit type: None, LatLong, Attitude, Avhrr
920         OrbitType   Type;
921         AttitudeSeg_t *AttitudeSeg;
922         RadarSeg_t    *RadarSeg;
923         AvhrrSeg_t    *AvhrrSeg;
924     };
925 
926     /**
927      * List of sensor type
928      */
929     typedef enum {PLA_1, MLA_1, PLA_2, MLA_2, PLA_3, MLA_3, PLA_4, MLA_4,
930                   ASTER, SAR, LISS_1, LISS_2, LISS_3, LISS_L3, LISS_L3_L2,
931                   LISS_L4, LISS_L4_L2, LISS_P3, LISS_P3_L2, LISS_W3, LISS_W3_L2,
932                   LISS_AWF, LISS_AWF_L2, LISS_M3, EOC, IRS_1, RSAT_FIN,
933                   RSAT_STD, ERS_1, ERS_2, TM, ETM, IKO_PAN, IKO_MULTI,
934                   ORBVIEW_PAN, ORBVIEW_MULTI, OV3_PAN_BASIC, OV3_PAN_GEO,
935                   OV3_MULTI_BASIC, OV3_MULTI_GEO, OV5_PAN_BASIC, OV5_PAN_GEO,
936                   OV5_MULTI_BASIC, OV5_MULTI_GEO, QBIRD_PAN, QBIRD_PAN_STD,
937                   QBIRD_PAN_STH, QBIRD_MULTI, QBIRD_MULTI_STD, QBIRD_MULTI_STH,
938                   FORMOSAT_PAN, FORMOSAT_MULTI, FORMOSAT_PAN_L2,
939                   FORMOSAT_MULTIL2, SPOT5_PAN_2_5, SPOT5_PAN_5, SPOT5_HRS,
940                   SPOT5_MULTI, MERIS_FR, MERIS_RR, MERIS_LR, ASAR, EROS,
941                   MODIS_250, MODIS_500, MODIS_1000, CBERS_HRC, CBERS_HRC_L2,
942                   CBERS_CCD, CBERS_CCD_L2, CBERS_IRM_80, CBERS_IRM_80_L2,
943                   CBERS_IRM_160, CBERS_IRM_160_L2, CBERS_WFI, CBERS_WFI_L2,
944                   CARTOSAT1_L1, CARTOSAT1_L2, ALOS_PRISM_L1, ALOS_PRISM_L2,
945                   ALOS_AVNIR_L1, ALOS_AVNIR_L2, PALSAR, DMC_1R, DMC_1T,
946                   KOMPSAT2_PAN, KOMPSAT2_MULTI, KOMPSAT3_PAN, KOMPSAT3_MS, KOMPSAT3_PSH,
947                   KOMPSAT3A_PAN, KOMPSAT3A_MS, KOMPSAT3A_PSH,
948                   TERRASAR, WVIEW_PAN, WVIEW_PAN_STD, WVIEW_MULTI,
949                   WVIEW_MULTI_STD, RAPIDEYE_L1B, THEOS_PAN_L1, THEOS_PAN_L2,
950                   THEOS_MS_L1, THEOS_MS_L2,
951                   GOSAT_500_L1, GOSAT_500_L2, GOSAT_1500_L1, GOSAT_1500_L2,
952                   HJ_CCD_1A, HJ_CCD_1B, PLEIADES_PAN_L1, PLEIADES_MS_L1,
953                   PLEIADES_PAN_L2, PLEIADES_MS_L2, SSOT_PAN_L1, SSOT_MS_L1,
954                   SSOT_PAN_L2, SSOT_MS_L2,
955                   SPOT1_PAN, SPOT1_MS, SPOT2_PAN, SPOT2_MS,
956                   SPOT3_PAN, SPOT3_MS, SPOT4_PAN, SPOT4_MS,
957                   SPOT6_PAN, SPOT6_MS, SPOT6_PSH, SPOT7_PAN, SPOT7_MS, SPOT7_PSH,
958                   RASAT_PAN, RASAT_MS, TH01_DGP, TH01_GFB, TH01_SXZ,
959                   ZY1_02C_HRC, ZY1_02C_PMS_PAN, ZY1_02C_PMS_MS,
960                   ZY3_NAD, ZY3_FWD, ZY3_BWD, ZY3_MUX, ZY3_TLC, GK2_PAN, GK2_MS, HRC,
961                   MRC_RED, MRC_GRN, MRC_BLU, MRC_NIR, GF1_PMS_PAN, GF1_PMS_MS, GF1_WFV,
962                   GF2_PMS_PAN, GF2_PMS_MS, GF4_PMS_MS, GF4_PMI_Thermal,
963                   GF6_PMS_PAN, GF6_PMS_MS, SJ9_PAN, SJ9_MUX, SJ9_PMS_PAN, SJ9_PMS_MS,
964                   YG2_1, YG8_1, YG14_1, UAVSAR, HI_RES, MED_RES, ALSAT2_PAN_1A, ALSAT2_MS_1A,
965                   ALSAT2_PAN_2A, ALSAT2_MS_2A, DUBAISAT2_PAN, DUBAISAT2_MS,
966                   KAZEOSAT1_PAN_1A, KAZEOSAT1_MS_1A, KAZEOSAT1_PAN_2A, KAZEOSAT1_MS_2A, KAZEOSAT2_MS_1G,
967                   DEIMOS1_MS_1R, DEIMOS2_PAN_1B, DEIMOS2_MS_1B, DEIMOS2_PSH_1B, HJ1C,
968                   TRIPLESAT_PAN, TRIPLESAT_MS, RESOURCESAT, JL101A_PAN, JL101A_MS,
969                   CBERS4_PAN_1, CBERS4_MS_1, CBERS4_PAN_2, CBERS4_MS_2,
970                   CBERS4_THM_1, CBERS4_THM_2, SV1_PAN_L1, SV1_MS_L1, SV1_PAN_L2, SV1_MS_L2,
971                   PER_PAN_2A, PER_MS_2A, FORMOSAT5_PAN, FORMOSAT5_MS,
972                   GEOEYE_PAN, GEOEYE_MULTI, GEOEYE_PAN_STD, GEOEYE_MULTI_STD,
973                   GOKTURK1_PAN, GOKTURK1_MS,
974                   NEW, AVHRR, MSS} TypeDeCapteur;
975 }
976 
977 #endif // INCLUDE_PCIDSK_ORBIT_INFORMATION_H
978