Commit 6dfa1454 authored by Kristin's avatar Kristin Committed by Stuart Sides
Browse files

Initial ClipperNacRollingShutterCameraModel and associated classes PR (#3657)

* Adds NthOrderPolynomial class needed for jitterfit (for EIS) to ISIS

* Remove incorrect documentation

* Update unitTest output

* Remove unnecessary Makefile

* Adds NthOrderPolynomial class to ISIS needed for jitterfit for EIS (#3639)

* Adds NthOrderPolynomial class needed for jitterfit (for EIS) to ISIS

* Remove incorrect documentation

* Update unitTest output

* Remove unnecessary Makefile

* Adds ingestion application eis2isis to ISIS (#3638)

* Initial commit of eis2isis

* Remove references to EISBlob in comments and remove unnecessary Makefiles

* Initial EIS Camera model commit with associated classes

* Convert initial RSCameraDetectorMap unit test to a gtest

* Changes in response to review comments: add checks to make sure tables and keywords exist before setting

* Updated with old-style unit tests for camera models
parent eea98707
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -372,7 +372,8 @@ namespace Isis {
        PushFrame,      //!< Push Frame Camera
        LineScan,       //!< Line Scan Camera
        Radar,          //!< Radar Camera
        Point       //!< Point Camera
        Point,          //!< Point Camera
        RollingShutter, //!< RollingShutter
      };

      /**
+35 −0
Original line number Diff line number Diff line
/**
 * @file
 * $Revision: 1.1 $
 * $Date: 2009/08/31 15:11:49 $
 *
 *   Unless noted otherwise, the portions of Isis written by the USGS are
 *   public domain. See individual third-party library and package descriptions
 *   for intellectual property information, user agreements, and related
 *   information.
 *
 *   Although Isis has been used by the USGS, no warranty, expressed or
 *   implied, is made by the USGS as to the accuracy and functioning of such
 *   software and related material nor shall the fact of distribution
 *   constitute any such warranty, and no responsibility is assumed by the
 *   USGS in connection therewith.
 *
 *   For additional information, launch
 *   $ISISROOT/doc//documents/Disclaimers/Disclaimers.html
 *   in a browser or see the Privacy &amp; Disclaimers page on the Isis website,
 *   http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
 *   http://www.usgs.gov/privacy.html.
 */

#include "RollingShutterCamera.h"

namespace Isis {
  /**
   * Constructs the RollingShutterCamera object
   *
   * @param cube Cube used to create the parent Camera object
   */
  RollingShutterCamera::RollingShutterCamera(Isis::Cube &cube) : Camera(cube) {
  }
};
+80 −0
Original line number Diff line number Diff line
#ifndef RollingShutterCamera_h
#define RollingShutterCamera_h
/**
 *   Unless noted otherwise, the portions of Isis written by the USGS are
 *   public domain. See individual third-party library and package descriptions
 *   for intellectual property information, user agreements, and related
 *   information.
 *
 *   Although Isis has been used by the USGS, no warranty, expressed or
 *   implied, is made by the USGS as to the accuracy and functioning of such
 *   software and related material nor shall the fact of distribution
 *   constitute any such warranty, and no responsibility is assumed by the
 *   USGS in connection therewith.
 *
 *   For additional information, launch
 *   $ISISROOT/doc//documents/Disclaimers/Disclaimers.html
 *   in a browser or see the Privacy &amp; Disclaimers page on the Isis website,
 *   http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
 *   http://www.usgs.gov/privacy.html.
 */

#include "Camera.h"

/**
 * @brief Generic class for Rolling Shutter Cameras
 *
 * This class is used to abstract out framing camera functionality from children
 * classes.
 *
 * @ingroup SpiceInstrumentsAndCameras
 *
 * @author Makayla Shepherd 2018-04-02
 *
 * @internal
 *   @history 2018-04-09 Ian Humphrey - Updated some doxygen documentation and coding standards.
 */
namespace Isis {
  class Cube;
  class RollingShutterCameraDetectorMap;

  /**
   * @brief Generic class for Rolling Shutter Cameras
   *
   * This class is used to abstract out rolling shutter camera functionality from
   * children classes.
   *
   * @ingroup SpiceInstrumentsAndCameras
   * @author 2018-04-02 Makayla Shepherd
   */
  class RollingShutterCamera : public Camera {
    public:
      RollingShutterCamera(Cube &cube);

      /**
       * Returns the RollingShutter type of camera, as enumerated in the Camera
       * class.
       * @return @b CameraType RollingShutter camera type.
       */
      virtual CameraType GetCameraType() const {
        return RollingShutter;
      };

      /**
       * Returns a pointer to the RollingShutterCameraDetectorMap object
       *
       * @return RollingShutterCameraDetectorMap*
       */
      RollingShutterCameraDetectorMap *DetectorMap() {
        return (RollingShutterCameraDetectorMap *)Camera::DetectorMap();
      };

    private:
      /** Copying cameras is not allowed */
      RollingShutterCamera(const RollingShutterCamera &);
      /** Assigning cameras is not allowed */
      RollingShutterCamera &operator=(const RollingShutterCamera &);
  };
};

#endif
+5 −0
Original line number Diff line number Diff line
Camera = Framing?         0
Camera = LineScan?        0
Camera = PushFrame?       0
Camera = Radar?           0
Camera = RollingShutter?  1
+92 −0
Original line number Diff line number Diff line
/**
 * @file
 *
 *   Unless noted otherwise, the portions of Isis written by the USGS are public
 *   domain. See individual third-party library and package descriptions for
 *   intellectual property information,user agreements, and related information.
 *
 *   Although Isis has been used by the USGS, no warranty, expressed or implied,
 *   is made by the USGS as to the accuracy and functioning of such software
 *   and related material nor shall the fact of distribution constitute any such
 *   warranty, and no responsibility is assumed by the USGS in connection
 *   therewith.
 *
 *   For additional information, launch
 *   $ISISROOT/doc//documents/Disclaimers/Disclaimers.html in a browser or see
 *   the Privacy &amp; Disclaimers page on the Isis website,
 *   http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
 *   http://www.usgs.gov/privacy.html.
 */
#include <iostream>

#include "RollingShutterCamera.h"
#include "IException.h"
#include "iTime.h"
#include "Preference.h"
#include "Pvl.h"
#include "PvlGroup.h"

using namespace std;
using namespace Isis;

class TestRollingShutterCamera : public RollingShutterCamera {
      public:
        TestRollingShutterCamera(Cube &cube) : RollingShutterCamera(cube) {}

        /**
         * This is a pure virtual method from the Camera parent class and must be
         * overriden.
         */
        virtual int CkFrameId() const {
          string msg = "CK Frame ID is unqiue to mission-specific cameras";
          throw IException(IException::Unknown, msg, _FILEINFO_);
        }

        /**
         * This is a pure virtual method from the Camera parent class and must be
         * overriden.
         */
        virtual int CkReferenceId() const {
          string msg = "CK Reference ID is unique to mission-specific cameras";
          throw IException(IException::Unknown, msg, _FILEINFO_);
        }

        /**
         * This is a pure virtual method from the Camera parent class and must be
         * overriden.
         */
        virtual int SpkReferenceId() const {
          string msg = "SPK Reference ID is unique to mission-specific cameras";
          throw IException(IException::Unknown, msg, _FILEINFO_);
        }
        
        // These are pure virtual within Sensor that must be overriden
        virtual QString instrumentNameLong() const { return QString("RollingShutting"); }
        virtual QString instrumentNameShort() const { return QString("RS"); }
        virtual QString spacecraftNameLong() const { return QString("RollingShutterSpaceCraft"); }
        virtual QString spacecraftNameShort() const { return QString("SC"); }
    };


int main() {
  Preference::Preferences(true);
  //NOTE: The following cube is not from a framing camera.  The test returns
  //true for framing camera type since MyCamera is a child class of FramingCamera
  try {
    Cube cube("$clipper/testData/simulated_clipper_eis_nac_rolling_shutter.cub", "r");
    TestRollingShutterCamera cam(cube);

    // test camera type
    cout << "Camera = Framing?         " << (cam.GetCameraType() == Camera::Framing) << endl;
    cout << "Camera = LineScan?        " << (cam.GetCameraType() == Camera::LineScan) << endl;
    cout << "Camera = PushFrame?       " << (cam.GetCameraType() == Camera::PushFrame) << endl;
    cout << "Camera = Radar?           " << (cam.GetCameraType() == Camera::Radar) << endl;
    cout << "Camera = RollingShutter?  " << (cam.GetCameraType() == Camera::RollingShutter) << endl;
  }
  catch (IException &e) {
    cout << endl << endl;
    IException(e, IException::Programmer,
              "\n------------RollingShutterCamera Unit Test Failed.------------",
              _FILEINFO_).print();
  }
}
Loading