27#include "CameraDetectorMap.h"
28#include "CameraFocalPlaneMap.h"
29#include "CameraDistortionMap.h"
30#include "CameraGroundMap.h"
31#include "CameraSkyMap.h"
33#include "IException.h"
38#include "NaifStatus.h"
39#include "Projection.h"
40#include "ProjectionFactory.h"
41#include "RingPlaneProjection.h"
42#include "ShapeModel.h"
43#include "SpecialPixel.h"
44#include "SurfacePoint.h"
46#include "TProjection.h"
77 if (lab.findObject(
"IsisCube").hasGroup(
"Mapping")) {
98 PvlGroup &inst = lab.findObject(
"IsisCube").findGroup(
"Instrument");
99 if (inst.hasKeyword(
"ReferenceBand")) {
171 bool success =
false;
245 bool success =
false;
300 if (shape->
name() !=
"Plane") {
306 if (!rad.isValid()) {
327 if (!rad.isValid()) {
359 if (tproj->SetWorld(sample, line)) {
361 tproj->UniversalLatitude())) {
389 target()->shape()->clearSurfacePoint();
407 if (shape->
name() !=
"Plane") {
416 target()->shape()->clearSurfacePoint();
435 if (!surfacePt.Valid()) {
539 const double radius) {
547 target()->shape()->clearSurfacePoint();
594 Angle phase, emission, incidence;
604 thetaRad = emissionDeg*
DEG2RAD;
628 double dist = SensorUtilities::distance(sB, pB) * 1000.0;
686 return (lineRes + sampRes) / 2.0;
701 return (lineRes + sampRes) / 2.0;
754 if (
target()->shape()->name() ==
"Plane") {
755 IString msg =
"Images with plane targets should use Camera method RingRangeResolution ";
756 msg +=
"instead of GroundRangeResolution";
765 double originalSample =
Sample();
766 double originalLine =
Line();
767 int originalBand =
Band();
784 for (
int band = 1; band <= eband; band++) {
788 for (
int line = 1; line <=
p_lines + 1; line++) {
792 for (samp = 1; samp <=
p_samples + 1; samp++) {
794 if (
SetImage((
double)samp - 0.5, (
double)line - 0.5)) {
802 if (lon > 180.0) lon -= 360.0;
813 if (obliqueres > 0.0) {
818 if ((line != 1) && (line !=
p_lines + 1))
break;
823 if (line == 1)
continue;
824 if (line ==
p_lines + 1)
continue;
828 for (samp =
p_samples + 1; samp >= 1; samp--) {
829 if (
SetImage((
double)samp - 0.5, (
double)line - 0.5)) {
837 if (lon > 180.0) lon -= 360.0;
849 if (obliqueres > 0.0) {
871 if (radius.isValid()) {
885 if (obliqueres > 0.0) {
900 if (radius.isValid()) {
920 if (radius.isValid()) {
967 SetImage(originalSample, originalLine);
974 string message =
"Camera missed planet or SPICE data off.";
1002 double originalSample =
Sample();
1003 double originalLine =
Line();
1004 int originalBand =
Band();
1021 for (
int band = 1; band <= eband; band++) {
1025 for (
int line = 1; line <=
p_lines + 1; line++) {
1030 for (samp = 1; samp <=
p_samples + 1; samp++) {
1032 if (
SetImage((
double)samp - 0.5, (
double)line - 0.5)) {
1040 if (azimuth > 180.0) azimuth -= 360.0;
1049 if ((line != 1) && (line !=
p_lines + 1))
break;
1053 if (line == 1)
continue;
1054 if (line ==
p_lines + 1)
continue;
1058 for(samp =
p_samples + 1; samp >= 1; samp--) {
1059 if (
SetImage((
double)samp - 0.5, (
double)line - 0.5)) {
1067 if (azimuth > 180.0) azimuth -= 360.0;
1153 SetImage(originalSample, originalLine);
1162 string message =
"RingPlane ShapeModel - Camera missed plane or SPICE data off.";
1177 double minlat, minlon, maxlat, maxlon;
1178 return GroundRange(minlat, maxlat, minlon, maxlon, pvl);
1194 double &minlon,
double &maxlon,
1208 if(map.hasKeyword(
"EquatorialRadius"))
1211 if(map.hasKeyword(
"PolarRadius"))
1217 if(map.hasKeyword(
"LatitudeType")) {
1218 QString latType = (QString) map[
"LatitudeType"];
1219 if (latType.toUpper() ==
"PLANETOGRAPHIC") {
1220 if (abs(minlat) < 90.0) {
1221 minlat *=
PI / 180.0;
1222 minlat = atan(tan(minlat) * (a / b) * (a / b));
1223 minlat *= 180.0 /
PI;
1226 if(abs(maxlat) < 90.0) {
1227 maxlat *=
PI / 180.0;
1228 maxlat = atan(tan(maxlat) * (a / b) * (a / b));
1229 maxlat *= 180.0 /
PI;
1237 bool domain360 =
true;
1238 if(map.hasKeyword(
"LongitudeDomain")) {
1239 QString lonDomain = (QString) map[
"LongitudeDomain"];
1240 if(lonDomain.toUpper() ==
"180") {
1248 if(map.hasKeyword(
"LongitudeDirection")) {
1249 QString lonDirection = (QString) map[
"LongitudeDirection"];
1250 if(lonDirection.toUpper() ==
"POSITIVEWEST") {
1251 double swap = minlon;
1259 while(minlon < 0.0) {
1263 while(minlon > 360.0) {
1269 while(minlon < -180.0) {
1273 while(minlon > 180.0) {
1280 if((maxlon - minlon) > 359.0)
return true;
1298 double &minRingLongitude,
double &maxRingLongitude,
Pvl &pvl) {
1312 bool domain360 =
true;
1313 if (map.hasKeyword(
"RingLongitudeDomain")) {
1314 QString ringLongitudeDomain = (QString) map[
"RingLongitudeDomain"];
1315 if (ringLongitudeDomain ==
"180") {
1323 if (map.hasKeyword(
"RingLongitudeDirection")) {
1324 QString ringLongitudeDirection = (QString) map[
"RingLongitudeDirection"];
1325 if (ringLongitudeDirection.toUpper() ==
"Clockwise") {
1326 double swap = minRingLongitude;
1327 minRingLongitude = -maxRingLongitude;
1328 maxRingLongitude = -swap;
1334 while (minRingLongitude < 0.0) {
1335 minRingLongitude += 360.0;
1336 maxRingLongitude += 360.0;
1338 while (minRingLongitude > 360.0) {
1339 minRingLongitude -= 360.0;
1340 maxRingLongitude -= 360.0;
1344 while (minRingLongitude < -180.0) {
1345 minRingLongitude += 360.0;
1346 maxRingLongitude += 360.0;
1348 while (minRingLongitude > 180.0) {
1349 minRingLongitude -= 360.0;
1350 maxRingLongitude -= 360.0;
1355 if ((maxRingLongitude - minRingLongitude) > 359.0) {
1375 map +=
PvlKeyword(
"LatitudeType",
"Planetocentric");
1376 map +=
PvlKeyword(
"LongitudeDirection",
"PositiveEast");
1386 map +=
PvlKeyword(
"ProjectionName",
"Sinusoidal");
1397 if (
target()->shape()->name() !=
"Plane") {
1399 IString msg =
"A ring plane projection has been requested on an image whose shape is not a ring plane. ";
1400 msg +=
"Rerun spiceinit with shape=RINGPLANE. ";
1407 map +=
PvlKeyword(
"RingLongitudeDirection",
"CounterClockwise");
1408 map +=
PvlKeyword(
"RingLongitudeDomain",
"360");
1417 map +=
PvlKeyword(
"ProjectionName",
"Planar");
1424 QString key =
"INS" +
toString(code) +
"_FOCAL_LENGTH";
1431 QString key =
"INS" +
toString(code) +
"_PIXEL_PITCH";
1474 else if (
target()->shape()->hasIntersection()) {
1502 if ( !shapeModel->hasIntersection()) {
1504 normal[0] = normal[1] = normal[2] = 0.0;
1513 if (!shapeModel->isDEM()) {
1519 QVector<double *> unusedNeighborPoints(4);
1520 double origin[3] = {0, 0, 0};
1521 unusedNeighborPoints.fill(origin);
1522 shapeModel->calculateLocalNormal(unusedNeighborPoints);
1525 QVector<double *> cornerNeighborPoints(4);
1530 double line =
Line();
1533 QList< QPair< double, double > > surroundingPoints;
1534 surroundingPoints.append(qMakePair(samp, std::nexttoward(line - 0.5, line)));
1535 surroundingPoints.append(qMakePair(samp, std::nexttoward(line + 0.5, line)));
1536 surroundingPoints.append(qMakePair(std::nexttoward(samp - 0.5, samp), line));
1537 surroundingPoints.append(qMakePair(std::nexttoward(samp + 0.5, samp), line));
1540 double originalSample = samp;
1541 double originalLine = line;
1544 for (
int i = 0; i < cornerNeighborPoints.size(); i++) {
1545 cornerNeighborPoints[i] =
new double[3];
1553 for (
int i = 0; i < cornerNeighborPoints.size(); i++) {
1555 if (!(
SetImage(surroundingPoints[i].first, surroundingPoints[i].second))) {
1556 surroundingPoints[i].first = samp;
1557 surroundingPoints[i].second = line;
1560 if (!(
SetImage(surroundingPoints[i].first, surroundingPoints[i].second))) {
1562 normal[0] = normal[1] = normal[2] = 0.0;
1566 SetImage(originalSample, originalLine);
1573 for (
int i = 0; i < cornerNeighborPoints.size(); i++) {
1574 delete [] cornerNeighborPoints[i];
1586 latrec_c(radius.kilometers(), lon.radians(), lat.radians(), cornerNeighborPoints[i]);
1591 if ((surroundingPoints[0].first == surroundingPoints[1].first &&
1592 surroundingPoints[0].second == surroundingPoints[1].second) ||
1593 (surroundingPoints[2].first == surroundingPoints[3].first &&
1594 surroundingPoints[2].second == surroundingPoints[3].second)) {
1596 normal[0] = normal[1] = normal[2] = 0.0;
1600 SetImage(originalSample, originalLine);
1607 for (
int i = 0; i < cornerNeighborPoints.size(); i++)
1608 delete [] cornerNeighborPoints[i];
1614 SetImage(originalSample, originalLine);
1615 shapeModel->calculateLocalNormal(cornerNeighborPoints);
1618 for (
int i = 0; i < cornerNeighborPoints.size(); i++) {
1619 delete [] cornerNeighborPoints[i];
1625 if (!shapeModel->hasLocalNormal()) {
1636 std::vector<double> localNormal(3);
1637 localNormal = shapeModel->localNormal();
1638 memcpy(normal, (
double *) &localNormal[0],
sizeof(
double) * 3);
1654 Angle & emission,
bool &success) {
1662 if (SensorUtilities::magnitude(normal) == 0.) {
1668 double sensorPosBf[3];
1670 SensorUtilities::Vec sensorPos(sensorPosBf);
1673 SensorUtilities::Vec groundPt = {
1678 SensorUtilities::Vec groundToSensor = sensorPos - groundPt;
1681 SensorUtilities::Vec sunPos(
m_uB);
1682 SensorUtilities::Vec groundToSun = sunPos - groundPt;
1684 phase =
Angle(SensorUtilities::sepAngle(groundToSensor, groundToSun),
1687 emission =
Angle(SensorUtilities::sepAngle(groundToSensor, normal),
1690 incidence =
Angle(SensorUtilities::sepAngle(groundToSun, normal),
1708 if ( !shapeModel->hasIntersection()) {
1712 shapeModel->calculateSurfaceNormal();
1713 if (!shapeModel->hasNormal()) {
1717 std::vector<double> ellipsoidNormal = shapeModel->normal();
1719 double localNormal[3];
1721 if (localNormal[0] == 0.0 && localNormal[1] == 0.0 && localNormal[2] == 0.0) {
1726 slope = SensorUtilities::sepAngle(localNormal, &ellipsoidNormal[0]) *
RAD2DEG;
1742 double &mindec,
double &maxdec) {
1746 double originalSample =
Sample();
1747 double originalLine =
Line();
1748 int originalBand =
Band();
1765 for (
int band = 1; band <= eband; band++) {
1768 for (
int line = 1; line <=
p_lines; line++) {
1771 for (samp = 1; samp <=
p_samples; samp++) {
1772 SetImage((
double)samp, (
double)line);
1780 if (ra > 180.0) ra -= 360.0;
1784 if ((line != 1) && (line !=
p_lines))
break;
1789 for (samp =
p_samples; samp >= 1; samp--) {
1790 SetImage((
double)samp, (
double)line);
1798 if (ra > 180.0) ra -= 360.0;
1868 SetImage(originalSample, originalLine);
1886 double originalSample =
Sample();
1887 double originalLine =
Line();
1888 int originalBand =
Band();
1898 double dist = (ra1 - ra2) * (ra1 - ra2) + (dec1 - dec2) * (dec1 - dec2);
1900 double lineRes = dist / (
p_lines - 1);
1906 dist = (ra1 - ra2) * (ra1 - ra2) + (dec1 - dec2) * (dec1 - dec2);
1908 double sampRes = dist / (
p_samples - 1);
1913 SetImage(originalSample, originalLine);
1919 return (sampRes < lineRes) ? sampRes : lineRes;
1928 if (
target()->shape()->name() ==
"Plane") {
1929 QString msg =
"North Azimuth is not available for plane target shapes.";
1942 if (azimuth > 360.0) azimuth = azimuth - 360.0;
2085 SpiceDouble azimuthOrigin[3];
2088 if (!originRadius.isValid()) {
2095 SpiceDouble pointOfInterestFromBodyCenter[3];
2096 latrec_c(originRadius.kilometers(), lon *
PI / 180.0,
2097 lat *
PI / 180.0, pointOfInterestFromBodyCenter);
2105 SpiceDouble pointOfInterest[3];
2106 vsub_c(pointOfInterestFromBodyCenter, azimuthOrigin, pointOfInterest);
2112 SpiceDouble pointOfInterestProj[3];
2113 vperp_c(pointOfInterest, azimuthOrigin, pointOfInterestProj);
2116 SpiceDouble pointOfInterestProjUnit[3];
2117 vhat_c(pointOfInterestProj, pointOfInterestProjUnit);
2123 SpiceDouble pointOfInterestProjUnitScaled[3];
2124 vscl_c(scale, pointOfInterestProjUnit, pointOfInterestProjUnitScaled);
2129 SpiceDouble adjustedPointOfInterestFromBodyCenter[3];
2130 vadd_c(azimuthOrigin, pointOfInterestProjUnitScaled, adjustedPointOfInterestFromBodyCenter);
2133 double azimuthOriginSample =
Sample();
2134 double azimuthOriginLine =
Line();
2137 double adjustedPointOfInterestRad, adjustedPointOfInterestLon, adjustedPointOfInterestLat;
2138 reclat_c(adjustedPointOfInterestFromBodyCenter,
2139 &adjustedPointOfInterestRad,
2140 &adjustedPointOfInterestLon,
2141 &adjustedPointOfInterestLat);
2142 adjustedPointOfInterestLat = adjustedPointOfInterestLat * 180.0 /
PI;
2143 adjustedPointOfInterestLon = adjustedPointOfInterestLon * 180.0 /
PI;
2144 if (adjustedPointOfInterestLon < 0) adjustedPointOfInterestLon += 360.0;
2150 adjustedPointOfInterestLon,
2151 originRadius.meters());
2155 SetImage(azimuthOriginSample, azimuthOriginLine);
2159 double adjustedPointOfInterestSample =
Sample();
2160 double adjustedPointOfInterestLine =
Line();
2188 double deltaSample = adjustedPointOfInterestSample - azimuthOriginSample;
2189 double deltaLine = adjustedPointOfInterestLine - azimuthOriginLine;
2198 double azimuth = 0.0;
2199 if (deltaSample != 0.0 || deltaLine != 0.0) {
2200 azimuth = atan2(deltaLine, deltaSample);
2201 azimuth *= 180.0 /
PI;
2205 if (azimuth < 0.0) azimuth += 360.0;
2206 if (azimuth > 360.0) azimuth -= 360.0;
2214 SetImage(azimuthOriginSample, azimuthOriginLine);
2231 double coord[3], spCoord[3];
2236 double a = SensorUtilities::sepAngle(coord, spCoord) *
RAD2DEG;
2240 double c = 180.0 - (a + b);
2268 double slat,
double slon) {
2272 a = (90.0 - slat) *
PI / 180.0;
2273 b = (90.0 - glat) *
PI / 180.0;
2276 a = (90.0 + slat) *
PI / 180.0;
2277 b = (90.0 + glat) *
PI / 180.0;
2280 double cslon = slon;
2281 double cglon = glon;
2282 if (cslon > cglon) {
2283 if ((cslon-cglon) > 180.0) {
2284 while ((cslon-cglon) > 180.0) cslon = cslon - 360.0;
2287 if (cglon > cslon) {
2288 if ((cglon-cslon) > 180.0) {
2289 while ((cglon-cslon) > 180.0) cglon = cglon - 360.0;
2296 if (cslon > cglon) {
2299 else if (cslon < cglon) {
2306 else if (slat < glat) {
2307 if (cslon > cglon) {
2310 else if (cslon < cglon) {
2318 if (cslon > cglon) {
2321 else if (cslon < cglon) {
2329 double C = (cglon - cslon) *
PI / 180.0;
2331 double c = acos(cos(a)*cos(b) + sin(a)*sin(b)*cos(C));
2332 double azimuth = 0.0;
2333 if (sin(b) == 0.0 || sin(c) == 0.0) {
2336 double intermediate = (cos(a) - cos(b)*cos(c))/(sin(b)*sin(c));
2337 if (intermediate < -1.0) {
2338 intermediate = -1.0;
2340 else if (intermediate > 1.0) {
2343 double A = acos(intermediate) * 180.0 /
PI;
2346 if (quad == 1 || quad == 4) {
2349 else if (quad == 2 || quad == 3) {
2350 azimuth = 360.0 - A;
2354 if (quad == 1 || quad == 4) {
2355 azimuth = 180.0 - A;
2357 else if (quad == 2 || quad == 3) {
2358 azimuth = 180.0 + A;
2457 int cacheSize =
CacheSize(ephemerisTimes.first, ephemerisTimes.second);
2465 double altitudeMeters;
2467 altitudeMeters = 1.0;
2480 setTime(ephemerisTimes.first);
2510 pair<double,double> ephemerisTimes;
2511 double startTime = -DBL_MAX;
2512 double endTime = -DBL_MAX;
2514 for (
int band = 1; band <=
Bands(); band++) {
2517 double etStart =
time().Et();
2520 double etEnd =
time().Et();
2522 startTime = min(etStart, etEnd);
2523 endTime = max(etStart, etEnd);
2525 startTime = min(startTime, min(etStart, etEnd));
2526 endTime = max(endTime, max(etStart, etEnd));
2528 if (startTime == -DBL_MAX || endTime == -DBL_MAX) {
2529 string msg =
"Unable to find time range for the spice kernels";
2532 ephemerisTimes.first = startTime;
2533 ephemerisTimes.second = endTime;
2534 return ephemerisTimes;
2561 if (startTime == endTime) {
2589 if (startSize == 2 && endSize == 2) {
2595 if (endSize > startSize) {
2596 IString message =
"Camera::SetGeometricTilingHint End size must be smaller than the start size";
2600 if (startSize < 4) {
2601 IString message =
"Camera::SetGeometricTilingHint Start size must be at least 4";
2605 bool foundEnd =
false;
2606 while (powerOf2 > 0 && startSize != powerOf2) {
2607 if (powerOf2 == endSize) foundEnd =
true;
2614 IString message =
"Camera::SetGeometricTilingHint Start size must be a power of 2";
2619 IString message =
"Camera::SetGeometricTilingHint End size must be a power of 2 less than the start size, but greater than 2";
2787 QList<QPointF> offsets;
3068 double orgLine =
Line();
3069 double orgSample =
Sample();
3074 double y =
Line() - orgLine;
3075 double x =
Sample() - orgSample;
3076 double celestialNorthClockAngle = atan2(-y, x) * 180.0 /
Isis::PI;
3077 celestialNorthClockAngle = 90.0 - celestialNorthClockAngle;
3079 if (celestialNorthClockAngle < 0.0) {
3080 celestialNorthClockAngle += 360.0;
3084 return celestialNorthClockAngle;
This class is used to rewrite the "alpha" keywords out of the AlphaCube group or Instrument group.
double AlphaSample(double betaSample)
Returns an alpha sample given a beta sample.
int AlphaSamples() const
Returns the number of samples in the alpha cube.
double BetaLine(double alphaLine)
Returns a beta line given an alpha line.
int BetaLines() const
Returns the number of lines in the beta cube.
int AlphaLines() const
Returns the number of lines in the alpha cube.
double AlphaLine(double betaLine)
Returns an alpha line given a beta line.
int BetaSamples() const
Returns the number of samples in the beta cube.
double BetaSample(double alphaSample)
Returns a beta sample given an alpha sample.
Defines an angle and provides unit conversions.
double degrees() const
Get the angle in units of Degrees.
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
@ Radians
Radians are generally used in mathematical equations, 0-2*PI is one circle, however these are more di...
Convert between parent image coordinates and detector coordinates.
double ParentSample() const
Return parent sample.
double ParentLine() const
Return parent line.
double DetectorLine() const
Return detector line.
virtual double LineScaleFactor() const
Return scaling factor for computing line resolution.
virtual bool SetParent(const double sample, const double line)
Compute detector position from a parent image coordinate.
double DetectorSample() const
Return detector sample.
virtual double SampleScaleFactor() const
Return scaling factor for computing sample resolution.
virtual double exposureDuration(const double sample, const double line, const int band) const
This virtual method is for returning the exposure duration of a given pixel.
virtual bool SetDetector(const double sample, const double line)
Compute parent position from a detector coordinate.
Distort/undistort focal plane coordinates.
virtual bool SetUndistortedFocalPlane(double ux, double uy)
Compute distorted focal plane x/y.
virtual bool SetFocalPlane(double dx, double dy)
Compute undistorted focal plane x/y.
double UndistortedFocalPlaneX() const
Gets the x-value in the undistorted focal plane coordinate system.
double FocalPlaneX() const
Gets the x-value in the focal plane coordinate system.
double UndistortedFocalPlaneZ() const
Gets the z-value in the undistorted focal plane coordinate system.
double UndistortedFocalPlaneY() const
Gets the y-value in the undistorted focal plane coordinate system.
double FocalPlaneY() const
Gets the y-value in the focal plane coordinate system.
Convert between distorted focal plane and detector coordinates.
double DetectorSample() const
double FocalPlaneY() const
virtual bool SetDetector(const double sample, const double line)
Compute distorted focal plane coordinate from detector position (sampel,line)
double DetectorLine() const
virtual bool SetFocalPlane(const double dx, const double dy)
Compute detector position (sample,line) from focal plane coordinates.
double FocalPlaneX() const
Convert between undistorted focal plane and ground coordinates.
virtual bool SetGround(const Latitude &lat, const Longitude &lon)
Compute undistorted focal plane coordinate from ground position.
virtual bool SetFocalPlane(const double ux, const double uy, const double uz)
Compute ground position from focal plane coordinate.
double FocalPlaneX() const
double FocalPlaneY() const
double NorthAzimuth()
Returns the North Azimuth.
std::pair< double, double > StartEndEphemerisTimes()
Calculates the start and end ephemeris times.
virtual double SampleResolution()
Returns the sample resolution at the current position in meters.
QString m_spacecraftNameLong
Full spacecraft name.
double p_maxRingLongitude180
The maximum ring longitude in the 180 domain.
static double GroundAzimuth(double glat, double glon, double slat, double slon)
Computes and returns the ground azimuth between the ground point and another point of interest,...
AlphaCube * p_alphaCube
A pointer to the AlphaCube.
double p_mindec
The minimum declination.
Projection * p_projection
A pointer to the Projection.
void GroundRangeResolution()
Computes the ground range and min/max resolution.
double p_maxres
The maximum resolution.
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
double p_maxobliqueres
The maximum oblique resolution.
double p_focalLength
The focal length, in units of millimeters.
bool SetImageSkyMapProjection(const double sample, const double line, ShapeModel *shape)
Sets the sample/line values of the image to get the lat/lon values for a Skymap Projected image.
double p_minra
The minimum right ascension.
bool p_raDecRangeComputed
Flag showing if the raDec range has been computed successfully.
virtual ~Camera()
Destroys the Camera Object.
int ParentLines() const
Returns the number of lines in the parent alphacube.
void SetSkyMap(CameraSkyMap *map)
Sets the Sky Map.
virtual double DetectorResolution()
Returns the detector resolution at the current position in meters.
double LowestObliqueImageResolution()
Returns the lowest/worst oblique resolution in the entire image.
double SpacecraftAzimuth()
Return the Spacecraft Azimuth.
CameraSkyMap * p_skyMap
A pointer to the SkyMap.
CameraDetectorMap * DetectorMap()
Returns a pointer to the CameraDetectorMap object.
double CelestialNorthClockAngle()
Computes the celestial north clock angle at the current line/sample or ra/dec.
double p_maxra
The maxumum right ascension.
virtual double Line() const
Returns the current line number.
void GetGeometricTilingHint(int &startSize, int &endSize)
This will get the geometric tiling hint; these values are typically used for ProcessRubberSheet::SetT...
double RaDecResolution()
Returns the RaDec resolution.
void IgnoreProjection(bool ignore)
Set whether or not the camera should ignore the Projection.
CameraDetectorMap * p_detectorMap
A pointer to the DetectorMap.
Camera(Cube &cube)
Constructs the Camera object.
bool IntersectsLongitudeDomain(Pvl &pvl)
Checks whether the ground range intersects the longitude domain or not.
double SunAzimuth()
Returns the Sun Azimuth.
double PixelPitch() const
Returns the pixel pitch.
double p_minobliqueres
The minimum oblique resolution.
double p_minres
The minimum resolution.
int ReferenceBand() const
Returns the reference band.
double p_maxlon180
The maximum longitude in the 180 domain.
double p_maxRingRadius
The maximum ring radius.
CameraSkyMap * SkyMap()
Returns a pointer to the CameraSkyMap object.
bool SetImageMapProjection(const double sample, const double line, ShapeModel *shape)
Sets the sample/line values of the image to get the lat/lon values for a Map Projected image.
int p_referenceBand
The reference band.
QString m_instrumentId
The InstrumentId as it appears on the cube.
double p_minRingLongitude180
The minimum ring longitude in the 180 domain.
int ParentSamples() const
Returns the number of samples in the parent alphacube.
virtual double ObliquePixelResolution(bool useLocal=true)
Returns the oblique pixel resolution at the current position in meters/pixel.
void BasicMapping(Pvl &map)
Writes the basic mapping group to the specified Pvl.
int Lines() const
Returns the number of lines in the image.
int p_geometricTilingEndSize
The ideal geometric tile size to end with when projecting.
virtual double Sample() const
Returns the current sample number.
void ringRangeResolution()
Analogous to above GroundRangeResolution method.
QString spacecraftNameLong() const
This method returns the full spacecraft name.
bool p_groundRangeComputed
Flag showing if ground range was computed successfully.
virtual double PixelResolution()
Returns the pixel resolution at the current position in meters/pixel.
bool ringRange(double &minRingRadius, double &maxRingRadius, double &minRingLongitude, double &maxRingLongitude, Pvl &pvl)
Analogous to the above Ground Range method.
double OffNadirAngle()
Return the off nadir angle in degrees.
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
void SetGeometricTilingHint(int startSize=128, int endSize=8)
This method sets the best geometric tiling size for projecting from this camera model.
virtual double LineResolution()
Returns the line resolution at the current position in meters.
void SetFocalLength()
Reads the focal length from the instrument kernel.
QString instrumentNameLong() const
This method returns the full instrument name.
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
double FocalLength() const
Returns the focal length.
virtual int Band() const
Returns the current band.
void SetDetectorMap(CameraDetectorMap *map)
Sets the Detector Map.
double p_maxlat
The maximum latitude.
int p_samples
The number of samples in the image.
bool HasProjection()
Checks to see if the camera object has a projection.
int p_lines
The number of lines in the image.
bool InCube()
This returns true if the current Sample() or Line() value is outside of the cube (meaning the point m...
double p_minlat
The minimum latitude.
double p_childSample
Sample value for child.
void LoadCache()
This loads the spice cache big enough for this image.
virtual bool SetUniversalGround(const double latitude, const double longitude)
Sets the lat/lon values to get the sample/line values.
double ComputeAzimuth(const double lat, const double lon)
Computes the image azimuth value from your current position (origin) to a point of interest specified...
QString instrumentNameShort() const
This method returns the shortened instrument name.
bool p_pointComputed
Flag showing if Sample/Line has been computed.
void SetFocalPlaneMap(CameraFocalPlaneMap *map)
Sets the Focal Plane Map.
virtual double ObliqueLineResolution(bool useLocal=true)
Returns the oblique line resolution at the current position in meters.
double p_minra180
The minimum right ascension in the 180 domain.
bool p_ignoreProjection
Whether or no to ignore the Projection.
QString m_instrumentNameShort
Shortened instrument name.
CameraFocalPlaneMap * p_focalPlaneMap
A pointer to the FocalPlaneMap.
void LocalPhotometricAngles(Angle &phase, Angle &incidence, Angle &emission, bool &success)
Calculates LOCAL photometric angles using the DEM (not ellipsoid).
void GetLocalNormal(double normal[3])
This method will find the local normal at the current (sample, line) and set it to the passed in arra...
QString instrumentId()
This method returns the InstrumentId as it appears in the cube.
CameraGroundMap * p_groundMap
A pointer to the GroundMap.
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
double HighestImageResolution()
Returns the highest/best resolution in the entire image.
virtual bool SetGround(Latitude latitude, Longitude longitude)
Sets the lat/lon values to get the sample/line values.
QString spacecraftNameShort() const
This method returns the shortened spacecraft name.
double HighestObliqueImageResolution()
Returns the highest/best oblique resolution in the entire image.
virtual int SpkTargetId() const
Provides target code for instruments SPK NAIF kernel.
QString m_spacecraftNameShort
Shortened spacecraft name.
bool p_ringRangeComputed
Flag showing if ring range was computed successfully.
double p_minlon
The minimum longitude.
virtual bool IsBandIndependent()
Virtual method that checks if the band is independent.
virtual double ObliqueSampleResolution(bool useLocal=true)
Returns the oblique sample resolution at the current position in m.
bool GroundRange(double &minlat, double &maxlat, double &minlon, double &maxlon, Pvl &pvl)
Computes the Ground Range.
double p_maxRingLongitude
The maximum ring longitude (azimuth)
int p_bands
The number of bands in the image.
virtual double ObliqueDetectorResolution(bool useLocal=true)
This method returns the Oblique Detector Resolution if the Look Vector intersects the target and if t...
void SetGroundMap(CameraGroundMap *map)
Sets the Ground Map.
bool RaDecRange(double &minra, double &maxra, double &mindec, double &maxdec)
Computes the RaDec range.
double p_minRingLongitude
The minimum ring longitude (azimuth)
CameraDistortionMap * p_distortionMap
A pointer to the DistortionMap.
double p_maxdec
The maximum declination.
double p_minRingRadius
The minimum ring radius.
void basicRingMapping(Pvl &map)
Writes the basic mapping group for ring plane to the specified Pvl.
int CacheSize(double startTime, double endTime)
This method calculates the spice cache size.
void Slope(double &slope, bool &success)
Calculates the slope at the current point by computing the angle between the local surface normal and...
double p_maxra180
The maximum right ascension in the 180 domain.
bool HasReferenceBand() const
Checks to see if the Camera object has a reference band.
bool RawFocalPlanetoImage()
Computes the image coordinate for the current universal ground point.
double p_pixelPitch
The pixel pitch, in millimeters per pixel.
double LowestImageResolution()
Returns the lowest/worst resolution in the entire image.
int Samples() const
Returns the number of samples in the image.
virtual QList< QPointF > PixelIfovOffsets()
Returns the pixel ifov offsets from center of pixel, which defaults to the (pixel pitch * summing mod...
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
virtual bool SetRightAscensionDeclination(const double ra, const double dec)
Sets the right ascension declination.
double p_minlon180
The minimum longitude in the 180 domain.
void SetDistortionMap(CameraDistortionMap *map, bool deleteExisting=true)
Sets the Distortion Map.
int p_childBand
Band value for child.
double p_childLine
Line value for child.
virtual double resolution()
Returns the resolution of the camera.
virtual void SetBand(const int band)
Virtual method that sets the band number.
CameraGroundMap * GroundMap()
Returns a pointer to the CameraGroundMap object.
virtual int SpkCenterId() const
Provides the center of motion body for SPK NAIF kernel.
QString m_instrumentNameLong
Full instrument name.
double p_maxlon
The maximum longitude.
int p_geometricTilingStartSize
The ideal geometric tile size to start with when projecting.
int Bands() const
Returns the number of bands in the image.
Convert between undistorted focal plane and ra/dec coordinates.
virtual bool SetSky(const double ra, const double dec)
Compute undistorted focal plane coordinate from ra/dec.
double FocalPlaneY() const
double FocalPlaneX() const
IO Handler for Isis Cubes.
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
double kilometers() const
Get the displacement in kilometers.
Distance measurement, usually in meters.
bool isValid() const
Test if this distance has been initialized or not.
@ Kilometers
The distance is being specified in kilometers.
@ Meters
The distance is being specified in meters.
double meters() const
Get the distance in meters.
@ Unknown
A type of error that cannot be classified as any of the other error types.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
@ Programmer
This error is for when a programmer made an API call that was illegal.
Adds specific functionality to C++ strings.
This class is designed to encapsulate the concept of a Latitude.
This class is designed to encapsulate the concept of a Longitude.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
static Isis::Projection * CreateFromCube(Isis::Cube &cube)
This method is a helper method.
virtual bool SetUniversalGround(const double coord1, const double coord2)
This method is used to set the lat/lon or radius/azimuth (i.e.
@ Triaxial
These projections are used to map triaxial and irregular-shaped bodies.
virtual bool SetWorld(const double x, const double y)
This method is used to set a world coordinate.
bool IsSky() const
Returns true if projection is sky and false if it is land.
virtual double WorldY() const
This returns the world Y coordinate provided SetGround, SetCoordinate, SetUniversalGround,...
virtual double WorldX() const
This returns the world X coordinate provided SetGround, SetCoordinate, SetUniversalGround,...
ProjectionType projectionType() const
Returns an enum value for the projection type.
Contains multiple PvlContainers.
Container for cube-like labels.
A single keyword-value pair.
@ Traverse
Search child objects.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Base class for Map Projections of plane shapes.
Class for computing sensor ground coordinates.
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 SurfacePoint GetSurfacePoint() const
Returns the surface point (most efficient accessor).
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
virtual double RightAscension()
Returns the right ascension angle (sky longitude).
bool HasSurfaceIntersection() const
Returns if the last call to either SetLookDirection or SetUniversalGround had a valid intersection wi...
double SpacecraftAltitude()
Returns the distance from the spacecraft to the subspacecraft point in km.
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
void Coordinate(double p[3]) const
Returns the x,y,z of the surface intersection in BodyFixed km.
Distance LocalRadius() const
Returns the local radius at the intersection point.
virtual double Declination()
Returns the declination angle (sky latitude).
virtual double EmissionAngle() const
Returns the emission angle in degrees.
Define shapes and provide utilities for Isis targets.
virtual void clearSurfacePoint()
Clears or resets the current surface point.
void setHasIntersection(bool b)
Sets the flag to indicate whether this ShapeModel has an intersection.
QString name() const
Gets the shape name.
virtual void subSolarPoint(double &lat, double &lon)
Returns the sub-solar latitude/longitude in universal coordinates (0-360 positive east,...
virtual void createCache(iTime startTime, iTime endTime, const int size, double tol)
This method creates an internal cache of spacecraft and sun positions over a specified time range.
void radii(Distance r[3]) const
Returns the radii of the body in km.
SpiceInt naifBodyCode() const
This returns the NAIF body code of the target indicated in the labels.
SpiceInt naifSpkCode() const
This returns the NAIF SPK code to use when reading from SPK kernels.
virtual void instrumentBodyFixedPosition(double p[3]) const
Returns the spacecraft position in body-fixed frame km units.
virtual Target * target() const
Returns a pointer to the target object.
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
virtual SpicePosition * instrumentPosition() const
Accessor method for the instrument position.
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
SpiceDouble m_uB[3]
This contains the sun position (u) in the bodyfixed reference frame (B).
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
virtual void subSpacecraftPoint(double &lat, double &lon)
Returns the sub-spacecraft latitude/longitude in universal coordinates (0-360 positive east,...
This class defines a body-fixed surface point.
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
Base class for Map TProjections.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
const double DEG2RAD
Multiplier for converting from degrees to radians.
const double Null
Value for an Isis Null pixel.
const double HALFPI
The mathematical constant PI/2.
const double RAD2DEG
Multiplier for converting from radians to degrees.
double toDouble(const QString &string)
Global function to convert from a string to a double.
const double PI
The mathematical constant PI.
Namespace for the standard library.