|
Isis 3.0 Application Source Code Reference |
Home |
00001 /** 00002 * @file 00003 * $Revision: 1.3 $ 00004 * $Date: 2008/08/19 22:37:41 $ 00005 * 00006 * Unless noted otherwise, the portions of Isis written by the USGS are 00007 * public domain. See individual third-party library and package descriptions 00008 * for intellectual property information, user agreements, and related 00009 * information. 00010 * 00011 * Although Isis has been used by the USGS, no warranty, expressed or 00012 * implied, is made by the USGS as to the accuracy and functioning of such 00013 * software and related material nor shall the fact of distribution 00014 * constitute any such warranty, and no responsibility is assumed by the 00015 * USGS in connection therewith. 00016 * 00017 * For additional information, launch 00018 * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html 00019 * in a browser or see the Privacy & Disclaimers page on the Isis website, 00020 * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on 00021 * http://www.usgs.gov/privacy.html. 00022 */ 00023 #ifndef HiJitCube_h 00024 #define HiJitCube_h 00025 00026 #include "Cube.h" 00027 #include "geos/geom/Polygon.h" 00028 #include "geos/geom/Geometry.h" 00029 #include "geos/geom/CoordinateSequence.h" 00030 #include "geos/geom/Envelope.h" 00031 #include "geos/geom/GeometryFactory.h" 00032 #include "geos/geom/CoordinateArraySequence.h" 00033 00034 namespace Isis { 00035 00036 class PvlObject; 00037 /** 00038 * @brief HiRISE cube detailer for jitter characterization 00039 * 00040 * HiJitCube is designed to open and manage HiRISE image cubes for the 00041 * purpose of jitter characterization. Inheriting the Isis Cube class, 00042 * it provides opening and closeing of the cube, but its main function 00043 * is gathering data from the label, validating against other instances 00044 * of this same object on other HiRISE cubes and computing focal plane 00045 * mapping expressly to determine overlapping regions of images. 00046 * 00047 * @ingroup MarsReconnaissanceOrbiter 00048 * 00049 * @author 2006-05-04 Kris Becker 00050 * 00051 * @internal 00052 * @history 2012-09-25 Steven Lambright - Pixel pitch value can now come from either the 00053 * instrument group or the naif keywords group. References #1094. 00054 */ 00055 class HiJitCube : public Cube { 00056 public: 00057 00058 /** 00059 * Structure that contains all pertinent data for the cube 00060 */ 00061 struct JitInfo { 00062 QString filename; 00063 QString productId; 00064 int lines; 00065 int samples; 00066 int sampOffset; 00067 int lineOffset; 00068 int tdiMode; 00069 int summing; 00070 int channelNumber; 00071 int cpmmNumber; 00072 QString ccdName; 00073 double dltCount; 00074 QString UTCStartTime; 00075 QString scStartTime; 00076 double obsStartTime; 00077 double unBinnedRate; 00078 double linerate; 00079 int fpSamp0; 00080 int fpLine0; 00081 double pixpitch; 00082 }; 00083 00084 /** 00085 * Structure containing cube coordinates 00086 */ 00087 struct CubeCoords { 00088 double line; 00089 double sample; 00090 CubeCoords() : line(0.0), sample(0.0) { } 00091 }; 00092 00093 /** 00094 * Structure containing corners of a region 00095 */ 00096 struct Corners { 00097 CubeCoords topLeft; 00098 CubeCoords lowerRight; 00099 bool good; 00100 Corners() : topLeft(), lowerRight(), good(false) { } 00101 }; 00102 00103 public: 00104 HiJitCube(); 00105 HiJitCube(const QString &filename); 00106 HiJitCube(const QString &filename, PvlObject &shift); 00107 ~HiJitCube(); 00108 00109 void setSampleOffset(int soff); 00110 void setLineOffset(int loff); 00111 00112 /** 00113 * Returns the sample offset for this image 00114 */ 00115 inline int getSampleOffset() const { 00116 return (jdata.sampOffset); 00117 } 00118 /** 00119 * Returns the line offset for this image 00120 */ 00121 inline int getLineOffset() const { 00122 return (jdata.lineOffset); 00123 } 00124 00125 void OpenCube(const QString &filename); 00126 void OpenCube(const QString &filename, PvlObject &shift); 00127 inline const JitInfo &GetInfo() const { 00128 return (jdata); 00129 } 00130 double getLineTime(double line = 1.0) const; 00131 00132 00133 void Compatable(HiJitCube &cube); 00134 00135 geos::geom::Polygon const *Poly() const { 00136 return (fpGeom); 00137 } 00138 bool intersects(const HiJitCube &cube) const; 00139 bool overlap(const HiJitCube &cube, Corners &ovlCorners); 00140 /** 00141 * Returns the string representation of the overlapping region 00142 */ 00143 QString PolyToString() const { 00144 return (fpGeom->toString().c_str()); 00145 } 00146 00147 private: 00148 JitInfo jdata; //!< Cube information 00149 geos::geom::Polygon *fpGeom; //!< Polygon construction and manipulation 00150 static bool naifLoaded; //!< Status of NAIF required kernels for times 00151 00152 void initLocal(); 00153 void loadNaifTiming(); 00154 void computeStartTime(); 00155 void Init(); 00156 int getBinModeIndex(int summing) const; 00157 void computePoly(); 00158 Corners FocalPlaneToImage(const Corners &fp) const; 00159 Corners getCorners(const geos::geom::Geometry &poly) const; 00160 }; 00161 00162 } // namespace Isis 00163 #endif