Loading src/UsgsAstroFramePlugin.cpp +11 −14 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ const std::string UsgsAstroFramePlugin::_PLUGIN_NAME = "UsgsAstroFramePluginCSM" const std::string UsgsAstroFramePlugin::_MANUFACTURER_NAME = "UsgsAstrogeology"; const std::string UsgsAstroFramePlugin::_RELEASE_DATE = "20170425"; const int UsgsAstroFramePlugin::_N_SENSOR_MODELS = 1; const int UsgsAstroFramePlugin::_NUM_ISD_KEYWORDS = 36; const std::string UsgsAstroFramePlugin::_ISD_KEYWORD[] = { Loading Loading @@ -278,19 +277,17 @@ csm::Isd UsgsAstroFramePlugin::loadImageSupportData(const csm::Isd &imageSupport try { std::ifstream isdFile(isdFilename); std::cout << "ever" << std::endl; json jsonIsd = json::parse(isdFile); for (json::iterator it = jsonIsd.begin(); it != jsonIsd.end(); ++it) { if (it.value().size() >1 ) { std::vector<double> v = it.value(); for (int j=0;j < v.size(); j++) { std::ostringstream val; val << std::setprecision(15) << v[j]; imageSupportData.addParam(it.key(),val.str()); json jsonValue = it.value(); if (jsonValue.is_array()) { for (int i = 0; i < jsonValue.size(); i++) { imageSupportData.addParam(it.key(), jsonValue[i].dump()); } } else { imageSupportData.addParam(it.key(), it.value().dump()); imageSupportData.addParam(it.key(), jsonValue.dump()); } } isdFile.close(); Loading tests/Fixtures.h +4 −4 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class FrameSensorModel : public ::testing::Test { void SetUp() override { sensorModel = NULL; isd.setFilename("/home/kberry/csm/CSM-CameraModel/tests/data/simpleFramerISD.img"); isd.setFilename("data/simpleFramerISD.img"); UsgsAstroFramePlugin frameCameraPlugin; csm::Model *model = frameCameraPlugin.constructModelFromISD( isd, Loading @@ -59,7 +59,7 @@ class SimpleFrameIsdTest : public ::testing::Test { csm::Isd isd; virtual void SetUp() { isd.setFilename("/home/kberry/csm/CSM-CameraModel/tests/data/simpleFramerISD.img"); isd.setFilename("data/simpleFramerISD.img"); } }; Loading Loading @@ -91,7 +91,7 @@ protected: virtual void SetUp() { isd.setFilename("/home/kberry/csm/CSM-CameraModel/tests/data/simpleFramerISD.img"); isd.setFilename("data/simpleFramerISD.img"); }; }; Loading @@ -116,7 +116,7 @@ class FrameIsdTest : public ::testing::Test { } virtual void SetUp() { isd.setFilename("/home/kberry/csm/CSM-CameraModel/tests/data/simpleFramerISD.img"); isd.setFilename("data/simpleFramerISD.img"); } }; Loading tests/FrameCameraTests.cpp +10 −3 Original line number Diff line number Diff line Loading @@ -337,7 +337,6 @@ TEST_F(FrameIsdTest, X10_SlightlyOffCenter) { sensorModel = NULL; } TEST_F(FrameIsdTest, X1e9_SlightlyOffCenter) { double newValue = 1000000000.0; Loading @@ -360,7 +359,11 @@ TEST_F(FrameIsdTest, X1e9_SlightlyOffCenter) { // Angle rotations: TEST_F(FrameIsdTest, Rotation_omegaPi_Center) { UsgsAstroFrameSensorModel* sensorModel = createModel(isd); sensorModel->setParameterValue(3, M_PI); // omega sensorModel->setParameterValue(3, 0); sensorModel->setParameterValue(4, 0); sensorModel->setParameterValue(5, 1); sensorModel->setParameterValue(6, 0); ASSERT_NE(sensorModel, nullptr); csm::ImageCoord imagePt(7.5, 7.5); Loading @@ -376,7 +379,11 @@ TEST_F(FrameIsdTest, Rotation_omegaPi_Center) { TEST_F(FrameIsdTest, Rotation_NPole_Center) { UsgsAstroFrameSensorModel* sensorModel = createModel(isd); sensorModel->setParameterValue(4, -M_PI); // phi sensorModel->setParameterValue(3, 0); sensorModel->setParameterValue(4, -1); sensorModel->setParameterValue(5, 0); sensorModel->setParameterValue(6, 0); sensorModel->setParameterValue(0, 0.0); // X sensorModel->setParameterValue(1, 0.0); // Y sensorModel->setParameterValue(2, 1000.0); // Z Loading tests/data/simpleFramerISD.json +1 −0 Original line number Diff line number Diff line Loading @@ -56,3 +56,4 @@ "z": 0 } } Loading
src/UsgsAstroFramePlugin.cpp +11 −14 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ const std::string UsgsAstroFramePlugin::_PLUGIN_NAME = "UsgsAstroFramePluginCSM" const std::string UsgsAstroFramePlugin::_MANUFACTURER_NAME = "UsgsAstrogeology"; const std::string UsgsAstroFramePlugin::_RELEASE_DATE = "20170425"; const int UsgsAstroFramePlugin::_N_SENSOR_MODELS = 1; const int UsgsAstroFramePlugin::_NUM_ISD_KEYWORDS = 36; const std::string UsgsAstroFramePlugin::_ISD_KEYWORD[] = { Loading Loading @@ -278,19 +277,17 @@ csm::Isd UsgsAstroFramePlugin::loadImageSupportData(const csm::Isd &imageSupport try { std::ifstream isdFile(isdFilename); std::cout << "ever" << std::endl; json jsonIsd = json::parse(isdFile); for (json::iterator it = jsonIsd.begin(); it != jsonIsd.end(); ++it) { if (it.value().size() >1 ) { std::vector<double> v = it.value(); for (int j=0;j < v.size(); j++) { std::ostringstream val; val << std::setprecision(15) << v[j]; imageSupportData.addParam(it.key(),val.str()); json jsonValue = it.value(); if (jsonValue.is_array()) { for (int i = 0; i < jsonValue.size(); i++) { imageSupportData.addParam(it.key(), jsonValue[i].dump()); } } else { imageSupportData.addParam(it.key(), it.value().dump()); imageSupportData.addParam(it.key(), jsonValue.dump()); } } isdFile.close(); Loading
tests/Fixtures.h +4 −4 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class FrameSensorModel : public ::testing::Test { void SetUp() override { sensorModel = NULL; isd.setFilename("/home/kberry/csm/CSM-CameraModel/tests/data/simpleFramerISD.img"); isd.setFilename("data/simpleFramerISD.img"); UsgsAstroFramePlugin frameCameraPlugin; csm::Model *model = frameCameraPlugin.constructModelFromISD( isd, Loading @@ -59,7 +59,7 @@ class SimpleFrameIsdTest : public ::testing::Test { csm::Isd isd; virtual void SetUp() { isd.setFilename("/home/kberry/csm/CSM-CameraModel/tests/data/simpleFramerISD.img"); isd.setFilename("data/simpleFramerISD.img"); } }; Loading Loading @@ -91,7 +91,7 @@ protected: virtual void SetUp() { isd.setFilename("/home/kberry/csm/CSM-CameraModel/tests/data/simpleFramerISD.img"); isd.setFilename("data/simpleFramerISD.img"); }; }; Loading @@ -116,7 +116,7 @@ class FrameIsdTest : public ::testing::Test { } virtual void SetUp() { isd.setFilename("/home/kberry/csm/CSM-CameraModel/tests/data/simpleFramerISD.img"); isd.setFilename("data/simpleFramerISD.img"); } }; Loading
tests/FrameCameraTests.cpp +10 −3 Original line number Diff line number Diff line Loading @@ -337,7 +337,6 @@ TEST_F(FrameIsdTest, X10_SlightlyOffCenter) { sensorModel = NULL; } TEST_F(FrameIsdTest, X1e9_SlightlyOffCenter) { double newValue = 1000000000.0; Loading @@ -360,7 +359,11 @@ TEST_F(FrameIsdTest, X1e9_SlightlyOffCenter) { // Angle rotations: TEST_F(FrameIsdTest, Rotation_omegaPi_Center) { UsgsAstroFrameSensorModel* sensorModel = createModel(isd); sensorModel->setParameterValue(3, M_PI); // omega sensorModel->setParameterValue(3, 0); sensorModel->setParameterValue(4, 0); sensorModel->setParameterValue(5, 1); sensorModel->setParameterValue(6, 0); ASSERT_NE(sensorModel, nullptr); csm::ImageCoord imagePt(7.5, 7.5); Loading @@ -376,7 +379,11 @@ TEST_F(FrameIsdTest, Rotation_omegaPi_Center) { TEST_F(FrameIsdTest, Rotation_NPole_Center) { UsgsAstroFrameSensorModel* sensorModel = createModel(isd); sensorModel->setParameterValue(4, -M_PI); // phi sensorModel->setParameterValue(3, 0); sensorModel->setParameterValue(4, -1); sensorModel->setParameterValue(5, 0); sensorModel->setParameterValue(6, 0); sensorModel->setParameterValue(0, 0.0); // X sensorModel->setParameterValue(1, 0.0); // Y sensorModel->setParameterValue(2, 1000.0); // Z Loading
tests/data/simpleFramerISD.json +1 −0 Original line number Diff line number Diff line Loading @@ -56,3 +56,4 @@ "z": 0 } }