Commit 8131fbd6 authored by Kristin Berry's avatar Kristin Berry
Browse files

Update to use quaternions in test to match new ISD

parent 2ce4108c
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -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[] =
{
@@ -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(); 
+4 −4
Original line number Diff line number Diff line
@@ -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,
@@ -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");
   }
};

@@ -91,7 +91,7 @@ protected:


  virtual void SetUp() {
    isd.setFilename("/home/kberry/csm/CSM-CameraModel/tests/data/simpleFramerISD.img");
    isd.setFilename("data/simpleFramerISD.img");
  };
};

@@ -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");
   }
};

+10 −3
Original line number Diff line number Diff line
@@ -337,7 +337,6 @@ TEST_F(FrameIsdTest, X10_SlightlyOffCenter) {
   sensorModel = NULL;
}


TEST_F(FrameIsdTest, X1e9_SlightlyOffCenter) {
   double newValue = 1000000000.0;

@@ -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);
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -56,3 +56,4 @@
		"z": 0
	}
}