9 #include "LoCameraFiducialMap.h"
12 #include "CameraGroundMap.h"
13 #include "CameraSkyMap.h"
27 LoCameraFiducialMap::LoCameraFiducialMap(
PvlGroup &inst,
const int naifIkCode) {
29 p_naifIkCode = naifIkCode;
34 if(naifIkCode % 2 == 0) {
53 void LoCameraFiducialMap::ReadFiducials(
PvlGroup &inst) {
60 PvlKeyword &fXs = inst[
"FiducialXCoordinates"];
61 PvlKeyword &fYs = inst[
"FiducialYCoordinates"];
63 for(
int i = 0; i < fSamps.
size(); i++) {
64 p_fidSamples.push_back(
toDouble(fSamps[i]));
65 p_fidLines.push_back(
toDouble(fLines[i]));
66 p_fidXCoords.push_back(
toDouble(fXs[i]));
67 p_fidYCoords.push_back(
toDouble(fYs[i]));
71 string msg =
"Unable to read fiducial mapping from cube labels - ";
72 msg +=
"Input cube must be processed in Isis 2 through lofixlabel ";
73 msg +=
"and converted to Isis with pds2isis";
74 throw IException(e, IException::User, msg, _FILEINFO_);
86 void LoCameraFiducialMap::CreateTrans(
int xdir) {
91 fptrans->
Solve(&p_fidSamples[0], (
double *) &p_fidLines[0],
92 (
double *) &p_fidXCoords[0], (
double *) &p_fidYCoords[0],
97 string msg =
"Unable to create fiducial map.";
98 throw IException(IException::User, msg, _FILEINFO_);
102 vector<double> transx;
103 vector<double> transy;
108 for(
int icoef = 0; icoef < 3; icoef++) {
109 transx[icoef] *= xdir;
113 transx.insert(transx.begin(), transx[2]);
115 transy.insert(transy.begin(), transy[2]);
118 string icode =
"INS" +
IString(p_naifIkCode);
119 string icodex = icode +
"_TRANSX";
120 string icodey = icode +
"_TRANSY";
121 pdpool_c(icodex.c_str(), 3, (
double( *)) &transx[0]);
122 pdpool_c(icodey.c_str(), 3, (
double( *)) &transy[0]);
124 vector<double> transs;
125 vector<double> transl;
130 transs.insert(transs.begin(), transs[2]);
132 transl.insert(transl.begin(), transl[2]);
139 string icodes = icode +
"_ITRANSS";
140 string icodel = icode +
"_ITRANSL";
141 pdpool_c(icodes.c_str(), 3, (
double( *)) &transs[0]);
142 pdpool_c(icodel.c_str(), 3, (
double( *)) &transl[0]);