From 2ddaf54834b7f1d56725e1835b1e10dfa5750967 Mon Sep 17 00:00:00 2001 From: Kristin <kberry@usgs.gov> Date: Tue, 12 Feb 2019 08:52:07 -0700 Subject: [PATCH] Reformat member variables in header and switch more to use const pass-by-reference parameters to be consistent with rest of code --- include/usgscsm/UsgsAstroLsSensorModel.h | 38 +++++++++++++++++------- src/UsgsAstroLsSensorModel.cpp | 8 ++--- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/include/usgscsm/UsgsAstroLsSensorModel.h b/include/usgscsm/UsgsAstroLsSensorModel.h index 7888c9f..6c16fff 100644 --- a/include/usgscsm/UsgsAstroLsSensorModel.h +++ b/include/usgscsm/UsgsAstroLsSensorModel.h @@ -918,18 +918,36 @@ private: // methods pulled out of los2ecf -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; - -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; + 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; + + void calculateRotationMatrixFromQuaternions( + const double& time, + const bool& invert, + double cameraToBody[9]) const; + + void createCameraLookVector( + const double& undistortedFocalPlaneX, + const double& undistortedFocalPlaneY, + const std::vector<double>& adj, + double cameraLook[]) const; + + void calculateAttitudeCorrection( + const double& time, + const std::vector<double>& adj, + double attCorr[9]) const; // This method computes the imaging locus. +// imaging locus : set of ground points associated with an image pixel. void losToEcf( const double& line, // CSM image convention const double& sample, // UL pixel center == (0.5, 0.5) diff --git a/src/UsgsAstroLsSensorModel.cpp b/src/UsgsAstroLsSensorModel.cpp index 3fa9b75..3644b36 100644 --- a/src/UsgsAstroLsSensorModel.cpp +++ b/src/UsgsAstroLsSensorModel.cpp @@ -1658,7 +1658,7 @@ double UsgsAstroLsSensorModel::getValue( // ************************************************************************** // Compute distorted focalPlane coordinates in mm -void UsgsAstroLsSensorModel::computeDistortedFocalPlaneCoordinates(const double& lineUSGS, const double& sampleUSGS, double &distortedLine, double& distortedSample) const{ +void UsgsAstroLsSensorModel::computeDistortedFocalPlaneCoordinates(const double& lineUSGS, const double& sampleUSGS, double& distortedLine, double& distortedSample) const{ double isisDetSample = (sampleUSGS - 1.0) * m_detectorSampleSumming + m_startingSample; double m11 = m_iTransL[1]; @@ -1701,7 +1701,7 @@ void UsgsAstroLsSensorModel::computeUndistortedFocalPlaneCoordinates(const doubl // Define imaging ray in image space (In other words, create a look vector in camera space) -void UsgsAstroLsSensorModel::createCameraLookVector(double& undistortedFocalPlaneX, double& undistortedFocalPlaneY, const std::vector<double>& adj, double losIsis[]) const{ +void UsgsAstroLsSensorModel::createCameraLookVector(const double& undistortedFocalPlaneX, const double& undistortedFocalPlaneY, const std::vector<double>& adj, double losIsis[]) const{ losIsis[0] = -undistortedFocalPlaneX * m_isisZDirection; losIsis[1] = -undistortedFocalPlaneY * m_isisZDirection; losIsis[2] = -m_focal * (1.0 - getValue(15, adj) / m_halfSwath); @@ -1716,7 +1716,7 @@ void UsgsAstroLsSensorModel::createCameraLookVector(double& undistortedFocalPlan // Given a time and a flag to indicate whether the a->b or b->a rotation should be calculated // uses the quaternions in the m_quaternions member to calclate a rotation matrix. -void UsgsAstroLsSensorModel::calculateRotationMatrixFromQuaternions(double time, bool invert, double rotationMatrix[9]) const { +void UsgsAstroLsSensorModel::calculateRotationMatrixFromQuaternions(const double& time, const bool& invert, double rotationMatrix[9]) const { int nOrder = 8; if (m_platformFlag == 0) nOrder = 4; @@ -1754,7 +1754,7 @@ void UsgsAstroLsSensorModel::calculateRotationMatrixFromQuaternions(double time, }; -void UsgsAstroLsSensorModel::calculateAttitudeCorrection(double time, const std::vector<double>& adj, double attCorr[9]) const { +void UsgsAstroLsSensorModel::calculateAttitudeCorrection(const double& time, const std::vector<double>& adj, double attCorr[9]) const { double aTime = time - m_t0Quat; double euler[3]; double nTime = aTime / m_halfTime; -- GitLab