19 LoCameraFiducialMap::LoCameraFiducialMap(
PvlGroup &inst,
const int naifIkCode) {
21 p_naifIkCode = naifIkCode;
26 if(naifIkCode % 2 == 0) {
45 void LoCameraFiducialMap::ReadFiducials(
PvlGroup &inst) {
52 PvlKeyword &fXs = inst[
"FiducialXCoordinates"];
53 PvlKeyword &fYs = inst[
"FiducialYCoordinates"];
55 for(
int i = 0; i < fSamps.
size(); i++) {
56 p_fidSamples.push_back(
toDouble(fSamps[i]));
57 p_fidLines.push_back(
toDouble(fLines[i]));
58 p_fidXCoords.push_back(
toDouble(fXs[i]));
59 p_fidYCoords.push_back(
toDouble(fYs[i]));
63 string msg =
"Unable to read fiducial mapping from cube labels - ";
64 msg +=
"Input cube must be processed in Isis 2 through lofixlabel ";
65 msg +=
"and converted to Isis 3 with pds2isis";
78 void LoCameraFiducialMap::CreateTrans(
int xdir) {
83 fptrans->
Solve(&p_fidSamples[0], (
double *) &p_fidLines[0],
84 (
double *) &p_fidXCoords[0], (
double *) &p_fidYCoords[0],
89 string msg =
"Unable to create fiducial map.";
94 vector<double> transx;
95 vector<double> transy;
100 for(
int icoef = 0; icoef < 3; icoef++) {
101 transx[icoef] *= xdir;
105 transx.insert(transx.begin(), transx[2]);
107 transy.insert(transy.begin(), transy[2]);
110 string icode =
"INS" +
IString(p_naifIkCode);
111 string icodex = icode +
"_TRANSX";
112 string icodey = icode +
"_TRANSY";
113 pdpool_c(icodex.c_str(), 3, (double( *)) &transx[0]);
114 pdpool_c(icodey.c_str(), 3, (double( *)) &transy[0]);
116 vector<double> transs;
117 vector<double> transl;
122 transs.insert(transs.begin(), transs[2]);
124 transl.insert(transl.begin(), transl[2]);
131 string icodes = icode +
"_ITRANSS";
132 string icodel = icode +
"_ITRANSL";
133 pdpool_c(icodes.c_str(), 3, (double( *)) &transs[0]);
134 pdpool_c(icodel.c_str(), 3, (double( *)) &transl[0]);
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Namespace for the standard library.
double toDouble(const QString &string)
Global function to convert from a string to a double.
int size() const
Returns the number of values stored in this keyword.
std::vector< double > Coefficients(int var)
Return the affine coeffients for the entered variable (1 or 2).
Contains multiple PvlContainers.
#define _FILEINFO_
Macro for the filename and line number.
A single keyword-value pair.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
std::vector< double > InverseCoefficients(int var)
Return the inverse affine coeffients for the entered variable (1 or 2).
void Solve(const double x[], const double y[], const double xp[], const double yp[], int n)
Given a set of coordinate pairs (n >= 3), compute the affine transform that best fits the points...