Skip to content

Commit

Permalink
in-progress-work
Browse files Browse the repository at this point in the history
  • Loading branch information
amystamile-usgs committed Jan 13, 2025
1 parent d2486e7 commit f9ae045
Show file tree
Hide file tree
Showing 5 changed files with 579 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ release.
- Fixed kaguyatc2isis invalid BandBin values [#5629](https://github.com/DOI-USGS/ISIS3/issues/5629)
- Fixed SpiceClient to handle redirect requests.
- Fixed jigsaw to default OUTADJUSTMENTH5 option to false and allow this feature to run on read-only images [#5700](https://github.com/DOI-USGS/ISIS3/issues/5700)

- Fixed Cube::fromIsd to add "LineScanTimes" table from HRSC isds [#5668](https://github.com/DOI-USGS/ISIS3/issues/5668)
## [9.0.0] - 09-25-2024

### Added
Expand Down
22 changes: 22 additions & 0 deletions isis/src/base/objs/Cube/Cube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,26 @@ namespace Isis {

this->write(sunTable);

if (isd.contains("line_scan_rate")) {
TableField ephTimeField("EphemerisTime", TableField::Double);
TableField expTimeField("ExposureTime", TableField::Double);
TableField lineStartField("LineStart", TableField::Integer);

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

Table timesTable("LineScanTimes", timesRecord);
for (size_t i = 0; i < isd["line_scan_rate"].size(); ++i) {
timesRecord[0] = isd["line_scan_rate"][i][1].get<double>();
timesRecord[1] = isd["line_scan_rate"][i][2].get<double>();
timesRecord[2] = isd["line_scan_rate"][i][0].get<int>();
timesTable += timesRecord;
}
this->write(timesTable);
}

PvlGroup currentKernels = this->group("Kernels");

Pvl *label = this->label();
Expand All @@ -1529,7 +1549,9 @@ namespace Isis {
// Access the camera here while all of the kernels are still loaded.
// This needs to be done for some cameras that need loaded spice data
// to actually create the camera model. (KaguyaTC for example)
std::cout << "before_camera\n";
this->camera();
std::cout << "after_camera\n";
}


Expand Down
22 changes: 15 additions & 7 deletions isis/src/mex/objs/HrscCamera/HrscCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ namespace Isis {
SetPixelPitch(0.007);
instrumentRotation()->SetFrame(-41210);

ReadLineRates(cube);

// Get required keywords from instrument group
Pvl &lab = *cube.label();
PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);

ReadLineRates(lab.fileName());

// Setup detector map for transform of image pixels to detector position
new VariableLineScanCameraDetectorMap(this, p_lineRates);
DetectorMap()->SetDetectorSampleSumming(inst["Summing"]);
Expand Down Expand Up @@ -119,14 +119,22 @@ namespace Isis {


/**
* @param filename
* @param cube
*/
void HrscCamera::ReadLineRates(QString filename) {
Table timesTable("LineScanTimes", filename);
void HrscCamera::ReadLineRates(Cube &cube) {
Table timesTable("LineScanTimes");

// check if LineScanTimes was added from isd
if (cube.hasTable("LineScanTimes")) {
timesTable = cube.readTable("LineScanTimes");
}
else {
timesTable = Table("LineScanTimes", cube.fileName());
}

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

Expand All @@ -138,7 +146,7 @@ namespace Isis {

if(p_lineRates.size() <= 0) {
QString msg = "There is a problem with the data within the Table ";
msg += "[LineScanTimes] in [" + filename + "]";
msg += "[LineScanTimes] in [" + cube.fileName() + "]";
throw IException(IException::Unknown, msg, _FILEINFO_);
}
}
Expand Down
2 changes: 1 addition & 1 deletion isis/src/mex/objs/HrscCamera/HrscCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace Isis {
virtual int SpkReferenceId() const;

private:
void ReadLineRates(QString filename);
void ReadLineRates(Cube &cube);

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

0 comments on commit f9ae045

Please sign in to comment.