Loading isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp +30 −3 Original line number Original line Diff line number Diff line Loading @@ -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 { /** /** Loading Loading @@ -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()); Loading @@ -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(); } } Loading Loading @@ -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_); } } } } /** /** Loading isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.h +6 −2 Original line number Original line Diff line number Diff line Loading @@ -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 { Loading @@ -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.*/ }; }; }; }; Loading isis/tests/Fixtures.cpp +24 −1 Original line number Original line Diff line number Diff line Loading @@ -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"); } } } } Loading
isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.cpp +30 −3 Original line number Original line Diff line number Diff line Loading @@ -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 { /** /** Loading Loading @@ -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()); Loading @@ -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(); } } Loading Loading @@ -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_); } } } } /** /** Loading
isis/src/clipper/objs/ClipperPushBroomCamera/ClipperPushBroomCamera.h +6 −2 Original line number Original line Diff line number Diff line Loading @@ -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 { Loading @@ -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.*/ }; }; }; }; Loading
isis/tests/Fixtures.cpp +24 −1 Original line number Original line Diff line number Diff line Loading @@ -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"); } } } }