Commit fcd6b7ad authored by Jesse Mapel's avatar Jesse Mapel
Browse files

PROG: Fixed CaSSIS Distortion Map.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@8147 41f8697f-d340-4b68-9986-7bafba869bb8
parent c704198a
Loading
Loading
Loading
Loading
+12 −14
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@ namespace Isis {
      m_A2_dist.push_back(p_camera->getDouble(od + "A2_DIST", i));
      m_A3_dist.push_back(p_camera->getDouble(od + "A3_DIST", i));
    }

    m_pixelPitch = p_camera->getDouble("INS" + toString(naifIkCode) + "_PIXEL_PITCH");
    m_width  = p_camera->getDouble("INS" + toString(naifIkCode) + "_FILTER_SAMPLES");
    m_height = p_camera->getDouble("INS" + toString(naifIkCode) + "_FILTER_LINES");
  }


@@ -110,14 +114,11 @@ namespace Isis {
    // 
    // So, whenever x or y are too far from center or divider is near zero,
    // return the given inputs
    double pixelPitch = p_camera->getDouble("INS" + toString(naifIkCode) + "PIXEL_PITCH");
    double width  = p_camera->getDouble("INS" + toString(naifIkCode) + "FILTER_SAMPLES");
    double height = p_camera->getDouble("INS" + toString(naifIkCode) + "FILTER_LINES");
    if ( qFuzzyCompare(divider + 1.0,  1.0) == 0
         || dx < -0.5*pixelSize*width  - 0.2
         || dx >  0.5*pixelSize*width  + 0.2
         || dy < -0.5*pixelSize*height - 0.5
         || dy >  0.5*pixelSize*height + 0.2 ) {
         || dx < -0.5*m_pixelPitch*m_width  - 0.2
         || dx >  0.5*m_pixelPitch*m_width  + 0.2
         || dy < -0.5*m_pixelPitch*m_height - 0.2
         || dy >  0.5*m_pixelPitch*m_height + 0.2 ) {
      p_undistortedFocalPlaneX = dx;
      p_undistortedFocalPlaneY = dy;
      return true;
@@ -178,14 +179,11 @@ namespace Isis {
    // 
    // So, whenever x or y are too far from center or divider is near zero,
    // return the given inputs
    double pixelPitch = p_camera->getDouble("INS" + toString(naifIkCode) + "PIXEL_PITCH");
    double width  = p_camera->getDouble("INS" + toString(naifIkCode) + "FILTER_SAMPLES");
    double height = p_camera->getDouble("INS" + toString(naifIkCode) + "FILTER_LINES");
    if ( qFuzzyCompare(divider + 1.0,  1.0) == 0
         || ux < -0.5*pixelSize*width  - 0.2
         || ux >  0.5*pixelSize*width  + 0.2
         || uy < -0.5*pixelSize*height - 0.5
         || uy >  0.5*pixelSize*height + 0.2 ) {
         || ux < -0.5*m_pixelPitch*m_width  - 0.2
         || ux >  0.5*m_pixelPitch*m_width  + 0.2
         || uy < -0.5*m_pixelPitch*m_height - 0.2
         || uy >  0.5*m_pixelPitch*m_height + 0.2 ) {
      p_focalPlaneX = ux;
      p_focalPlaneY = uy;
      return true;
+6 −0
Original line number Diff line number Diff line
@@ -78,6 +78,12 @@ namespace Isis {
                                    distorted y from ideal y. */
      QList<double> m_A3_dist; /**< Coefficients for rational distortion model used to find scaling
                                    factor used when computing distorted coordinates from ideal. */
      double m_pixelPitch; /**< The pixel pitch of the camera. Used to check if far off the ccd
                                prior to correcting or applying distortion. */
      double m_width; /**< The width of the ccd in pixels. Used to check if far off the ccd prior
                           to correcting or applying distortion. */
      double m_height; /**< The height of the ccd in pixels. Used to check if far off the ccd prior
                            to correcting or applying distortion. */
  };
};
#endif
+2 −2
Original line number Diff line number Diff line
@@ -45,8 +45,8 @@ int main(void) {
    // These should be lat/lon at center of image. To obtain these numbers for a new cube/camera,
    // set both the known lat and known lon to zero and copy the unit test output
    // "Latitude off by: " and "Longitude off by: " values directly into these variables.
    double knownLat = 4.14693704119268247;
    double knownLon = 322.758190354645023;
    double knownLat = 4.14700320539339717;
    double knownLon = 322.7582512383878;

    Cube c("$tgo/testData/CAS-MCO-2016-11-22T16.38.39.354-NIR-02036-00.cub", "r");
    TgoCassisCamera *cam = (TgoCassisCamera *) CameraFactory::Create(c);