Commit 416c117e authored by Stuart Sides's avatar Stuart Sides
Browse files

Updated to fix issues with Leisa bands 2-256

parent 8a1be87a
Loading
Loading
Loading
Loading
+56 −5
Original line number Diff line number Diff line
@@ -23,7 +23,9 @@
#include "CameraFocalPlaneMap.h"

#include <cmath>

#include <QDebug>
#include <QVector>

#include "Affine.h"
#include "Camera.h"
@@ -51,10 +53,6 @@ namespace Isis {
  }


  CameraFocalPlaneMap::~CameraFocalPlaneMap(){
  }


 /**
  * Added new method to allow programmer to pass in affine coefficients
  * 
@@ -93,6 +91,20 @@ namespace Isis {
  }


  /**
   * Destructor
   * 
   */
  CameraFocalPlaneMap::~CameraFocalPlaneMap(){
  }


  /**
   * Initialize the focal plane map to its default state 
   *  
   * @param parent Parent camera
   * @param naifIkCode  code of the naif instrument for reading coefficients
   */
  void CameraFocalPlaneMap::Init(Camera *parent, const int naifIkCode) {
    p_detectorSampleOrigin = 0.0;
    p_detectorLineOrigin = 0.0;
@@ -131,7 +143,10 @@ namespace Isis {
  }


  /** Compute detector position (sample,line) from focal plane coordinates
  /** Compute detector position (sample,line) from focal plane coordinates. NOTE: This is detector
   *  (sample, line) not necessarily image (sample, line). If the image was reformatted from what
   *  was collected the two differ. See the New Horizons LEISA camera for an example (LEISA is a
   *  frame camera being treated as a line scan camera).
   *
   * This method will compute both the centered and normal detector position
   * given a distorted focal plane coordinate.
@@ -325,21 +340,57 @@ namespace Isis {
  }


  //! Set the affine coefficients for converting destorted (x,y) to a detector Line
  void CameraFocalPlaneMap::SetTransL(const QVector<double> transL) {
   for (int i=0; i<3; ++i) {
     p_itransl[i] = transL[i];
   }
  }


  //! Set the affine coefficients for converting destorted (x,y) to a detector Sample
  void CameraFocalPlaneMap::SetTransS(const QVector<double> transS) {
   for (int i=0; i<3; ++i) {
     p_itranss[i] = transS[i];
   }
  }


  //! Set the affine coefficients for converting detector (sample,line) to a distorted X
  void CameraFocalPlaneMap::SetTransX(const QVector<double> transX) {
   for (int i=0; i<3; ++i) {
     p_transx[i] = transX[i];
   }
  }


  //! Set the affine coefficients for converting detector (sample,line) to a distorted Y
  void CameraFocalPlaneMap::SetTransY(const QVector<double> transY) {
   for (int i=0; i<3; ++i) {
     p_transy[i] = transY[i];
   }
  }


  //! Return the affine coefficients for converting detector (sample,line) to a distorted X
  const double *CameraFocalPlaneMap::TransX() const{
    return p_transx;
  }


  //! Return the affine coefficients for converting detector (sample,line) to distorted Y
  const double *CameraFocalPlaneMap::TransY() const{
    return p_transy;
  }


  //! Return the affine coefficients for converting distorted (x,y) to a detector Sample
  const double *CameraFocalPlaneMap::TransS() const{
    return p_itranss;
  }


  //! Return the affine coefficients for converting distorted (x,y) to a detector Line
  const double *CameraFocalPlaneMap::TransL() const{
    return p_itransl;
  }
+10 −2
Original line number Diff line number Diff line
@@ -23,8 +23,10 @@
 *   http://www.usgs.gov/privacy.html.
 */

template<class T> class QVector;

namespace Isis {
 
  class Affine;
  class Camera;
  /** Convert between distorted focal plane and detector coordinates
@@ -118,10 +120,16 @@ namespace Isis {
                                    const double lineOffset);
      double DetectorLineOffset() const;
      double DetectorSampleOffset() const;

      void SetTransL(const QVector<double> transL);
      void SetTransS(const QVector<double> transS);
      void SetTransX(const QVector<double> transX);
      void SetTransY(const QVector<double> transY);

      const double *TransL() const;
      const double *TransS() const;
      const double *TransX() const;
      const double *TransY() const;
      const double *TransS() const;
      const double *TransL() const;

      /**
       * Focal plane x dependency indicates whether the x value of the focal 
+3 −4
Original line number Diff line number Diff line
@@ -128,13 +128,11 @@ void IsisMain() {

  output->putGroup(outLabel.findGroup("Instrument", Pvl::Traverse));

  /*
  // Create an Archive group
  FileName archiveTransFile(transDir + "leisaArchive_fit.trn");
  PvlTranslationManager archiveXlater(fitsLabel, archiveTransFile.expanded());
  archiveXlater.Auto(outLabel);
  output->putGroup(outLabel.findGroup("Archive", Pvl::Traverse));
  */

  //Create a Band Bin Group
  FileName bandTransFile(transDir + "leisaBandBin_fit.trn");
@@ -152,12 +150,13 @@ void IsisMain() {
  // Modify/add Instument group keywords not handled by the translater
  Pvl *isisLabel = output->label();
  PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse);
  PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse);

  //Add StartTime & EndTime
  QString midTimeStr = inst["MidObservationTime"];
  QString midTimeStr = archive["MidObservationTime"];
  iTime midTime(midTimeStr.toDouble());

  QString obsDuration = inst["ObservationDuration"];
  QString obsDuration = archive["ObservationDuration"];
  double obsSeconds = obsDuration.toDouble();

  iTime startTime = midTime - obsSeconds/2.0;
+0 −116
Original line number Diff line number Diff line
#
# This translation file is used to produce the ISIS 3 Instrument label group
# for the New Horizons LEISA camera.
#
Group = SpacecraftName
  Auto
  InputKey       = HOSTNAME
  InputPosition  = FITSLABELS
  InputDefault   = UNKNOWN
  OutputName     = SpacecraftName
  OutputPosition = (Object, IsisCube, Group, Instrument)
  Translation    = ("NEW HORIZONS", "NEW HORIZONS")
End_Group

Group = InstrumentId
  Auto
  InputKey       = INSTRU
  InputPosition  = FITSLABELS
  InputDefault   = UNKNOWN
  OutputName     = InstrumentId
  OutputPosition = (Object, IsisCube, Group, Instrument)
  Translation    = (LEISA, lei)
End_Group

Group = TargetName
  Auto
  InputKey       = TARGET
  InputPosition  = FITSLABELS
  InputDefault   = UNKNOWN
  OutputName     = TargetName
  OutputPosition = (Object, IsisCube, Group, Instrument)
  Translation    = (Jupiter, JUPITER)
  Translation    = (IO, IO)
  Translation    = (Pluto, PLUTO)
  Translation    = (Charon, CHARON)
  Translation    = (Sky, SKY)
  Translation    = (*, *)
End_Group

Group = MidObservationTime
  Auto
  InputKey       = SPCSCET
  InputPosition  = FITSLABELS
  OutputName     = MidObservationTime
  OutputPosition = (Object, IsisCube, Group, Instrument)
  Translation    = (*, *)
End_Group

Group = ObservationDuration
  Auto
  InputKey       = DURMET
  InputPosition  = FITSLABELS
  OutputName     = ObservationDuration
  OutputPosition = (Object, IsisCube, Group, Instrument)
  Translation    = (*, *)
End_Group

# Commented out until/if we have start and stop times
# Currently there are only center of exposure times
#Group = StopTime
#  Auto
#  InputKey       = SPCUTCAL
#  InputPosition  = FITSLABELS
#  OutputName     = StopTime
#  OutputPosition = (Object, IsisCube, Group, Instrument)
#  Translation    = (*, *)
#End_Group

#Group = SpacecraftClockStartCount
#  Auto
#  InputKey       = SPCSCLK0
#  InputPosition  = FITSLABELS
#  OutputName     = SpacecraftClockStartCount
#  OutputPosition = (Object, IsisCube, Group, Instrument)
#  Translation    = (*, *)
#End_Group

# Commented out until/if we have start and stop times
# Currently there are only center of exposure times
#Group = SpacecraftClockStopCount
#  Auto
#  InputKey       = SPCSCDP
#  InputPosition  = FITSLABELS
#  OutputName     = SpacecraftClockStopCount
#  OutputPosition = (Object, IsisCube, Group, Instrument)
#  Translation    = (*, *)
#End_Group

Group = ExposureDuration
  Auto
  InputKey       = RALPHEXP
  InputPosition  = FITSLABELS
  OutputName     = ExposureDuration
  OutputPosition = (Object, IsisCube, Group, Instrument)
  Translation    = (*, *)
End_Group

Group = Detector
  Auto
  InputKey       = DETECTOR
  InputPosition  = FITSLABELS
  OutputName     = Detector
  OutputPosition = (Object, IsisCube, Group, Instrument)
  Translation    = (*, *)
End_Group

Group = ScanType
  Auto
  InputKey       = SCANTYPE
  InputPosition  = FITSLABELS
  OutputName     = ScanType
  OutputPosition = (Object, IsisCube, Group, Instrument)
  Translation    = (*, *)
End_Group

End
+0 −12
Original line number Diff line number Diff line
# First attempt at LEISA Kernel translation

Group = NaifCode
  Auto
  InputKey       = SPCINSID
  InputPosition  = FITSLABELS
  OutputName     = NaifFrameCode
  OutputPosition = (Object, IsisCube, Group, Kernels)
  Translation = (-98201, -98201)
End_Group

End
Loading