Skip to content
Snippets Groups Projects
Commit b6ab3d8f authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by jlaura
Browse files

fixed nan issue (#153)

* fixed nan issue

* left in for loop
parent 0dc639af
No related branches found
No related tags found
No related merge requests found
...@@ -750,6 +750,7 @@ csm::EcefCoord UsgsAstroLsSensorModel::imageToGround( ...@@ -750,6 +750,7 @@ csm::EcefCoord UsgsAstroLsSensorModel::imageToGround(
"Desired precision not achieved.", "Desired precision not achieved.",
"UsgsAstroLsSensorModel::imageToGround()")); "UsgsAstroLsSensorModel::imageToGround()"));
} }
return csm::EcefCoord(x, y, z); return csm::EcefCoord(x, y, z);
} }
...@@ -1686,7 +1687,6 @@ void UsgsAstroLsSensorModel::losToEcf( ...@@ -1686,7 +1687,6 @@ void UsgsAstroLsSensorModel::losToEcf(
getAdjSensorPosVel(time, adj, xc, yc, zc, vx, vy, vz); getAdjSensorPosVel(time, adj, xc, yc, zc, vx, vy, vz);
// CSM image image convention: UL pixel center == (0.5, 0.5) // CSM image image convention: UL pixel center == (0.5, 0.5)
// USGS image convention: UL pixel center == (1.0, 1.0) // USGS image convention: UL pixel center == (1.0, 1.0)
double sampleCSMFull = sample + m_offsetSamples; double sampleCSMFull = sample + m_offsetSamples;
double sampleUSGSFull = sampleCSMFull + 0.5; double sampleUSGSFull = sampleCSMFull + 0.5;
double fractionalLine = line - floor(line) - 0.5; double fractionalLine = line - floor(line) - 0.5;
...@@ -1796,6 +1796,7 @@ void UsgsAstroLsSensorModel::losToEcf( ...@@ -1796,6 +1796,7 @@ void UsgsAstroLsSensorModel::losToEcf(
plFromApl[6] = -sin_b; plFromApl[6] = -sin_b;
plFromApl[7] = sin_a * cos_b; plFromApl[7] = sin_a * cos_b;
plFromApl[8] = cos_a * cos_b; plFromApl[8] = cos_a * cos_b;
double losPl[3]; double losPl[3];
losPl[0] = plFromApl[0] * losApl[0] + plFromApl[1] * losApl[1] losPl[0] = plFromApl[0] * losApl[0] + plFromApl[1] * losApl[1]
+ plFromApl[2] * losApl[2]; + plFromApl[2] * losApl[2];
...@@ -1831,6 +1832,8 @@ void UsgsAstroLsSensorModel::losToEcf( ...@@ -1831,6 +1832,8 @@ void UsgsAstroLsSensorModel::losToEcf(
ecfFromPl[6] = 2 * (q[0] * q[2] - q[1] * q[3]); ecfFromPl[6] = 2 * (q[0] * q[2] - q[1] * q[3]);
ecfFromPl[7] = 2 * (q[1] * q[2] + q[0] * q[3]); ecfFromPl[7] = 2 * (q[1] * q[2] + q[0] * q[3]);
ecfFromPl[8] = -q[0] * q[0] - q[1] * q[1] + q[2] * q[2] + q[3] * q[3]; ecfFromPl[8] = -q[0] * q[0] - q[1] * q[1] + q[2] * q[2] + q[3] * q[3];
xl = ecfFromPl[0] * losPl[0] + ecfFromPl[1] * losPl[1] xl = ecfFromPl[0] * losPl[0] + ecfFromPl[1] * losPl[1]
+ ecfFromPl[2] * losPl[2]; + ecfFromPl[2] * losPl[2];
yl = ecfFromPl[3] * losPl[0] + ecfFromPl[4] * losPl[1] yl = ecfFromPl[3] * losPl[0] + ecfFromPl[4] * losPl[1]
...@@ -2329,7 +2332,6 @@ void UsgsAstroLsSensorModel::getAdjSensorPosVel( ...@@ -2329,7 +2332,6 @@ void UsgsAstroLsSensorModel::getAdjSensorPosVel(
ecfFromIcr[6] = inTrackUnitVec[2]; ecfFromIcr[6] = inTrackUnitVec[2];
ecfFromIcr[7] = crossTrackUnitVec[2]; ecfFromIcr[7] = crossTrackUnitVec[2];
ecfFromIcr[8] = radialUnitVec[2]; ecfFromIcr[8] = radialUnitVec[2];
// Apply position and velocity corrections // Apply position and velocity corrections
double aTime = time - m_t0Ephem; double aTime = time - m_t0Ephem;
...@@ -2772,12 +2774,11 @@ std::string UsgsAstroLsSensorModel::constructStateFromIsd(const std::string imag ...@@ -2772,12 +2774,11 @@ std::string UsgsAstroLsSensorModel::constructStateFromIsd(const std::string imag
// Zero computed state values // Zero computed state values
state["m_referencePointXyz"] = std::vector<double>(3, 0.0); state["m_referencePointXyz"] = std::vector<double>(3, 0.0);
state["m_gsd"] = 0.0; state["m_gsd"] = 1.0;
state["m_flyingHeight"] = 0.0; state["m_flyingHeight"] = 1000.0;
state["m_halfSwath"] = 0.0; state["m_halfSwath"] = 1000.0;
state["m_halfTime"] = 0.0; state["m_halfTime"] = 10.0;
state["m_imageFlipFlag"] = 0; state["m_imageFlipFlag"] = 0;
// The state data will still be updated when a sensor model is created since // The state data will still be updated when a sensor model is created since
// some state data is notin the ISD and requires a SM to compute them. // some state data is notin the ISD and requires a SM to compute them.
return state.dump(); return state.dump();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment