Commit 1781d7df authored by acpaquette's avatar acpaquette
Browse files

Removed get functions in favor of the ones in ALE

parent 67e0d966
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -199,10 +199,6 @@ void applyRotationTranslationToXyzVec(ale::Rotation const& r, ale::Vec3d const&
// to a calendar time string, such as 2000-01-01T00:16:40Z.
std::string ephemTimeToCalendarTime(double ephemTime);

std::vector<double> getGeoTransform(nlohmann::json isd);

std::string getProjectionString(nlohmann::json isd);

std::vector<double> pixelToMeter(double line, double sample, std::vector<double> geoTransform);

std::vector<double> meterToPixel(double meter_x, double meter_y, std::vector<double> geoTransform);
+2 −2
Original line number Diff line number Diff line
@@ -775,8 +775,8 @@ std::string UsgsAstroProjectedLsSensorModel::constructStateFromIsd(
  json lsState = json::parse(UsgsAstroLsSensorModel::constructStateFromIsd(imageSupportData, warnings));
  json state = json::parse(imageSupportData);

  lsState["m_geoTransform"] = getGeoTransform(state);
  lsState["m_projString"] = getProjectionString(state);
  lsState["m_geoTransform"] = ale::getGeoTransform(state);
  lsState["m_projString"] = ale::getProjectionString(state);
  MESSAGE_LOG(
      spdlog::level::trace,
      "m_geoTransform: {} "
+0 −22
Original line number Diff line number Diff line
@@ -1529,28 +1529,6 @@ std::string ephemTimeToCalendarTime(double ephemTime) {
  return buffer;
}

std::vector<double> getGeoTransform(json isd) {
  std::vector<double> transform = {};
  try {
    transform = isd.at("geo_transform").get<std::vector<double>>();
  } catch (std::exception &e) {
    std::string originalError = e.what();
    std::string msg = "Could not parse the geo_transform. ERROR: " + originalError + isd.dump();
    throw std::runtime_error(msg);
  }
  return transform;
}

std::string getProjectionString(json isd) {
  std::string projection_string = "";
  try {
    projection_string = isd.at("proj_string");
  } catch (...) {
    throw std::runtime_error("Could not parse the projection string.");
  }
  return projection_string;
}

std::vector<double> pixelToMeter(double line, double sample, std::vector<double> geoTransform) {
  double meter_x = (sample * geoTransform[1]) + geoTransform[0];
  double meter_y = (line * geoTransform[5]) + geoTransform[3];