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 */ 00053 class HiJitCube : public Cube { 00054 public: 00055 00056 /** 00057 * Structure that contains all pertinent data for the cube 00058 */ 00059 struct JitInfo { 00060 std::string filename; 00061 std::string productId; 00062 int lines; 00063 int samples; 00064 int sampOffset; 00065 int lineOffset; 00066 int tdiMode; 00067 int summing; 00068 int channelNumber; 00069 int cpmmNumber; 00070 std::string ccdName; 00071 double dltCount; 00072 std::string UTCStartTime; 00073 std::string scStartTime; 00074 double obsStartTime; 00075 double unBinnedRate; 00076 double linerate; 00077 int fpSamp0; 00078 int fpLine0; 00079 double pixpitch; 00080 }; 00081 00082 /** 00083 * Structure containing cube coordinates 00084 */ 00085 struct CubeCoords { 00086 double line; 00087 double sample; 00088 CubeCoords() : line(0.0), sample(0.0) { } 00089 }; 00090 00091 /** 00092 * Structure containing corners of a region 00093 */ 00094 struct Corners { 00095 CubeCoords topLeft; 00096 CubeCoords lowerRight; 00097 bool good; 00098 Corners() : topLeft(), lowerRight(), good(false) { } 00099 }; 00100 00101 public: 00102 HiJitCube(); 00103 HiJitCube(const std::string &filename); 00104 HiJitCube(const std::string &filename, PvlObject &shift); 00105 ~HiJitCube(); 00106 00107 void setSampleOffset(int soff); 00108 void setLineOffset(int loff); 00109 00110 /** 00111 * Returns the sample offset for this image 00112 */ 00113 inline int getSampleOffset() const { 00114 return (jdata.sampOffset); 00115 } 00116 /** 00117 * Returns the line offset for this image 00118 */ 00119 inline int getLineOffset() const { 00120 return (jdata.lineOffset); 00121 } 00122 00123 void OpenCube(const std::string &filename); 00124 void OpenCube(const std::string &filename, PvlObject &shift); 00125 inline const JitInfo &GetInfo() const { 00126 return (jdata); 00127 } 00128 double getLineTime(double line = 1.0) const; 00129 00130 00131 void Compatable(HiJitCube &cube); 00132 00133 geos::geom::Polygon const *Poly() const { 00134 return (fpGeom); 00135 } 00136 bool intersects(const HiJitCube &cube) const; 00137 bool overlap(const HiJitCube &cube, Corners &ovlCorners); 00138 /** 00139 * Returns the string representation of the overlapping region 00140 */ 00141 std::string PolyToString() const { 00142 return (fpGeom->toString()); 00143 } 00144 00145 private: 00146 JitInfo jdata; //!< Cube information 00147 geos::geom::Polygon *fpGeom; //!< Polygon construction and manipulation 00148 static bool naifLoaded; //!< Status of NAIF required kernels for times 00149 00150 void initLocal(); 00151 void loadNaifTiming(); 00152 void computeStartTime(); 00153 void Init(); 00154 int getBinModeIndex(int summing) const; 00155 void computePoly(); 00156 Corners FocalPlaneToImage(const Corners &fp) const; 00157 Corners getCorners(const geos::geom::Geometry &poly) const; 00158 }; 00159 00160 } // namespace Isis 00161 #endif