75 QString stime = (QString) inst [
"NativeStartTime"];
76 QString intTime = stime.split(
".").first();
77 stime = stime.split(
".").last();
91 QString sampMode = QString((QString)inst [
"SamplingMode"]).toUpper();
94 int sampOffset = inst [
"XOffset"];
95 int lineOffset = inst [
"ZOffset"];
102 if (sampMode ==
"NORMAL") {
109 else if (sampMode ==
"HI-RES") {
119 string msg =
"Unsupported SamplingMode [" +
IString(sampMode) +
"]";
124 if (sampMode ==
"NORMAL") {
130 else if (sampMode ==
"HI-RES") {
139 string msg =
"Unsupported SamplingMode [" +
IString(sampMode) +
"]";
145 for(
int line = 0; line < p_camera->
ParentLines(); line++) {
146 for(
int samp = 0; samp < p_camera->
ParentSamples(); samp++) {
147 p_raMap[line][samp] = Isis::NULL8;
162 for(
int line = 0; line < p_camera->
ParentLines(); line++) {
176 for(
int samp = 0; samp < p_camera->
ParentSamples(); samp++) {
184 p_camera->
SetImage((
double) samp + 1, (
double)line + 1);
221 if((imgLine < 0.5) || (imgLine > p_camera->
ParentLines() + 0.5) ||
222 (imgSamp < 0.5) || (imgSamp > p_camera->
ParentSamples() + 0.5)) {
242 SpiceDouble lookC[3];
245 SpiceDouble unitLookC[3];
246 vhat_c(lookC, unitLookC);
259 if(ra < p_minRa || ra >
p_maxRa ||
264 double minDist = 9999.;
268 for(
int line = 0; line < p_camera->
ParentLines(); line++) {
270 for(
int samp = 0; samp < p_camera->
ParentSamples(); samp++) {
271 double mapRa =
p_raMap[line][samp];
272 if(mapRa == Isis::NULL8)
continue;
273 double mapDec =
p_decMap[line][samp];
274 if(mapDec == Isis::NULL8)
continue;
278 if(abs(mapRa - ra) > 180) {
279 if((ra - mapRa) > 0) {
280 mapRa = 360. + mapRa;
282 else if((ra - mapRa) < 0) {
283 mapRa = mapRa - 360.;
286 double dist = ((ra - mapRa) * (ra - mapRa)) +
287 ((dec - mapDec) * (dec - mapDec));
301 if(minDist >= 9999.)
return false;
312 vector<double> known(2);
314 for(
int line = minLine - 1; line < minLine + 2; line++) {
315 if(line < 0 || line > p_camera->
ParentLines() - 1)
continue;
316 for(
int samp = minSamp - 1; samp < minSamp + 2; samp++) {
318 if(samp < 0 || samp > p_camera->
ParentSamples() - 1)
continue;
320 double mapRa =
p_raMap[line][samp];
321 double mapDec =
p_decMap[line][samp];
322 if((mapRa == Isis::NULL8) || (mapDec == Isis::NULL8))
continue;
327 if(abs(mapRa - ra) > 180) {
328 if((ra - mapRa) > 0) {
329 mapRa = 360. + mapRa;
331 else if((ra - mapRa) < 0) {
332 mapRa = mapRa - 360.;
342 if(sampLsq.
Knowns() < 3)
return false;
350 double inSamp = sampLsq.
Evaluate(known);
351 double inLine = lineLsq.
Evaluate(known);
354 inLine < 0 || inLine > p_camera->
ParentLines() + 0.5) {
361 p_focalPlaneX = inSamp;
362 p_focalPlaneY = inLine;
391 v[0] = sin(theta) * cos(phi);
393 v[2] = sin(theta) * sin(phi) / -1.;
double RightAscension()
Returns the right ascension angle (sky longitude).
void LookDirection(double v[3])
Determines the look direction in the camera coordinate system.
double p_decMap[64][64]
Declination map.
double p_minRa
Minimum right ascension.
double p_maxDec
Maximum declination.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
virtual bool SetFocalPlane(const double ux, const double uy, const double uz)
Compute ground position from focal plane coordinate.
SpiceDouble p_etStart
Start ephemeris time.
Nth degree Polynomial with two variables.
double p_uy
Distorted focal plane y, in millimeters.
double p_yPixSize
Y pixel size.
double p_interlineDelay
InterlineDelayDuration keyword value from the instrument group of the labels, divided by 1000...
virtual bool SetSky(const double ra, const double dec)
Sets the sky position to the given ra and dec.
const double HALFPI(1.57079632679489661923)
The mathematical constant PI/2.
bool SetLookDirection(const double v[3])
Sets the look direction of the spacecraft.
double toDouble(const QString &string)
Global function to convert from a string to a double.
This error is for when a programmer made an API call that was illegal.
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
int p_swathLength
SwathLength keyword value from the instrument group of the labels.
bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
double Evaluate(const std::vector< double > &input)
Invokes the BasisFunction Evaluate method.
int p_swathWidth
SwathWidth keyword value from the instrument group of the labels.
double p_maxRa
Maximum right ascension.
double p_yBore
Y boresight.
int p_camSampOffset
Sample offset.
Contains multiple PvlContainers.
double p_raMap[64][64]
Right ascension map.
#define _FILEINFO_
Macro for the filename and line number.
double p_xBore
X boresight.
void setTime(const iTime &time)
By setting the time you essential set the position of the spacecraft and body as indicated in the cla...
double p_visExp
VIS exposure duration, divided by 1000.
Generic least square fitting class.
double p_ux
Distorted focal plane x, in millimeters.
Container for cube-like labels.
void Init(Pvl &lab)
Initialize vims sky model.
void AddKnown(const std::vector< double > &input, double expected, double weight=1.0)
Invoke this method for each set of knowns.
QString p_channel
Channel keyword value from the instrument group of the labels.
double p_minDec
Minimum declination.
Adds specific functionality to C++ strings.
iTime getClockTime(QString clockValue, int sclkCode=-1)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
Convert between undistorted focal plane and ra/dec coordinates.
void IgnoreProjection(bool ignore)
Set whether or not the camera should ignore the Projection.
int ParentLines() const
Returns the number of lines in the parent alphacube.
int ParentSamples() const
Returns the number of samples in the parent alphacube.
int Knowns() const
The number of knowns (or times AddKnown was invoked) linear combination of the variables.
double p_xPixSize
X pixel size.
int Solve(Isis::LeastSquares::SolveMethod method=SVD)
After all the data has been registered through AddKnown, invoke this method to solve the system of eq...
double p_irExp
IR exposure duration, divided by 1000.
double p_uz
Distorted focal plane z, in millimeters.
int p_camLineOffset
Line offset.
double Declination()
Returns the declination angle (sky latitude).