Skip to content
Snippets Groups Projects
Unverified Commit d5571c13 authored by Oleg Alexandrov's avatar Oleg Alexandrov Committed by GitHub
Browse files

Add radtan distortion (#575)

parent e1959ec2
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,8 @@ namespace ale {
DAWNFC,
LROLROCNAC,
CAHVOR,
LUNARORBITER
LUNARORBITER,
RADTAN
};
}
......
......@@ -342,9 +342,9 @@ double getSemiMinorRadius(json isd) {
// type. Defaults to transverse
DistortionType getDistortionModel(json isd) {
try {
json distoriton_subset = isd.at("optical_distortion");
json distortion_subset = isd.at("optical_distortion");
json::iterator it = distoriton_subset.begin();
json::iterator it = distortion_subset.begin();
std::string distortion = (std::string)it.key();
......@@ -362,6 +362,8 @@ DistortionType getDistortionModel(json isd) {
return DistortionType::CAHVOR;
} else if (distortion.compare("lunarorbiter") == 0) {
return DistortionType::LUNARORBITER;
} else if (distortion.compare("radtan") == 0) {
return DistortionType::RADTAN;
}
} catch (...) {
throw std::runtime_error("Could not parse the distortion model.");
......@@ -528,6 +530,20 @@ std::vector<double> getDistortionCoeffs(json isd) {
coefficients = std::vector<double>(4, 0.0);
}
} break;
case DistortionType::RADTAN: {
try {
coefficients = isd.at("optical_distortion")
.at("radtan")
.at("coefficients")
.get<std::vector<double>>();
return coefficients;
} catch (...) {
throw std::runtime_error(
"Could not parse the radtan distortion model coefficients.");
coefficients = std::vector<double>(5, 0.0);
}
} break;
}
throw std::runtime_error(
"Could not parse the distortion model coefficients.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment