Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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*
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment