Commit 39a128bc authored by Jesse Mapel's avatar Jesse Mapel Committed by jlaura
Browse files

Added a check for impossible samples in ground to image (#113)

* Modified git ignore to ignore all iPython nb checkpoints

* Added a check in ls ground to image for samples outside the ccd.
parent 29105988
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4,12 +4,12 @@ lib/*
include/csm/*

# iPython checkpoint items
.ipynb_checkpoints/*
.ipynb_checkpoints

# Ignore any executables
bin/*

# Ignore any Max stuff
# Ignore any Mac stuff
.DS_Store

*.cpython*
+9 −0
Original line number Diff line number Diff line
@@ -299,6 +299,15 @@ csm::ImageCoord UsgsAstroLsSensorModel::groundToImage(
   double dz = ground_pt.z - calculatedPoint.z;
   double len = dx * dx + dy * dy + dz * dz;

   // Check that the pixel is actually in the image
   if ((calculatedPixel.samp < 0) ||
       (calculatedPixel.samp > _data.m_TotalSamples)) {
      throw csm::Error(
         csm::Error::ALGORITHM,
         "Ground point is not viewed by the image.",
         "UsgsAstroLsSensorModel::groundToImage");
   }

   // If the final correction is greater than 10 meters,
   // the solution is not valid enough to report even with a warning
   printf("%f\n", len);