7#include "CameraPointInfo.h"
15#include "CameraFocalPlaneMap.h"
17#include "CubeManager.h"
19#include "IException.h"
23#include "SpecialPixel.h"
24#include "TProjection.h"
95 const bool allowOutside,
const bool allowErrors) {
97 bool passed =
m_camera->SetImage(sample, line);
139 const bool allowOutside,
140 const bool allowErrors) {
163 const bool allowOutside,
164 const bool allowErrors) {
188 const bool allowOutside,
const bool allowErrors) {
190 bool passed =
m_camera->SetUniversalGround(latitude, longitude);
206 string msg =
"Please set a cube before setting parameters";
338 bool noErrors = passed;
340 if (!
m_camera->HasSurfaceIntersection()) {
341 error =
"Requested position does not project in camera model; no surface intersection";
345 if (!
m_camera->InCube() && !allowOutside) {
346 error =
"Requested position does not project in camera model; not inside cube";
352 for (
int i = 0; i < gp->
keywords(); i++) {
353 QString name = (*gp)[i].name();
355 if (name ==
"BodyFixedCoordinate" || name ==
"SpacecraftPosition" ||
356 name ==
"SunPosition") {
357 (*gp)[i].addValue(
"NULL");
358 (*gp)[i].addValue(
"NULL");
359 (*gp)[i].addValue(
"NULL");
362 (*gp)[i].setValue(
"NULL");
366 double spB[3], sB[3];
385 std::vector<double>lookB =
m_camera->lookDirectionBodyFixed();
391 std::vector<double>lookJ =
m_camera->lookDirectionJ2000();
424 QString utc =
m_camera->time().UTC();
434 int intSamp = (int)(
m_camera->Sample() + 0.5);
435 int intLine = (int)(
m_camera->Line() + 0.5);
439 double pB[3], spB[3], sB[3];
441 double ssplat, ssplon, ocentricLat, ographicLat, pe360Lon, pw360Lon;
450 m_camera->RightAscension()),
"DEGREE");
457 m_camera->Declination()),
"DEGREE");
462 ocentricLat =
m_camera->UniversalLatitude();
469 radii[0].kilometers(),
470 radii[2].kilometers());
473 pe360Lon =
m_camera->UniversalLongitude();
494 m_camera->LocalRadius().meters()),
"meters");
496 m_camera->SampleResolution()),
"meters/pixel");
498 m_camera->LineResolution()),
"meters/pixel");
517 double spacecraftAzi =
m_camera->SpacecraftAzimuth();
528 m_camera->targetCenterDistance()),
"km");
529 m_camera->subSpacecraftPoint(ssplat, ssplon);
533 m_camera->SpacecraftAltitude()),
"km");
535 m_camera->OffNadirAngle()),
"DEGREE");
557 double sunAzi =
m_camera->SunAzimuth();
578 m_camera->subSolarPoint(sslat, sslon);
601 m_camera->IncidenceAngle()),
"DEGREE");
603 m_camera->EmissionAngle()),
"DEGREE");
605 double northAzi =
m_camera->NorthAzimuth();
620 m_camera->LocalSolarTime()),
"hour");
627 m_camera->solarLongitude().degrees()),
"DEGREE");
633 std::vector<double>lookB =
m_camera->lookDirectionBodyFixed();
637 gp->
findKeyword(
"LookDirectionBodyFixed").
addComment(
"Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems.");
640 std::vector<double>lookJ =
m_camera->lookDirectionJ2000();
Buffer for containing a three dimensional section of an image.
void SetBasePosition(const int start_sample, const int start_line, const int start_band)
This method is used to set the base position of the shape buffer.
void SetCSVOutput(bool csvOutput)
Set the output format (true is CSV, false is PVL)
Camera * m_camera
The camera to extract point information from.
virtual PvlGroup * GetPointInfo(bool passed, bool outside, bool errors)
GetPointInfo builds the PvlGroup containing all the important information derived from the Camera.
CubeManager * m_usedCubes
The cubeManager used to open the current cube.
Camera * camera()
Retrieves a pointer to the camera.
PvlGroup * SetCenter(const bool outside=false, const bool error=false)
SetCenter sets the image coordinates to the center of the image.
Cube * cube()
Retrieves a pointer to the current cube.
CameraPointInfo()
Constructor, initializes CubeManager and other variables for use.
bool m_csvOutput
Boolean to keep track of output format (CSV or PVL)
PvlGroup * SetSample(const double sample, const bool outside=false, const bool error=false)
SetSample sets the image coordinates to the center line and the given sample.
PvlGroup * SetGround(const double latitude, const double longitude, const bool outside=false, const bool error=false)
SetGround sets a latitude, longitude grrund coordinate in the camera so data can be accessed.
bool CheckCube()
CheckCube checks that a cube has been set before the data for a point is accessed.
virtual ~CameraPointInfo()
Destructor, deletes CubeManager object used.
PvlGroup * SetImage(const double sample, const double line, const bool outside=false, const bool error=false)
SetImage sets a sample, line image coordinate in the camera so data can be accessed.
PvlGroup * SetLine(const double line, const bool outside=false, const bool error=false)
SetLine sets the image coordinates to the center sample and the given line.
void SetCube(const QString &cubeFileName)
SetCube opens the given cube in a CubeManager.
Cube * m_currentCube
The cube to extract camera information from.
IO Handler for Isis Cubes.
Class for quick re-accessing of cubes based on file name.
Distance measurement, usually in meters.
@ Unknown
A type of error that cannot be classified as any of the other error types.
@ Programmer
This error is for when a programmer made an API call that was illegal.
int keywords() const
Returns the number of keywords contained in the PvlContainer.
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Contains multiple PvlContainers.
A single keyword-value pair.
void setValue(QString value, QString unit="")
Sets new values.
void addComment(QString comment)
Add a comment to the PvlKeyword.
void addValue(QString value, QString unit="")
Adds a value with units.
static double To180Domain(const double lon)
This method converts a longitude into the -180 to 180 domain.
static double ToPositiveWest(const double lon, const int domain)
This method converts a longitude into the positive west direction.
double ToPlanetographic(const double lat) const
This method converts a planetocentric latitude to a planetographic latitude.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
bool IsValidPixel(const double d)
Returns if the input pixel is valid.
QString PixelToString(double d, double precision=8)
Takes a double pixel value and returns the name of the pixel type as a string.
Namespace for the standard library.