Loading include/usgscsm/UsgsAstroLsSensorModel.h +1068 −1071 Original line number Diff line number Diff line Loading @@ -918,8 +918,6 @@ private: // methods pulled out of los2ecf void convertToUSGSCoordinates(const double& csmLine, const double& csmSample, double &usgsLine, double &usgsSample) const; void computeDistortedFocalPlaneCoordinates(const double& lineUSGS, const double& sampleUSGS, double &distortedLine, double& distortedSample) const; void computeUndistortedFocalPlaneCoordinates(const double &isisNatFocalPlaneX, const double& isisNatFocalPlaneY, double& isisFocalPlaneX, double& isisFocalPlaneY) const; Loading @@ -927,7 +925,6 @@ void computeUndistortedFocalPlaneCoordinates(const double &isisNatFocalPlaneX, c void calculateRotationMatrixFromQuaternions(double time, bool invert, double cameraToBody[9]) const; // This method computes the imaging locus. // imaging locus : set of ground points associated with an image pixel. void createCameraLookVector(double& undistortedFocalPlaneX, double& undistortedFocalPlaneY,const std::vector<double>& adj, double losIsis[]) const; void calculateAttitudeCorrection(double time, const std::vector<double>& adj, double attCorr[9]) const; Loading @@ -943,9 +940,9 @@ void calculateAttitudeCorrection(double time, const std::vector<double>& adj, do double& vx, // output sensor x velocity double& vy, // output sensor y velocity double& vz, // output sensor z cvelocity double& xl, // output line-of-sight x coordinate double& yl, // output line-of-sight y coordinate double& zl ) const; double& bodyFixedX, // output line-of-sight x coordinate double& bodyFixedY, // output line-of-sight y coordinate double& bodyFixedZ ) const; // Computes the LOS correction due to light aberration void lightAberrationCorr( Loading src/UsgsAstroLsSensorModel.cpp +21 −35 Original line number Diff line number Diff line Loading @@ -1657,20 +1657,6 @@ double UsgsAstroLsSensorModel::getValue( // Functions pulled out of losToEcf // ************************************************************************** // CSM image image convention: UL pixel center == (0.5, 0.5) // USGS image convention: UL pixel center == (1.0, 1.0) void UsgsAstroLsSensorModel::convertToUSGSCoordinates(const double& csmLine, const double& csmSample, double &usgsLine, double &usgsSample) const{ // apply the offset double sampleCSMFull = csmSample + m_offsetSamples; double sampleUSGSFull = sampleCSMFull + 0.5; // why don't we apply a line offset? double fractionalLine = csmLine - floor(csmLine) - 0.5; usgsSample = sampleUSGSFull; usgsLine = fractionalLine; } // Compute distorted focalPlane coordinates in mm void UsgsAstroLsSensorModel::computeDistortedFocalPlaneCoordinates(const double& lineUSGS, const double& sampleUSGS, double &distortedLine, double& distortedSample) const{ double isisDetSample = (sampleUSGS - 1.0) Loading Loading @@ -1836,37 +1822,37 @@ void UsgsAstroLsSensorModel::losToEcf( computeUndistortedFocalPlaneCoordinates(isisNatFocalPlaneX, isisNatFocalPlaneY, isisFocalPlaneX, isisFocalPlaneY); // Define imaging ray (look vector) in camera space double losIsis[3]; createCameraLookVector(isisFocalPlaneX, isisFocalPlaneY, adj, losIsis); double cameraLook[3]; createCameraLookVector(isisFocalPlaneX, isisFocalPlaneY, adj, cameraLook); // Apply attitude correction double attCorr[9]; calculateAttitudeCorrection(time, adj, attCorr); double cameraLook[3]; cameraLook[0] = attCorr[0] * losIsis[0] + attCorr[1] * losIsis[1] + attCorr[2] * losIsis[2]; cameraLook[1] = attCorr[3] * losIsis[0] + attCorr[4] * losIsis[1] + attCorr[5] * losIsis[2]; cameraLook[2] = attCorr[6] * losIsis[0] + attCorr[7] * losIsis[1] + attCorr[8] * losIsis[2]; double correctedCameraLook[3]; correctedCameraLook[0] = attCorr[0] * cameraLook[0] + attCorr[1] * cameraLook[1] + attCorr[2] * cameraLook[2]; correctedCameraLook[1] = attCorr[3] * cameraLook[0] + attCorr[4] * cameraLook[1] + attCorr[5] * cameraLook[2]; correctedCameraLook[2] = attCorr[6] * cameraLook[0] + attCorr[7] * cameraLook[1] + attCorr[8] * cameraLook[2]; // Rotate the look vector into the body fixed frame from the camera reference frame by applying the rotation matrix from the sensor quaternions double cameraToBody[9]; calculateRotationMatrixFromQuaternions(time, false, cameraToBody); bodyLookX = cameraToBody[0] * cameraLook[0] + cameraToBody[1] * cameraLook[1] + cameraToBody[2] * cameraLook[2]; bodyLookY = cameraToBody[3] * cameraLook[0] + cameraToBody[4] * cameraLook[1] + cameraToBody[5] * cameraLook[2]; bodyLookZ = cameraToBody[6] * cameraLook[0] + cameraToBody[7] * cameraLook[1] + cameraToBody[8] * cameraLook[2]; bodyLookX = cameraToBody[0] * correctedCameraLook[0] + cameraToBody[1] * correctedCameraLook[1] + cameraToBody[2] * correctedCameraLook[2]; bodyLookY = cameraToBody[3] * correctedCameraLook[0] + cameraToBody[4] * correctedCameraLook[1] + cameraToBody[5] * correctedCameraLook[2]; bodyLookZ = cameraToBody[6] * correctedCameraLook[0] + cameraToBody[7] * correctedCameraLook[1] + cameraToBody[8] * correctedCameraLook[2]; } Loading Loading
include/usgscsm/UsgsAstroLsSensorModel.h +1068 −1071 Original line number Diff line number Diff line Loading @@ -918,8 +918,6 @@ private: // methods pulled out of los2ecf void convertToUSGSCoordinates(const double& csmLine, const double& csmSample, double &usgsLine, double &usgsSample) const; void computeDistortedFocalPlaneCoordinates(const double& lineUSGS, const double& sampleUSGS, double &distortedLine, double& distortedSample) const; void computeUndistortedFocalPlaneCoordinates(const double &isisNatFocalPlaneX, const double& isisNatFocalPlaneY, double& isisFocalPlaneX, double& isisFocalPlaneY) const; Loading @@ -927,7 +925,6 @@ void computeUndistortedFocalPlaneCoordinates(const double &isisNatFocalPlaneX, c void calculateRotationMatrixFromQuaternions(double time, bool invert, double cameraToBody[9]) const; // This method computes the imaging locus. // imaging locus : set of ground points associated with an image pixel. void createCameraLookVector(double& undistortedFocalPlaneX, double& undistortedFocalPlaneY,const std::vector<double>& adj, double losIsis[]) const; void calculateAttitudeCorrection(double time, const std::vector<double>& adj, double attCorr[9]) const; Loading @@ -943,9 +940,9 @@ void calculateAttitudeCorrection(double time, const std::vector<double>& adj, do double& vx, // output sensor x velocity double& vy, // output sensor y velocity double& vz, // output sensor z cvelocity double& xl, // output line-of-sight x coordinate double& yl, // output line-of-sight y coordinate double& zl ) const; double& bodyFixedX, // output line-of-sight x coordinate double& bodyFixedY, // output line-of-sight y coordinate double& bodyFixedZ ) const; // Computes the LOS correction due to light aberration void lightAberrationCorr( Loading
src/UsgsAstroLsSensorModel.cpp +21 −35 Original line number Diff line number Diff line Loading @@ -1657,20 +1657,6 @@ double UsgsAstroLsSensorModel::getValue( // Functions pulled out of losToEcf // ************************************************************************** // CSM image image convention: UL pixel center == (0.5, 0.5) // USGS image convention: UL pixel center == (1.0, 1.0) void UsgsAstroLsSensorModel::convertToUSGSCoordinates(const double& csmLine, const double& csmSample, double &usgsLine, double &usgsSample) const{ // apply the offset double sampleCSMFull = csmSample + m_offsetSamples; double sampleUSGSFull = sampleCSMFull + 0.5; // why don't we apply a line offset? double fractionalLine = csmLine - floor(csmLine) - 0.5; usgsSample = sampleUSGSFull; usgsLine = fractionalLine; } // Compute distorted focalPlane coordinates in mm void UsgsAstroLsSensorModel::computeDistortedFocalPlaneCoordinates(const double& lineUSGS, const double& sampleUSGS, double &distortedLine, double& distortedSample) const{ double isisDetSample = (sampleUSGS - 1.0) Loading Loading @@ -1836,37 +1822,37 @@ void UsgsAstroLsSensorModel::losToEcf( computeUndistortedFocalPlaneCoordinates(isisNatFocalPlaneX, isisNatFocalPlaneY, isisFocalPlaneX, isisFocalPlaneY); // Define imaging ray (look vector) in camera space double losIsis[3]; createCameraLookVector(isisFocalPlaneX, isisFocalPlaneY, adj, losIsis); double cameraLook[3]; createCameraLookVector(isisFocalPlaneX, isisFocalPlaneY, adj, cameraLook); // Apply attitude correction double attCorr[9]; calculateAttitudeCorrection(time, adj, attCorr); double cameraLook[3]; cameraLook[0] = attCorr[0] * losIsis[0] + attCorr[1] * losIsis[1] + attCorr[2] * losIsis[2]; cameraLook[1] = attCorr[3] * losIsis[0] + attCorr[4] * losIsis[1] + attCorr[5] * losIsis[2]; cameraLook[2] = attCorr[6] * losIsis[0] + attCorr[7] * losIsis[1] + attCorr[8] * losIsis[2]; double correctedCameraLook[3]; correctedCameraLook[0] = attCorr[0] * cameraLook[0] + attCorr[1] * cameraLook[1] + attCorr[2] * cameraLook[2]; correctedCameraLook[1] = attCorr[3] * cameraLook[0] + attCorr[4] * cameraLook[1] + attCorr[5] * cameraLook[2]; correctedCameraLook[2] = attCorr[6] * cameraLook[0] + attCorr[7] * cameraLook[1] + attCorr[8] * cameraLook[2]; // Rotate the look vector into the body fixed frame from the camera reference frame by applying the rotation matrix from the sensor quaternions double cameraToBody[9]; calculateRotationMatrixFromQuaternions(time, false, cameraToBody); bodyLookX = cameraToBody[0] * cameraLook[0] + cameraToBody[1] * cameraLook[1] + cameraToBody[2] * cameraLook[2]; bodyLookY = cameraToBody[3] * cameraLook[0] + cameraToBody[4] * cameraLook[1] + cameraToBody[5] * cameraLook[2]; bodyLookZ = cameraToBody[6] * cameraLook[0] + cameraToBody[7] * cameraLook[1] + cameraToBody[8] * cameraLook[2]; bodyLookX = cameraToBody[0] * correctedCameraLook[0] + cameraToBody[1] * correctedCameraLook[1] + cameraToBody[2] * correctedCameraLook[2]; bodyLookY = cameraToBody[3] * correctedCameraLook[0] + cameraToBody[4] * correctedCameraLook[1] + cameraToBody[5] * correctedCameraLook[2]; bodyLookZ = cameraToBody[6] * correctedCameraLook[0] + cameraToBody[7] * correctedCameraLook[1] + cameraToBody[8] * correctedCameraLook[2]; } Loading