|
Isis 3.0 Application Source Code Reference |
Home |
00001 #ifndef LineScanCameraRotation_h 00002 #define LineScanCameraRotation_h 00003 /** 00004 * @file 00005 * $Revision: 1.2 $ 00006 * $Date: 2009/08/04 00:08:10 $ 00007 * 00008 * Unless noted otherwise, the portions of Isis written by the USGS are public 00009 * domain. See individual third-party library and package descriptions for 00010 * intellectual property information,user agreements, and related information. 00011 * 00012 * Although Isis has been used by the USGS, no warranty, expressed or implied, 00013 * is made by the USGS as to the accuracy and functioning of such software 00014 * and related material nor shall the fact of distribution constitute any such 00015 * warranty, and no responsibility is assumed by the USGS in connection 00016 * therewith. 00017 * 00018 * For additional information, launch 00019 * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html in a browser or see 00020 * the Privacy & Disclaimers page on the Isis website, 00021 * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on 00022 * http://www.usgs.gov/privacy.html. 00023 */ 00024 00025 #include <string> 00026 #include <vector> 00027 #include "SpiceRotation.h" 00028 #include "SpicePosition.h" 00029 #include "Table.h" 00030 #include "Quaternion.h" 00031 #include "PolynomialUnivariate.h" 00032 #include "PixelOffset.h" 00033 #include "SpiceUsr.h" 00034 #include "SpiceZfc.h" 00035 #include "SpiceZmc.h" 00036 #include "Spice.h" 00037 00038 00039 namespace Isis { 00040 /** 00041 * @brief Obtain SPICE rotation information for a body 00042 * 00043 * This class will obtain the rotation from J2000 to the ICR frame (with axes 00044 * (defined in direction of in track, cross track, and radial) for HiRise. 00045 * 00046 * It is essentially used to convert position vectors from one frame to 00047 * another, making it is a C++ wrapper to the NAIF routines pxform_c and 00048 * mxv or mtxv. Therefore, appropriate NAIF kernels are expected to be 00049 * loaded prior to using this class. A position can be returned in either 00050 * the J2000 frame or the selected reference frame. See NAIF required 00051 * reading for more information regarding this subject at 00052 * ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/ascii/individual_docs/spk.req 00053 * <p> 00054 * An important functionality of this class is the ability to cache the 00055 * rotations so they do not have to be constantly read from the NAIF kernels 00056 * and they can be more conveniently updated. Once the data is cached, the 00057 * NAIF kernels can be unloaded. 00058 * 00059 * @ingroup SpiceInstrumentsAndCameras 00060 * 00061 * @author 2005-12-01 Debbie A. Cook 00062 * 00063 * @internal 00064 * @history 2005-12-01 Debbie A. Cook Original Version modified from 00065 * SpicePosition class by Jeff Anderson 00066 * @history 2006-03-23 Jeff Anderson modified SetEphemerisTime to return 00067 * if the time did not change to improve speed. 00068 * @history 2006-10-18 Debbie A. Cook Added method, WrapAngle, to wrap 00069 * angles around 2 pi 00070 * @history 2007-12-05 Debbie A. Cook added method SetPolynomialDegree to 00071 * allow the degree of the polynomials fit to the 00072 * camera angles to be changed. Also changed the 00073 * polynomial from a fixed 2nd order polynomial to 00074 * an nth degree polynomial with one independent 00075 * variable. PartialType was revised and the calls to 00076 * SetReferencePartial (has an added argument, coefficient index) 00077 * and DPolynomial (argument type changed to int) were revised. 00078 * The function was changed from Parabola 00079 * to Polynomial1Variable, now called 00080 * PolynomialUnivariate. New methods GetBaseTime 00081 * and SetOverrideBaseTime were added 00082 * @history 2008-02-15 Debbie A. Cook added a new error message to handle the 00083 * case where the Naif reference frame code is not 00084 * recognized. 00085 * @history 2008-06-18 Fixed documentation, added NaifStatus calls 00086 * @history 2008-08-11 Debbie A. Cook Added method to set axes of rotation. 00087 * Default axes are still 3,1,3 so existing software will 00088 * not be affected by the change. 00089 * @history 2008-12-12 Debbie A. Cook Added parameters for updated pitch rate and yaw 00090 * and related methods 00091 * @history 2009-07-31 Debbie A. Cook Added new argument, tol, for call to CreateCache 00092 * method of Spice class 00093 */ 00094 class LineScanCameraRotation : public Isis::SpiceRotation { 00095 public: 00096 //! Constructors 00097 // LineScanCameraRotation( int frameCode, SpiceRotation *crot, SpiceRotation *prot, SpicePosition *spos ); 00098 LineScanCameraRotation( int frameCode, Isis::Pvl &lab, std::vector<double> timeCache, double tol); 00099 00100 //! Destructor 00101 // virtual ~LineScanCameraRotation() { }; 00102 virtual ~LineScanCameraRotation(); 00103 00104 void LoadCache(); 00105 void SetJitter( PixelOffset *jitter) { p_jitter = jitter; }; 00106 void ReloadCache(); 00107 void ResetPitchRate( double pitchRate ) { p_pitchRate = pitchRate; }; 00108 void ResetYaw( double yaw ) { p_yaw = yaw; }; 00109 00110 private: 00111 Isis::Spice *p_spi; 00112 SpiceRotation *p_crot; //!< Camera rotation [CJ] 00113 SpicePosition *p_spos; //!< Spacecraft position in J2000 00114 SpiceRotation *p_prot; //!< Planet rotation [PJ] 00115 std::vector<std::vector<double> > p_cacheIB; //!< Cached rotations body-fixed to ICR 00116 PixelOffset *p_jitter; //!< Jitter rotations from nominal camera to truth (jittering camera) 00117 bool p_cachesLoaded; //!< Flag indicated p_cache and p_cacheIB are loaded 00118 double p_pitchRate; //!< Optional update to pitch rate 00119 double p_yaw; //!< Optional update to yaw 00120 }; 00121 }; 00122 00123 #endif 00124