Unverified Commit 88eb5896 authored by Austin Sanders's avatar Austin Sanders Committed by GitHub
Browse files

Cahvor fix (#490)

* Removed tolerance check from optical shift addition

* Updated changelog
parent b861a956
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -35,6 +35,9 @@ release.

## [Unreleased]

### Fixed
- Fixed CAHVOR model optical shifts by removing tolerance check [#488](https://github.com/DOI-USGS/usgscsm/issues/488)

## [2.0.1] - 2024-01-23

### Changed
+45 −51
Original line number Diff line number Diff line
@@ -328,8 +328,6 @@ void removeDistortion(double dx, double dy, double &ux, double &uy,
      double shiftedDy = dy - opticalDistCoeffs[4];
      double rr = shiftedDx * shiftedDx + shiftedDy * shiftedDy;

      if (rr > tolerance)
      {
      double dr = opticalDistCoeffs[0] +
                  (rr * (opticalDistCoeffs[1] + rr * opticalDistCoeffs[2]));

@@ -338,7 +336,6 @@ void removeDistortion(double dx, double dy, double &ux, double &uy,
      ux += opticalDistCoeffs[3];
      uy += opticalDistCoeffs[4];
    }
    }
    break;
    
    // Compute undistorted focal plane coordinate given distorted coordinates
@@ -587,9 +584,6 @@ void applyDistortion(double ux, double uy, double &dx, double &dy,
      double shiftedUx = ux - opticalDistCoeffs[3];
      double shiftedUy = uy - opticalDistCoeffs[4];
      double rp2 = (ux * ux) + (uy * uy);

      if (rp2 > tolerance)
      {
      double rp = sqrt(rp2);
      // Compute first fractional distortion using rp
      double drOverR =
@@ -631,7 +625,7 @@ void applyDistortion(double ux, double uy, double &dx, double &dy,
      dy = shiftedUy / (1.0 - drOverR);
      dx += opticalDistCoeffs[3];
      dy += opticalDistCoeffs[4];
      }
    
    }
    break;