Unverified Commit 0a86c831 authored by Amy Stamile's avatar Amy Stamile Committed by GitHub
Browse files

Implemented push broom's variable line rate. (#4572)

parent d15caf3d
Loading
Loading
Loading
Loading
+30 −3
Original line number Original line Diff line number Diff line
@@ -14,7 +14,6 @@ find files of those names at the top level of this repository. **/
#include "LineScanCameraGroundMap.h"
#include "LineScanCameraGroundMap.h"
#include "LineScanCameraSkyMap.h"
#include "LineScanCameraSkyMap.h"
#include "NaifStatus.h"
#include "NaifStatus.h"
#include "LineScanCameraDetectorMap.h"


namespace Isis {
namespace Isis {
  /**
  /**
@@ -50,12 +49,13 @@ namespace Isis {


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


     ReadLineRates(lab.fileName());

     // set up detector map
     // set up detector map
     new LineScanCameraDetectorMap(this, etStart.Et(), lineRate);
     new VariableLineScanCameraDetectorMap(this, p_lineRates);


     // Set up focal plane map
     // Set up focal plane map
     CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
     CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
@@ -74,6 +74,8 @@ namespace Isis {
     new LineScanCameraGroundMap(this);
     new LineScanCameraGroundMap(this);
     new LineScanCameraSkyMap(this);
     new LineScanCameraSkyMap(this);


     setTime(etStart.Et());

     LoadCache();
     LoadCache();
     NaifStatus::CheckErrors();
     NaifStatus::CheckErrors();
   }
   }
@@ -117,6 +119,31 @@ namespace Isis {
   int ClipperPushBroomCamera::SpkReferenceId() const {
   int ClipperPushBroomCamera::SpkReferenceId() const {
     return (1);
     return (1);
   }
   }

   /**
    * @param filename
    */
   void ClipperPushBroomCamera::ReadLineRates(QString filename) {
     Table timesTable("LineScanTimes", filename);

     if(timesTable.Records() <= 0) {
       QString msg = "Table [LineScanTimes] in [";
       msg += filename + "] must not be empty";
       throw IException(IException::Unknown, msg, _FILEINFO_);
     }

     for(int i = 0; i < timesTable.Records(); i++) {
       p_lineRates.push_back(LineRateChange((int)timesTable[i][2],
                                            (double)timesTable[i][0],
                                            timesTable[i][1]));
     }

     if(p_lineRates.size() <= 0) {
       QString msg = "There is a problem with the data within the Table ";
       msg += "[LineScanTimes] in [" + filename + "]";
       throw IException(IException::Unknown, msg, _FILEINFO_);
     }
   }
}
}


/**
/**
+6 −2
Original line number Original line Diff line number Diff line
@@ -10,8 +10,6 @@ find files of those names at the top level of this repository. **/


#include "LineScanCamera.h"
#include "LineScanCamera.h"


#include <QString>

#include "VariableLineScanCameraDetectorMap.h"
#include "VariableLineScanCameraDetectorMap.h"


namespace Isis {
namespace Isis {
@@ -28,6 +26,12 @@ namespace Isis {
      virtual int CkFrameId() const;
      virtual int CkFrameId() const;
      virtual int CkReferenceId() const;
      virtual int CkReferenceId() const;
      virtual int SpkReferenceId() const;
      virtual int SpkReferenceId() const;

    private:
      void ReadLineRates(QString filename);

      std::vector<LineRateChange> p_lineRates; /**< Vector of the variable line rates for this
                                                    camera model.*/
  };
  };
};
};


+24 −1
Original line number Original line Diff line number Diff line
@@ -1689,5 +1689,28 @@ namespace Isis {
      QFile::copy("data/clipper/ClipperWacPb.cub", testPath);
      QFile::copy("data/clipper/ClipperWacPb.cub", testPath);
      testCube = new Cube(testPath, "rw");
      testCube = new Cube(testPath, "rw");
    }
    }

    PvlGroup &inst = testCube->label()->findObject("IsisCube").findGroup("Instrument");

    TableField ephTimeField("MinimumRadius", TableField::Double);
    TableField expTimeField("MaximumRadius", TableField::Double);
    TableField lineStartField("LineStart", TableField::Integer);

    TableRecord timesRecord;
    timesRecord += ephTimeField;
    timesRecord += expTimeField;
    timesRecord += lineStartField;

    Table timesTable("LineScanTimes", timesRecord);

    timesRecord[0] = 893716269.18552;
    timesRecord[1] = (double) inst["LineExposureDuration"] / 1000;
    timesRecord[2] = 1;
    timesTable += timesRecord;

    testCube->write(timesTable);
    QString fileName = testCube->fileName();
    delete testCube;
    testCube = new Cube(fileName, "rw");
  }
  }
}
}