USGS

Isis 3.0 Application Source Code Reference

Home

LineScanCameraRotation.h

Go to the documentation of this file.
00001 #ifndef LineScanCameraRotation_h
00002 #define LineScanCameraRotation_h
00003 /**
00004  * @file
00005  * $Revision: 1.4 $
00006  * $Date: 2009/12/29 23:03:47 $
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 
00028 #include "naif/SpiceUsr.h"
00029 #include "naif/SpiceZfc.h"
00030 #include "naif/SpiceZmc.h"
00031 
00032 #include "SpiceRotation.h"
00033 #include "SpicePosition.h"
00034 #include "Table.h"
00035 #include "Quaternion.h"
00036 #include "PolynomialUnivariate.h"
00037 #include "PixelOffset.h"
00038 #include "Spice.h"
00039 
00040 
00041 namespace Isis {
00042   /**
00043    * @brief Obtain SPICE rotation information for a body
00044    *
00045    * This class will obtain the rotation from J2000 to the ICR frame (with axes
00046    * (defined in direction of in track, cross track, and radial) for HiRise.
00047    *
00048    * It is essentially used to convert position vectors from one frame to
00049    * another, making it is a C++ wrapper to the NAIF routines pxform_c and
00050    * mxv or mtxv.  Therefore, appropriate NAIF kernels are expected to be
00051    * loaded prior to using this class.  A position can be returned in either
00052    * the J2000 frame or the selected reference frame.  See NAIF required
00053    * reading for more information regarding this subject at
00054    * ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/ascii/individual_docs/spk.req
00055    * <p>
00056    * An important functionality of this class is the ability to cache the
00057    * rotations so they do not have to be constantly read from the NAIF kernels
00058    * and they can be more conveniently updated.  Once the data is cached, the
00059    * NAIF kernels can be unloaded.
00060    *
00061    * @ingroup SpiceInstrumentsAndCameras
00062    *
00063    * @author 2005-12-01 Debbie A. Cook
00064    *
00065    * @internal
00066    *  @history 2005-12-01  Debbie A. Cook Original Version modified from
00067    *  SpicePosition class by Jeff Anderson
00068    *  @history 2006-03-23  Jeff Anderson modified SetEphemerisTime to return
00069    *                       if the time did not change to improve speed.
00070    *  @history 2006-10-18  Debbie A. Cook Added method, WrapAngle, to wrap
00071    *                        angles around 2 pi
00072    *  @history 2007-12-05  Debbie A. Cook added method SetPolynomialDegree to
00073    *                        allow the degree of the polynomials fit to the
00074    *                        camera angles to be changed.  Also changed the
00075    *                        polynomial from a fixed 2nd order polynomial to
00076    *                        an nth degree polynomial with one independent
00077    *                        variable.  PartialType was revised and the calls to
00078    *                        SetReferencePartial (has an added argument, coefficient index)
00079    *                        and DPolynomial (argument type changed to int) were revised.
00080    *                        The function was changed from Parabola
00081    *                        to Polynomial1Variable, now called
00082    *                        PolynomialUnivariate. New methods GetBaseTime
00083    *                        and SetOverrideBaseTime were added
00084    *  @history 2008-02-15  Debbie A. Cook added a new error message to handle the
00085    *                        case where the Naif reference frame code is not
00086    *                        recognized.
00087    *  @history 2008-06-18  Fixed documentation, added NaifStatus calls
00088    *  @history 2008-08-11  Debbie A. Cook Added method to set axes of rotation.
00089    *                        Default axes are still 3,1,3 so existing software will
00090    *                        not be affected by the change.
00091    *  @history 2008-12-12  Debbie A. Cook Added parameters for updated pitch rate and yaw
00092    *                        and related methods
00093    *  @history 2009-07-31  Debbie A. Cook Added new argument, tol, for call to CreateCache
00094    *                        method of Spice class
00095    *  @history 2009-10-01  Debbie A. Cook Modified methods to be compatible with changes made
00096    *                        to parent class, SpiceRotation, to separate rotation into a constant
00097    *                        rotation and a time-dependent rotation
00098    *  @history 2010-12-23  Debbie A. Cook Added new method to return InstrumentPointing keyword
00099    *                        value from kernels group in label and added this value as a class
00100    *                        member.
00101    *  @history 2012-07-06 Debbie A. Cook, Updated Spice members to be more compliant with Isis 
00102    *                          coding standards. References #972.
00103    */
00104   class LineScanCameraRotation : public Isis::SpiceRotation {
00105     public:
00106       //! Constructors
00107 //      LineScanCameraRotation( int frameCode, SpiceRotation *crot, SpiceRotation *prot, SpicePosition *spos );
00108       LineScanCameraRotation(int frameCode,  Isis::Pvl &lab, std::vector<double> timeCache, double tol);
00109 
00110       //! Destructor
00111 //      virtual ~LineScanCameraRotation() { };
00112       virtual ~LineScanCameraRotation();
00113 
00114       void LoadCache();
00115 
00116       void SetJitter(PixelOffset *jitter) {
00117         p_jitter = jitter;
00118       };
00119 
00120       void ReloadCache();
00121 
00122       void ResetPitchRate(double pitchRate) {
00123         p_pitchRate = pitchRate;
00124       };
00125 
00126       void ResetYaw(double yaw) {
00127         p_yaw = yaw;
00128       };
00129 
00130       Isis::PvlKeyword InstrumentPointingValue() { return p_ckKeyword; };
00131 
00132     private:
00133       Isis::Spice *p_spi;
00134       SpiceRotation *p_crot;                              //!< Camera rotation [CJ]
00135       SpicePosition *p_spos;                              //!< Spacecraft position in J2000
00136       SpiceRotation *p_prot;                              //!< Planet rotation [PJ]
00137       std::vector<std::vector<double> > p_cacheIB;        //!< Cached rotations body-fixed to ICR
00138       PixelOffset *p_jitter;                              //!< Jitter rotations from nominal camera to truth (jittering camera)
00139       bool p_cachesLoaded;                                //!< Flag indicated p_cache and p_cacheIB are loaded
00140       double p_pitchRate;                                 //!< Optional update to pitch rate
00141       double p_yaw;                                       //!< Optional update to yaw
00142       Isis::PvlKeyword p_ckKeyword;                       //!< List of the ck and related fk
00143   };
00144 };
00145 
00146 #endif
00147