Skip to content
Snippets Groups Projects
Commit 4a7fed9e authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Added fall back for ground partials

parent 2b67411d
No related branches found
No related tags found
No related merge requests found
...@@ -568,6 +568,15 @@ std::vector<double> UsgsAstroFrameSensorModel::computeGroundPartials(const csm:: ...@@ -568,6 +568,15 @@ std::vector<double> UsgsAstroFrameSensorModel::computeGroundPartials(const csm::
double dz = nextPoint.z - z; double dz = nextPoint.z - z;
double pixelGroundSize = sqrt((dx*dx + dy*dy + dz*dz) / 2.0); double pixelGroundSize = sqrt((dx*dx + dy*dy + dz*dz) / 2.0);
// If the ground size is too small, try the opposite direction
if (pixelGroundSize < 1e-10) {
nextPoint = imageToGround(csm::ImageCoord(ipB.line - 1, ipB.samp - 1));
dx = nextPoint.x - x;
dy = nextPoint.y - y;
dz = nextPoint.z - z;
pixelGroundSize = sqrt((dx*dx + dy*dy + dz*dz) / 2.0);
}
csm::ImageCoord ipX = groundToImage(csm::EcefCoord(x + pixelGroundSize, y, z)); csm::ImageCoord ipX = groundToImage(csm::EcefCoord(x + pixelGroundSize, y, z));
csm::ImageCoord ipY = groundToImage(csm::EcefCoord(x, y + pixelGroundSize, z)); csm::ImageCoord ipY = groundToImage(csm::EcefCoord(x, y + pixelGroundSize, z));
csm::ImageCoord ipZ = groundToImage(csm::EcefCoord(x, y, z + pixelGroundSize)); csm::ImageCoord ipZ = groundToImage(csm::EcefCoord(x, y, z + pixelGroundSize));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment