Unverified Commit a2224d3b authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

CSM Camera Qview Try Catches (#5295)

* Fix errors when using CSM camera in qview

* Added Changelog entry
parent 1a9b9cdc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ release.
- 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 target name translation for any dawn images with target "4 CERES" [#5294](https://github.com/DOI-USGS/ISIS3/pull/5294)
- 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

+56 −23
Original line number Diff line number Diff line
@@ -463,18 +463,33 @@ namespace Isis {
        }

        // Write out columns solar lon, slant distance, local solar time
        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));
        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
      if (cvp->camera()->DistortionMap() != NULL) {
        CameraDistortionMap *distortedMap = cvp->camera()->DistortionMap();
        double undistortedFocalPlaneX = distortedMap->UndistortedFocalPlaneX();
        p_tableWin->table()->item(row, getIndex("Undistorted Focal X"))->
@@ -485,8 +500,18 @@ namespace Isis {
        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
      if (cvp->camera()->FocalPlaneMap() != NULL) {
        CameraFocalPlaneMap *focalPlaneMap = cvp->camera()->FocalPlaneMap();
        double distortedFocalPlaneX = focalPlaneMap->FocalPlaneX();
        p_tableWin->table()->item(row, getIndex("Focal Plane X"))->
@@ -494,6 +519,14 @@ namespace Isis {
        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();