18#include "IException.h"
21#include "LeastSquares.h"
22#include "PolynomialBivariate.h"
23#include "Preference.h"
24#include "SpecialPixel.h"
64 QString stime = (QString) inst [
"NativeStartTime"];
65 QString intTime = stime.split(
".").first();
66 stime = stime.split(
".").last();
80 QString sampMode = QString((QString)inst [
"SamplingMode"]).toUpper();
83 int sampOffset = inst [
"XOffset"];
84 int lineOffset = inst [
"ZOffset"];
91 if (sampMode ==
"NORMAL") {
98 else if (sampMode ==
"HI-RES") {
108 string msg =
"Unsupported SamplingMode [" +
IString(sampMode) +
"]";
113 if (sampMode ==
"NORMAL") {
119 else if (sampMode ==
"HI-RES") {
128 string msg =
"Unsupported SamplingMode [" +
IString(sampMode) +
"]";
136 p_raMap[line][samp] = Isis::NULL8;
231 SpiceDouble lookC[3];
234 SpiceDouble unitLookC[3];
235 vhat_c(lookC, unitLookC);
248 if(ra < p_minRa || ra >
p_maxRa ||
253 double minDist = 9999.;
260 double mapRa =
p_raMap[line][samp];
261 if(mapRa == Isis::NULL8)
continue;
262 double mapDec =
p_decMap[line][samp];
263 if(mapDec == Isis::NULL8)
continue;
267 if(abs(mapRa - ra) > 180) {
268 if((ra - mapRa) > 0) {
269 mapRa = 360. + mapRa;
271 else if((ra - mapRa) < 0) {
272 mapRa = mapRa - 360.;
275 double dist = ((ra - mapRa) * (ra - mapRa)) +
276 ((dec - mapDec) * (dec - mapDec));
290 if(minDist >= 9999.)
return false;
301 vector<double> known(2);
303 for(
int line = minLine - 1; line < minLine + 2; line++) {
305 for(
int samp = minSamp - 1; samp < minSamp + 2; samp++) {
309 double mapRa =
p_raMap[line][samp];
310 double mapDec =
p_decMap[line][samp];
311 if((mapRa == Isis::NULL8) || (mapDec == Isis::NULL8))
continue;
316 if(abs(mapRa - ra) > 180) {
317 if((ra - mapRa) > 0) {
318 mapRa = 360. + mapRa;
320 else if((ra - mapRa) < 0) {
321 mapRa = mapRa - 360.;
327 sampLsq.AddKnown(known, samp + 1);
328 lineLsq.AddKnown(known, line + 1);
331 if(sampLsq.Knowns() < 3)
return false;
339 double inSamp = sampLsq.Evaluate(known);
340 double inLine = lineLsq.Evaluate(known);
380 v[0] = sin(theta) * cos(phi);
382 v[2] = sin(theta) * sin(phi) / -1.;
int ParentLines() const
Returns the number of lines in the parent alphacube.
void IgnoreProjection(bool ignore)
Set whether or not the camera should ignore the Projection.
int ParentSamples() const
Returns the number of samples in the parent alphacube.
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
Convert between undistorted focal plane and ra/dec coordinates.
Camera * p_camera
The main camera to calculate distortions on.
double p_focalPlaneY
Undistorted y value for the focal plane.
double p_focalPlaneX
Undistorted x value for the focal plane.
@ Programmer
This error is for when a programmer made an API call that was illegal.
Adds specific functionality to C++ strings.
Generic least square fitting class.
Nth degree Polynomial with two variables.
Contains multiple PvlContainers.
Container for cube-like labels.
@ Traverse
Search child objects.
void setTime(const iTime &time)
By setting the time you essential set the position of the spacecraft and body as indicated in the cla...
virtual double RightAscension()
Returns the right ascension angle (sky longitude).
virtual double Declination()
Returns the declination angle (sky latitude).
bool SetLookDirection(const double v[3])
Sets the look direction of the spacecraft.
virtual iTime getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
double p_decMap[64][64]
Declination map.
int p_camSampOffset
Sample offset.
double p_minRa
Minimum right ascension.
double p_maxDec
Maximum declination.
double p_xPixSize
X pixel size.
VimsSkyMap(Camera *parent, Pvl &lab)
Constructs the VimsSkyMap object.
void Init(Pvl &lab)
Initialize vims sky model.
double p_ux
Distorted focal plane x, in millimeters.
double p_yBore
Y boresight.
double p_interlineDelay
InterlineDelayDuration keyword value from the instrument group of the labels, divided by 1000.
void LookDirection(double v[3])
Determines the look direction in the camera coordinate system.
QString p_channel
Channel keyword value from the instrument group of the labels.
double p_uz
Distorted focal plane z, in millimeters.
double p_maxRa
Maximum right ascension.
double p_raMap[64][64]
Right ascension map.
double p_visExp
VIS exposure duration, divided by 1000.
double p_irExp
IR exposure duration, divided by 1000.
int p_swathLength
SwathLength keyword value from the instrument group of the labels.
double p_xBore
X boresight.
double p_minDec
Minimum declination.
double p_yPixSize
Y pixel size.
SpiceDouble p_etStart
Start ephemeris time.
virtual bool SetSky(const double ra, const double dec)
Sets the sky position to the given ra and dec.
virtual bool SetFocalPlane(const double ux, const double uy, const double uz)
Compute ground position from focal plane coordinate.
int p_swathWidth
SwathWidth keyword value from the instrument group of the labels.
double p_uy
Distorted focal plane y, in millimeters.
int p_camLineOffset
Line offset.
This is free and unencumbered software released into the public domain.
const double HALFPI
The mathematical constant PI/2.
double toDouble(const QString &string)
Global function to convert from a string to a double.
Namespace for the standard library.