From 3633675058855398e6bd8fd7ac53c48c9dc7ea24 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Fri, 15 Sep 2023 17:14:05 -0700 Subject: [PATCH 1/2] Fix errors when using CSM camera in qview --- .../AdvancedTrackTool/AdvancedTrackTool.cpp | 79 +++++++++++++------ 1 file changed, 56 insertions(+), 23 deletions(-) diff --git a/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp b/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp index 3fa07acb63..3251048cd8 100644 --- a/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp +++ b/isis/src/qisis/objs/AdvancedTrackTool/AdvancedTrackTool.cpp @@ -463,37 +463,70 @@ namespace Isis { } // Write out columns solar lon, slant distance, local solar time - double solarLon = cvp->camera()->solarLongitude().degrees(); - p_tableWin->table()->item(row, getIndex("Solar Longitude"))-> - setText(QString::number(solarLon)); + try { + double solarLon = cvp->camera()->solarLongitude().degrees(); + p_tableWin->table()->item(row, getIndex("Solar Longitude"))-> + setText(QString::number(solarLon)); + } + catch (IException &e) { + p_tableWin->table()->item(row, getIndex("Solar Longitude"))-> + setText(""); + } + double slantDistance = cvp->camera()->SlantDistance(); p_tableWin->table()->item(row, getIndex("Slant Distance"))-> setText(QString::number(slantDistance)); - double lst = cvp->camera()->LocalSolarTime(); - p_tableWin->table()->item(row, getIndex("Local Solar Time"))-> - setText(QString::number(lst)); + try { + double lst = cvp->camera()->LocalSolarTime(); + p_tableWin->table()->item(row, getIndex("Local Solar Time"))-> + setText(QString::number(lst)); + } + catch (IException &e) { + p_tableWin->table()->item(row, getIndex("Local Solar Time"))-> + setText(""); + } + } // end if set image succeeds // Always write out the x/y/z of the undistorted focal plane - CameraDistortionMap *distortedMap = cvp->camera()->DistortionMap(); - double undistortedFocalPlaneX = distortedMap->UndistortedFocalPlaneX(); - p_tableWin->table()->item(row, getIndex("Undistorted Focal X"))-> - setText(QString::number(undistortedFocalPlaneX)); - double undistortedFocalPlaneY = distortedMap->UndistortedFocalPlaneY(); - p_tableWin->table()->item(row, getIndex("Undistorted Focal Y"))-> - setText(QString::number(undistortedFocalPlaneY)); - double undistortedFocalPlaneZ = distortedMap->UndistortedFocalPlaneZ(); - p_tableWin->table()->item(row, getIndex("Undistorted Focal Z"))-> - setText(QString::number(undistortedFocalPlaneZ)); + if (cvp->camera()->DistortionMap() != NULL) { + CameraDistortionMap *distortedMap = cvp->camera()->DistortionMap(); + double undistortedFocalPlaneX = distortedMap->UndistortedFocalPlaneX(); + p_tableWin->table()->item(row, getIndex("Undistorted Focal X"))-> + setText(QString::number(undistortedFocalPlaneX)); + double undistortedFocalPlaneY = distortedMap->UndistortedFocalPlaneY(); + p_tableWin->table()->item(row, getIndex("Undistorted Focal Y"))-> + setText(QString::number(undistortedFocalPlaneY)); + double undistortedFocalPlaneZ = distortedMap->UndistortedFocalPlaneZ(); + p_tableWin->table()->item(row, getIndex("Undistorted Focal Z"))-> + setText(QString::number(undistortedFocalPlaneZ)); + } + else { + p_tableWin->table()->item(row, getIndex("Undistorted Focal X"))-> + setText(""); + p_tableWin->table()->item(row, getIndex("Undistorted Focal Y"))-> + setText(""); + p_tableWin->table()->item(row, getIndex("Undistorted Focal Z"))-> + setText(""); + } // Always write out the x/y of the distorted focal plane - CameraFocalPlaneMap *focalPlaneMap = cvp->camera()->FocalPlaneMap(); - double distortedFocalPlaneX = focalPlaneMap->FocalPlaneX(); - p_tableWin->table()->item(row, getIndex("Focal Plane X"))-> - setText(QString::number(distortedFocalPlaneX)); - double distortedFocalPlaneY = focalPlaneMap->FocalPlaneY(); - p_tableWin->table()->item(row, getIndex("Focal Plane Y"))-> - setText(QString::number(distortedFocalPlaneY)); + if (cvp->camera()->FocalPlaneMap() != NULL) { + CameraFocalPlaneMap *focalPlaneMap = cvp->camera()->FocalPlaneMap(); + double distortedFocalPlaneX = focalPlaneMap->FocalPlaneX(); + p_tableWin->table()->item(row, getIndex("Focal Plane X"))-> + setText(QString::number(distortedFocalPlaneX)); + double distortedFocalPlaneY = focalPlaneMap->FocalPlaneY(); + p_tableWin->table()->item(row, getIndex("Focal Plane Y"))-> + setText(QString::number(distortedFocalPlaneY)); + } + else { + p_tableWin->table()->item(row, getIndex("Focal Plane X"))-> + setText(""); + p_tableWin->table()->item(row, getIndex("Focal Plane Y"))-> + setText(""); + } + // Always write out columns ra/dec, regardless of whether set image succeeds double ra = cvp->camera()->RightAscension(); From 484242c87b7de7d3b9e4b3752d64966bbe75a046 Mon Sep 17 00:00:00 2001 From: acpaquette Date: Fri, 15 Sep 2023 17:30:21 -0700 Subject: [PATCH 2/2] Added Changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6954571097..fc72cd5ffa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ release. - Fixed findfeatures instantiation and use of projection classes to correctly return geometry data from projected images and mosaics. [#4772](https://github.com/DOI-USGS/ISIS3/issues/4772) - Fixed `cubeit` attribute error to allow attribute specification on the output cube filename [#5234](https://github.com/DOI-USGS/ISIS3/issues/5234) - Fixed `campt` to handle input band selection attribute correctly [#5234](https://github.com/DOI-USGS/ISIS3/issues/5235) +- Fixed exception pop ups in qview when viewing images created using the CSM Camera [#5259](https://github.com/DOI-USGS/ISIS3/pull/5295/files) ## [8.0.0] - 2023-04-19