Commit 3edf5e81 authored by Kristin's avatar Kristin Committed by Stuart Sides
Browse files

Adds Europa Clipper WAC Framing Camera Model - initial. (#3660)

* 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 checkin of WAC camera model and associated changes to eis2isis.

* add truthdata
parent e775ac4f
Loading
Loading
Loading
Loading
+34 −30
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
 </change>
  <change name="Kristin Berry" date="2020-01-08">
     Updates to documentation to add detail and bring it up to date with the current version of the software, prior to checkin to dev. 
     Move NAC-only keywords into a NAC-only group.
 </change>
  </history>

@@ -66,10 +67,10 @@
        <type>filename</type>
        <fileMode>input</fileMode>
        <brief>
          An EIS NAC main image file to be converted to an ISIS cube
          An EIS main image file to be converted to an ISIS cube
        </brief>
        <description>
          Use this parameter to select the filename of the xml label for a a Clipper EIS NAC <em>main image</em>
          Use this parameter to select the filename of the xml label for a a Clipper EIS <em>main image</em>
          file to be converted to a cube. This is expected to be a PDS4 formatted file. The associated image must 
	  have the same name as the label and end in ".dat." 
        </description>
@@ -78,6 +79,24 @@
        </filter>
      </parameter>

    <parameter name="TO">
        <type>cube</type>
        <fileMode>output</fileMode>
        <brief>
          Output ISIS cube file for the main image
        </brief>
        <description>
          The output cube file that will contain the EIS NAC <em>main image</em> in ISIS format.
        </description>
        <filter>
          *.cub
        </filter>
      </parameter>

    </group>

    <group name="NAC Only"> 

	<parameter name="FROM2">
	  <type>filename</type>
	  <fileMode>input</fileMode>
@@ -128,20 +147,7 @@
        </filter>
      </parameter>

      <parameter name="TO">
        <type>cube</type>
        <fileMode>output</fileMode>
        <brief>
          Output ISIS cube file for the main image
        </brief>
        <description>
          The output cube file that will contain the EIS NAC <em>main image</em> in ISIS format.
        </description>
        <filter>
          *.cub
        </filter>
      </parameter>

    </group>
      <parameter name="TO2">
        <type>cube</type>
        <fileMode>output</fileMode>
@@ -156,8 +162,6 @@
          *.cub
        </filter>
      </parameter>

    </group>
   </groups>

</application>
+18 −3
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ void IsisMain() {
    
    // The ClipperNacRollingShutterCamera requires extra information for instantiating a camera.
    if (outputLabel->findKeyword("InstrumentId", PvlObject::Traverse)[0] == "EIS-NAC-RS") {
      
      modifyNacRollingShutterLabel(outputCube, xmlFileName, xmlLabel);
    }
    
@@ -83,8 +82,24 @@ void IsisMain() {
      startTime->setValue(startTimeString);
    }

    PvlKeyword *instrumentName = &outputLabel->findGroup("Instrument", Pvl::Traverse)["InstrumentId"];
    QString instrumentNameString = instrumentName[0];

    PvlGroup kerns("Kernels");
    if (instrumentNameString == "EIS-NAC-RS") {
      // This ID will need to be updated. It is temporarily used for testing but is NOT the actual
      // NAC ID.
      kerns += PvlKeyword("NaifFrameCode", toString(-159011));
    }
    else if (instrumentNameString == "EIS-WAC-FC") {
      kerns += PvlKeyword("NaifFrameCode", toString(-159104));
    }
    else {
      QString msg = "Input file [" + xmlFileName.expanded() + "] has an invalid " +
                 "InstrumentId.";
      throw IException(IException::Unknown, msg, _FILEINFO_);
    }

    outputCube->putGroup(kerns); 
  
    p.EndProcess();
+3 −3
Original line number Diff line number Diff line
@@ -61,8 +61,8 @@ namespace Isis {
    PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);

    // Set up start time and exposure duration
    QString startTime = inst["SpacecraftClockCount"];
    iTime etStart = getClockTime(startTime);
    QString startTime = inst["StartTime"];
    iTime etStart(startTime); 

    // Use to calculate center time when exposure duration is available
    // double exposureDuration = ((double) inst["ExposureDuration"]);
@@ -109,7 +109,7 @@ namespace Isis {
    new CameraGroundMap(this);
    new CameraSkyMap(this);

    setTime(etStart); // Consider changing to center in future. 
    setTime(etStart.Et()); // Consider changing to center in future. 
    LoadCache();
    NaifStatus::CheckErrors();
  }
+5 −0
Original line number Diff line number Diff line
Group = Clipper/EIS-WAC-FC
  Version = 1
  Library = ClipperWacFcCamera
  Routine = ClipperWacFcCameraPlugin
EndGroup
+114 −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 "ClipperWacFcCamera.h"

#include <QString>

#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 Clipper wide angle framing camera object.
   *
   * @param lab Pvl label from a Clipper wide angle framing camera image.
   *
   * @author Stuart Sides and Summer Stapleton-Greig 
   *  
   * @internal
   */
  ClipperWacFcCamera::ClipperWacFcCamera(Cube &cube) : FramingCamera(cube) {
    m_spacecraftNameLong = "Europa Clipper";
    m_spacecraftNameShort = "Clipper";

    m_instrumentNameLong  = "Europa Imaging System Framing Wide Angle Camera";
    m_instrumentNameShort = "EIS-FWAC";

    NaifStatus::CheckErrors();

    SetFocalLength(); 
    SetPixelPitch();

    // Set up detector map, focal plane map, and distortion map
    new CameraDetectorMap(this);
    new CameraFocalPlaneMap(this, naifIkCode());
    new CameraDistortionMap(this);
    
    // Setup the ground and sky map
    new CameraGroundMap(this);
    new CameraSkyMap(this);

    Pvl &lab = *cube.label();
    PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
    QString startTime = inst["StartTime"];
    iTime etStart(startTime);

    // double exposureDuration = (double)inst["ExposureDuration"] / 1000.0;
    // pair<iTime, iTime> startStop = ShutterOpenCloseTimes(et, exposureDuration);

     setTime(etStart.Et()); // Set the time explicitly for now to prevent segfault

    // Internalize all the NAIF SPICE information into memory.
    LoadCache();
    NaifStatus::CheckErrors();
  }

  /**
   * Returns the shutter open and close times.  The LORRI camera doesn't use a shutter to start and 
   * end an observation, but this function is being used to get the observation start and end times,
   * so we will simulate a shutter. 
   * 
   * @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.
   *
   */
  pair<iTime, iTime> ClipperWacFcCamera::ShutterOpenCloseTimes(double time,
                                                         double exposureDuration) {
    return FramingCamera::ShutterOpenCloseTimes(time - exposureDuration / 2.0, exposureDuration);
  }
}

/**
 * This is the function that is called in order to instantiate a ClipperWacFcCamera
 * object.
 *
 * @param lab Cube labels
 *
 * @return Isis::Camera* ClipperWacFcCamera
 * @internal
 */
extern "C" Isis::Camera *ClipperWacFcCameraPlugin(Isis::Cube &cube) {
  return new Isis::ClipperWacFcCamera(cube);
}
Loading