Commit 503bcd11 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Updated documentation and coding standards for SpiceRotation. Updated unit...

Updated documentation and coding standards for SpiceRotation. Updated unit test to test most of its exceptions. Fixes #3972.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@6874 41f8697f-d340-4b68-9986-7bafba869bb8
parent 2f3a9a1f
Loading
Loading
Loading
Loading
+506 −311

File changed.

Preview size limit exceeded, changes collapsed.

+104 −98
Original line number Diff line number Diff line
@@ -25,14 +25,14 @@
#include <string>
#include <vector>

#include <SpiceUsr.h>
#include <SpiceZfc.h>
#include <SpiceZmc.h>
//#include <SpiceUsr.h>
//#include <SpiceZfc.h>
//#include <SpiceZmc.h>

#include "Angle.h"
#include "Table.h"
#include "Quaternion.h"
#include "PolynomialUnivariate.h"
#include "Quaternion.h"

#define J2000Code    1

@@ -49,7 +49,7 @@ namespace Isis {
   * loaded prior to using this class.  A position can be returned in either
   * the J2000 frame or the selected reference frame.  See NAIF required
   * reading for more information regarding this subject at
   * ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/ascii/individual_docs/spk.req
   * ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/spk.html
   * <p>
   * An important functionality of this class is the ability to cache the
   * rotations so they do not have to be constantly read from the NAIF kernels
@@ -192,7 +192,7 @@ namespace Isis {
   *                           Added new methods 
   *                           loadPCFromSpice, loadPCFromTable, toJ2000Partial, poleRaCoefs,
   *                           poleDecCoefs, pmCoefs, poleRaNutPrecCoefs, poleDecNutPrecCoefs, 
   *                           mNutPrecCoefs, sysNutPrecConstants, sysNutPrecCoefs,
   *                           pmNutPrecCoefs, sysNutPrecConstants, sysNutPrecCoefs,
   *                           usePckPolynomial, setPckPolynomial(raCoef, decCoef, pmCoef),
   *                           getPckPolynomial, setEphemerisTimePckPolyFunction, getFrameType
   *                           and members m_frameType, m_tOrientationAvailable, 
@@ -200,11 +200,12 @@ namespace Isis {
   *                           m_sysNutPrec0, m_sysNutPrec1, m_dscale, m_Tscale to support request for 
   *                           solving for target body parameters.
   *                           Also added a new enumerated value for Source, PckPolyFunction, 
   *                            and 
   *                           PartialType, WRT_RotationRate.
   *                           and PartialType, WRT_RotationRate.
   *   @history 2016-02-15 Debbie A. Cook - Programmer notes - Added private method
   *                           setFrameType to set the frame type.  It also loads the planetary 
   *                           constants for a PCK type. 
   *   @history 2016-06-28 Ian Humphrey - Updated documentation and coding standards. Added new
   *                           tests to unit test. Fixes #3972.
   *
   *  @todo Downsize using Hermite cubic spline and allow Nadir tables to be downsized again.
   *  @todo Consider making this a base class with child classes based on frame type or 
@@ -245,36 +246,39 @@ namespace Isis {
       *       PckPolyFunction - The rotation is calculated using the IAU fit 
       *                  polynomials in one variable (time in Julian centuries and days).
       */
      enum Source { Spice,                              //!< Directly from the kernels 
      enum Source {            
        Spice,                   //!< Directly from the kernels 
        Nadir,                   //!< Nadir pointing
        Memcache,                //!< From cached table
        PolyFunction,            //!< From nth degree polynomial
        PolyFunctionOverSpice ,  //!< Kernels plus nth degree polynomial 
                               PckPolyFunction          //!< Quadratic polynomial function with
                                                        //   linear trignometric terms
        PckPolyFunction          //!< Quadratic polynomial function with linear trignometric terms
      };            

      /** 
       * This enumeration indicates whether the partial derivative is taken with 
       * respect to Right Ascension, Declination, or Twist (or Rotation). 
       */ 
      enum PartialType { WRT_RightAscension, //!< With respect to Right Ascension
      enum PartialType { 
        WRT_RightAscension, //!< With respect to Right Ascension
        WRT_Declination,    //!< With respect to Declination
        WRT_Twist           //!< With respect to Twist or Prime Meridian Rotation
      };

      /** 
       *  
       * Status of downsizing the cache
       */ 
      enum DownsizeStatus { Yes,  //!< 
                            Done, //!< 
                            No    //!< 
      enum DownsizeStatus { 
        Yes,  //!< Downsize the cache 
        Done, //!< Cache is downsized
        No    //!< Do not downsize the cache 
      };

      /** 
       *  
       * Enumeration for the frame type of the rotation  
       */ 
      enum FrameType {UNKNOWN = 0,  // Isis specific code for unknown frame type
      enum FrameType {
        UNKNOWN = 0,      //!< Isis specific code for unknown frame type
        INERTL = 1,       //!< See Naif Frames.req document for 
        PCK  = 2,         //!< definitions
        CK = 3,           //!< 
@@ -470,8 +474,7 @@ namespace Isis {
                                          (after all time-based rotations in frame chain from
                                           J2000 to target) to the target frame*/
      std::vector<double> p_CJ;           /**< Rotation matrix from J2000 to first constant 
                                               rotation after all the time-based rotations 
                                               in frame chain from*/
                                               rotation*/
      std::vector<std::vector<double> > p_cacheAv;
      //!< Cached angular velocities for corresponding rotactions in p_cache
      std::vector<double> p_av;           //!< Angular velocity for rotation at time p_et
@@ -559,9 +562,9 @@ namespace Isis {
      //                and pmNutPrec).
      //
      // The next three vectors will have length 3 (for a quadratic polynomial) if used.
      std::vector<Angle>m_raPole;        //!< Coefficients of a quadratic polynomial fitting pole ra
      std::vector<Angle>m_decPole;      //!< Coefficients of a quadratic polynomial fitting pole dec
      std::vector<Angle>m_pm ;             //!< Coefficients of a quadratic polynomial fitting pole pm
      std::vector<Angle>m_raPole;       //!< Coefficients of a quadratic polynomial fitting pole ra.
      std::vector<Angle>m_decPole;      //!< Coefficients of a quadratic polynomial fitting pole dec.
      std::vector<Angle>m_pm ;          //!< Coefficients of a quadratic polynomial fitting pole pm.
      //
      // Currently multiples (terms with periods matching other terms but varying amplitudes) 
      // are handled as additional terms added to the end of the vector as Naif does (see 
@@ -574,10 +577,13 @@ namespace Isis {
      std::vector<Angle>m_sysNutPrec0; //!< Constants of planetary system nut/prec periods
      std::vector<Angle>m_sysNutPrec1; //!< Linear terms of planetary system nut/prec periods

      // The following scalers are used in the IAU equations to convert p_et to the appropriate time
      // units for calculating target body ra, dec, and w.  These need to be initialized in every constructor.
      static const double m_centScale;   //!<  Seconds per Julian century for scaling time in seconds *** may need to put static in front of const
      static const double m_dayScale;    //!< Seconds per day for scaling time in seconds to get target body w
      // The following scalars are used in the IAU equations to convert p_et to the appropriate time
      // units for calculating target body ra, dec, and w.  These need to be initialized in every 
      // constructor.
      //! Seconds per Julian century for scaling time in seconds
      static const double m_centScale;
      //! Seconds per day for scaling time in seconds to get target body w
      static const double m_dayScale;
  };
};

+476 −87

File changed.

Preview size limit exceeded, changes collapsed.