Commit e543c921 authored by Kris Becker's avatar Kris Becker
Browse files

The Hayabusa AMICA instrument camera model is now available in ISIS. It...

The Hayabusa AMICA instrument camera model is now available in ISIS. It includes the documented distortion model and support for all eight filters.  References #1884.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@5643 41f8697f-d340-4b68-9986-7bafba869bb8
parent 01ea2454
Loading
Loading
Loading
Loading
+133 −0
Changes for isis/src/hayabusa/objs/AmicaCamera/AmicaCamera.cpp: 133 added lines, 0 removed lines.
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 & 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 "AmicaCamera.h"

#include "CameraDetectorMap.h"
#include "CameraDistortionMap.h"
#include "CameraFocalPlaneMap.h"
#include "CameraGroundMap.h"
#include "CameraSkyMap.h"
#include "IString.h"
#include "iTime.h"
#include "NaifStatus.h"

using namespace std;

namespace Isis {
  /**
   * Constructs a Hayabusa AmicaCamera object using the image labels.
   *
   * @param lab Pvl label from a Hayabusa AMICA image.
   *
   * @internal
   */
  AmicaCamera::AmicaCamera(Cube &cube) : FramingCamera(cube) {
    NaifStatus::CheckErrors();
    Pvl &lab = *cube.label();
    // Get the camera characteristics
    QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["Name"];
    filter = filter.toUpper();

    SetFocalLength();  // Retrives from IK stored in units of meters
    SetFocalLength(FocalLength() * 1000.0);  // Convert from meters to mm

    // Get from IAK
    SetPixelPitch();

    // Get the start time in et
    PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);

    // set variables startTime and exposureDuration
    double time = iTime((QString)inst["StartTime"]).Et();

    // Exposure duration keyword is in seconds
    double exposureDuration = ((double) inst["ExposureDuration"]);
    pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(time, exposureDuration);

    iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0;

    // Setup detector map
    new CameraDetectorMap(this);

    // Setup focal plane map
    CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());

    focalMap->SetDetectorOrigin(
      Spice::getDouble("INS" + toString(naifIkCode()) +
                       "_BORESIGHT_SAMPLE"),
      Spice::getDouble("INS" + toString(naifIkCode()) +
                       "_BORESIGHT_LINE"));

    // Setup distortion map
    CameraDistortionMap *dmap = new CameraDistortionMap(this);
    dmap->SetDistortion(-130102);

    // Setup the ground and sky map
    new CameraGroundMap(this);
    new CameraSkyMap(this);

    setTime(centerTime);
    LoadCache();
    NaifStatus::CheckErrors();
  }

  /**
   * Returns the shutter open and close times. The user should pass in the
   * ExposureDuration keyword value, converted from milliseconds to seconds, and
   * the StartTime keyword value, converted to ephemeris time. The StartTime
   * keyword value from the labels represents the time at the start of the
   * observation, as noted in the Clementine EDR image SIS. This method uses the
   * FramingCamera class implementation, returning the given time value as the
   * shutter open and the sum of the time value and exposure duration as the
   * shutter close.
   *
   * @param exposureDuration ExposureDuration keyword value from the labels,
   *                         converted to seconds.
   * @param time The StartTime keyword value from the labels, converted to
   *             ephemeris time.
   *
   * @return @b pair < @b iTime, @b iTime > The first value is the shutter
   *         open time and the second is the shutter close time.
   *
   * @author 2011-05-03 Jeannie Walldren
   * @internal
   *   @history 2011-05-03 Jeannie Walldren - Original version.
   */
  pair<iTime, iTime> AmicaCamera::ShutterOpenCloseTimes(double time,
                                                        double exposureDuration) {
    return FramingCamera::ShutterOpenCloseTimes(time, exposureDuration);
  }
}


/**
 * This is the function that is called in order to instantiate an AmicaCamera
 * object.
 *
 * @param lab Cube labels
 *
 * @return Isis::Camera* AmicaCamera
 * @internal 
 *   @history 2013-11-27 Kris Becker - Original Version
 */
extern "C" Isis::Camera *AmicaCameraPlugin(Isis::Cube &cube) {
  return new Isis::AmicaCamera(cube);
}
+70 −0
Changes for isis/src/hayabusa/objs/AmicaCamera/AmicaCamera.h: 70 added lines, 0 removed lines.
Original line number Diff line number Diff line
#ifndef AmicaCamera_h
#define AmicaCamera_h
/**
 * @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 "FramingCamera.h"

namespace Isis {
  /**
   * This is the camera model for the Hayabusa AMICA camera.
   *
   * @ingroup SpiceInstrumentsAndCameras
   * @ingroup Hayabusa
   *  
   * @author  2013-11-27 Kris Becker
   *
   * @internal 
   *   @history 2013-11-27 Kris Becker - Original version
   */
  class AmicaCamera : public FramingCamera {
    public:
      AmicaCamera(Cube &cube);
      /** Destructor  */
      ~AmicaCamera() { }
      virtual std::pair <iTime, iTime> ShutterOpenCloseTimes(double time, 
                                                             double exposureDuration);

      /**
       * CK frame ID -  - Instrument Code from spacit run on CK
       *  
       * @return @b int The appropriate instrument code for the "Camera-matrix" 
       *         Kernel Frame ID
       */
      virtual int CkFrameId() const { return (-130000); }

      /** 
       * CK Reference ID - J2000
       * 
       * @return @b int The appropriate instrument code for the "Camera-matrix"
       *         Kernel Reference ID
       */
      virtual int CkReferenceId() const { return (1); }

      /** 
       * SPK Reference ID - J2000
       * 
       * @return @b int The appropriate instrument code for the Spacecraft
       *         Kernel Reference ID
       */
      virtual int SpkReferenceId() const { return (1); }
  };
};
#endif
+35 −0
Changes for isis/src/hayabusa/objs/AmicaCamera/AmicaCamera.truth: 35 added lines, 0 removed lines.
Original line number Diff line number Diff line
Unit Test for AmicaCamera...
FileName: st_2530292409_v.cub
CK Frame: -130102

Kernel IDs: 
CK Frame ID = -130000
CK Reference ID = 1
SPK Target ID = -130
SPK Reference ID = 1

Shutter open = 184747466.182630032
Shutter close = 184747466.182673544

For upper left corner ...
DeltaSample = 0.000000000
DeltaLine = 0.000000000

For upper right corner ...
DeltaSample = 0.000000000
DeltaLine = 0.000000000

For lower left corner ...
DeltaSample = 0.000000000
DeltaLine = 0.000000000

For lower right corner ...
DeltaSample = 0.000000000
DeltaLine = 0.000000000

For center pixel position ...
Latitude OK
Longitude OK
DeltaSample = 0.000000000
DeltaLine = 0.000000000
+6 −0
Changes for isis/src/hayabusa/objs/AmicaCamera/Camera.plugin: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
Group = Hayabusa/Amica
  Version = 1
  Library = AmicaCamera
  Routine = AmicaCameraPlugin
EndGroup
 
+7 −0
Changes for isis/src/hayabusa/objs/AmicaCamera/Makefile: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
ifeq ($(ISISROOT), $(BLANK))
.SILENT:
error:
	echo "Please set ISISROOT";
else
	include $(ISISROOT)/make/isismake.objs
endif
 No newline at end of file
Loading