Commit 2ed4436f authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by Jesse Mapel
Browse files

patched segfault error + added detector center as defined in json schema (#94)

* patched segfault error + added detector center as defined in the swagger schema

* verbose travi
parent 3590f6ae
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ script:
  - cd build
  - cmake -DCOVERAGE=ON ..
  - cmake --build .
  - ctest
  - ctest -VV
  - cd ..

after_success:
+20 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ const std::string UsgsAstroFramePlugin::_ISD_KEYWORD[] =
   "sensor_location",
   "sensor_orientation",
   "sensor_velocity",
   "detector_center",
   "starting_detector_line",
   "starting_detector_sample",
   "starting_ephemeris_time",
@@ -435,6 +436,25 @@ csm::Model *UsgsAstroFramePlugin::constructModelFromISD(const csm::Isd &imageSup
    missingKeywords.push_back("image_samples");
  }

  if (imageSupportData.param("detector_center") == "") {
    missingKeywords.push_back("detector_center");
  }
  else {
    json jayson = json::parse(imageSupportData.param("detector_center"));
    json sample = jayson.value("sample", json(""));
    json line = jayson.value("line", json(""));

    sensorModel->m_ccdCenter[0] = atof(sample.dump().c_str());
    sensorModel->m_ccdCenter[1] = atof(line.dump().c_str());

    if (sample == json("")) {
      missingKeywords.push_back("detector_center x");
    }
    if (line == json("")) {
      missingKeywords.push_back("detector_center y");
    }
  }

  sensorModel->m_iTransL[0] = atof(imageSupportData.param("focal2pixel_lines", 0).c_str());
  sensorModel->m_iTransL[1] = atof(imageSupportData.param("focal2pixel_lines", 1).c_str());
  sensorModel->m_iTransL[2] = atof(imageSupportData.param("focal2pixel_lines", 2).c_str());
+2 −2
Original line number Diff line number Diff line
@@ -91,8 +91,8 @@ UsgsAstroFrameSensorModel::UsgsAstroFrameSensorModel() {
  m_line_pp = 0.0;
  m_sample_pp = 0.0;

  m_odtX.assign(0.0, 0.0);
  m_odtY.assign(0.0, 0.0);
  m_odtX.assign(10, 0.0);
  m_odtY.assign(10, 0.0);

  m_originalHalfLines = 0.0;
  m_spacecraftName = "";
+4 −0
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@
	},
	"image_lines": 15,
	"image_samples": 15,
  "detector_center" : {
    "line" : 7.5,
    "sample" : 7.5
  },
	"interpolation_method": "lagrange",
	"number_of_ephemerides": 1,
	"optical_distortion": {