Isis 3 Programmer Reference
CameraPointInfo.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include "CameraPointInfo.h"
8
9#include <QDebug>
10
11#include <iomanip>
12
13#include "Brick.h"
14#include "Camera.h"
15#include "CameraFocalPlaneMap.h"
16#include "Cube.h"
17#include "CubeManager.h"
18#include "Distance.h"
19#include "IException.h"
20#include "iTime.h"
21#include "Longitude.h"
22#include "PvlGroup.h"
23#include "SpecialPixel.h"
24#include "TProjection.h"
25
26using namespace Isis;
27using namespace std;
28
29namespace Isis {
30
31
37 m_usedCubes = NULL;
40 m_currentCube = NULL;
41 m_camera = NULL;
42 m_csvOutput = false;
43 }
44
50 void CameraPointInfo::SetCSVOutput(bool csvOutput) {
51
52 m_csvOutput = csvOutput;
53
54 }
55
61 if (m_usedCubes) {
62 delete m_usedCubes;
63 m_usedCubes = NULL;
64 }
65 }
66
67
75 void CameraPointInfo::SetCube(const QString &cubeFileName) {
76 m_currentCube = m_usedCubes->OpenCube(cubeFileName);
78 }
79
80
94 PvlGroup *CameraPointInfo::SetImage(const double sample, const double line,
95 const bool allowOutside, const bool allowErrors) {
96 if (CheckCube()) {
97 bool passed = m_camera->SetImage(sample, line);
98 return GetPointInfo(passed, allowOutside, allowErrors);
99 }
100 // Should never get here, error will be thrown in CheckCube()
101 return NULL;
102 }
103
104
115 PvlGroup *CameraPointInfo::SetCenter(const bool allowOutside, const bool allowErrors) {
116 if (CheckCube()) {
117 bool passed = m_camera->SetImage(m_currentCube->sampleCount() / 2.0,
118 m_currentCube->lineCount() / 2.0);
119 return GetPointInfo(passed, allowOutside, allowErrors);
120 }
121 // Should never get here, error will be thrown in CheckCube()
122 return NULL;
123 }
124
125
139 const bool allowOutside,
140 const bool allowErrors) {
141 if (CheckCube()) {
142 bool passed = m_camera->SetImage(sample, m_currentCube->lineCount() / 2.0);
143 return GetPointInfo(passed, allowOutside, allowErrors);
144 }
145 // Should never get here, error will be thrown in CheckCube()
146 return NULL;
147 }
148
149
163 const bool allowOutside,
164 const bool allowErrors) {
165 if (CheckCube()) {
166 bool passed = m_camera->SetImage(m_currentCube->sampleCount() / 2.0, line);
167 return GetPointInfo(passed, allowOutside, allowErrors);
168 }
169 // Should never get here, error will be thrown in CheckCube()
170 return NULL;
171 }
172
173
187 PvlGroup *CameraPointInfo::SetGround(const double latitude, const double longitude,
188 const bool allowOutside, const bool allowErrors) {
189 if (CheckCube()) {
190 bool passed = m_camera->SetUniversalGround(latitude, longitude);
191 return GetPointInfo(passed, allowOutside, allowErrors);
192 }
193 // Should never get here, error will be thrown in CheckCube()
194 return NULL;
195 }
196
197
205 if (m_currentCube == NULL) {
206 string msg = "Please set a cube before setting parameters";
207 throw IException(IException::Programmer, msg, _FILEINFO_);
208 return false;
209 }
210 return true;
211 }
212
213
227 PvlGroup *CameraPointInfo::GetPointInfo(bool passed, bool allowOutside, bool allowErrors) {
228 PvlGroup *gp = new PvlGroup("GroundPoint");
229
230 //Outputting in PVL format
231 if(!m_csvOutput)
232 {
233 gp->addKeyword(PvlKeyword("Filename"));
234 gp->addKeyword(PvlKeyword("Sample"));
235 gp->addKeyword(PvlKeyword("Line"));
236 gp->addKeyword(PvlKeyword("PixelValue"));
237 gp->addKeyword(PvlKeyword("RightAscension"));
238 gp->addKeyword(PvlKeyword("Declination"));
239 gp->addKeyword(PvlKeyword("PlanetocentricLatitude"));
240 gp->addKeyword(PvlKeyword("PlanetographicLatitude"));
241 gp->addKeyword(PvlKeyword("PositiveEast360Longitude"));
242 gp->addKeyword(PvlKeyword("PositiveEast180Longitude"));
243 gp->addKeyword(PvlKeyword("PositiveWest360Longitude"));
244 gp->addKeyword(PvlKeyword("PositiveWest180Longitude"));
245 gp->addKeyword(PvlKeyword("BodyFixedCoordinate"));
246 gp->addKeyword(PvlKeyword("LocalRadius"));
247 gp->addKeyword(PvlKeyword("SampleResolution"));
248 gp->addKeyword(PvlKeyword("LineResolution"));
249 gp->addKeyword(PvlKeyword("ObliqueDetectorResolution"));
250 gp->addKeyword(PvlKeyword("ObliquePixelResolution"));
251 gp->addKeyword(PvlKeyword("ObliqueLineResolution"));
252 gp->addKeyword(PvlKeyword("ObliqueSampleResolution"));
253 gp->addKeyword(PvlKeyword("SpacecraftPosition"));
254 gp->addKeyword(PvlKeyword("SpacecraftAzimuth"));
255 gp->addKeyword(PvlKeyword("SlantDistance"));
256 gp->addKeyword(PvlKeyword("TargetCenterDistance"));
257 gp->addKeyword(PvlKeyword("SubSpacecraftLatitude"));
258 gp->addKeyword(PvlKeyword("SubSpacecraftLongitude"));
259 gp->addKeyword(PvlKeyword("SpacecraftAltitude"));
260 gp->addKeyword(PvlKeyword("OffNadirAngle"));
261 gp->addKeyword(PvlKeyword("SubSpacecraftGroundAzimuth"));
262 gp->addKeyword(PvlKeyword("SunPosition"));
263 gp->addKeyword(PvlKeyword("SubSolarAzimuth"));
264 gp->addKeyword(PvlKeyword("SolarDistance"));
265 gp->addKeyword(PvlKeyword("SubSolarLatitude"));
266 gp->addKeyword(PvlKeyword("SubSolarLongitude"));
267 gp->addKeyword(PvlKeyword("SubSolarGroundAzimuth"));
268 gp->addKeyword(PvlKeyword("Phase"));
269 gp->addKeyword(PvlKeyword("Incidence"));
270 gp->addKeyword(PvlKeyword("Emission"));
271 gp->addKeyword(PvlKeyword("NorthAzimuth"));
272 gp->addKeyword(PvlKeyword("EphemerisTime"));
273 gp->addKeyword(PvlKeyword("UTC"));
274 gp->addKeyword(PvlKeyword("LocalSolarTime"));
275 gp->addKeyword(PvlKeyword("SolarLongitude"));
276 gp->addKeyword(PvlKeyword("LookDirectionBodyFixed"));
277 gp->addKeyword(PvlKeyword("LookDirectionJ2000"));
278 gp->addKeyword(PvlKeyword("LookDirectionCamera"));
279
280 if (allowErrors) gp->addKeyword(PvlKeyword("Error"));
281 }
282
283 else {
284
285 gp->addKeyword(PvlKeyword("Filename"));
286 gp->addKeyword(PvlKeyword("Sample"));
287 gp->addKeyword(PvlKeyword("Line"));
288 gp->addKeyword(PvlKeyword("PixelValue"));
289 gp->addKeyword(PvlKeyword("RightAscension"));
290 gp->addKeyword(PvlKeyword("Declination"));
291 gp->addKeyword(PvlKeyword("PlanetocentricLatitude"));
292 gp->addKeyword(PvlKeyword("PlanetographicLatitude"));
293 gp->addKeyword(PvlKeyword("PositiveEast360Longitude"));
294 gp->addKeyword(PvlKeyword("PositiveEast180Longitude"));
295 gp->addKeyword(PvlKeyword("PositiveWest360Longitude"));
296 gp->addKeyword(PvlKeyword("PositiveWest180Longitude"));
297 gp->addKeyword(PvlKeyword("BodyFixedCoordinate"));
298 gp->addKeyword(PvlKeyword("LocalRadius"));
299 gp->addKeyword(PvlKeyword("SampleResolution"));
300 gp->addKeyword(PvlKeyword("LineResolution"));
301 gp->addKeyword(PvlKeyword("SpacecraftPosition"));
302 gp->addKeyword(PvlKeyword("SpacecraftAzimuth"));
303 gp->addKeyword(PvlKeyword("SlantDistance"));
304 gp->addKeyword(PvlKeyword("TargetCenterDistance"));
305 gp->addKeyword(PvlKeyword("SubSpacecraftLatitude"));
306 gp->addKeyword(PvlKeyword("SubSpacecraftLongitude"));
307 gp->addKeyword(PvlKeyword("SpacecraftAltitude"));
308 gp->addKeyword(PvlKeyword("OffNadirAngle"));
309 gp->addKeyword(PvlKeyword("SubSpacecraftGroundAzimuth"));
310 gp->addKeyword(PvlKeyword("SunPosition"));
311 gp->addKeyword(PvlKeyword("SubSolarAzimuth"));
312 gp->addKeyword(PvlKeyword("SolarDistance"));
313 gp->addKeyword(PvlKeyword("SubSolarLatitude"));
314 gp->addKeyword(PvlKeyword("SubSolarLongitude"));
315 gp->addKeyword(PvlKeyword("SubSolarGroundAzimuth"));
316 gp->addKeyword(PvlKeyword("Phase"));
317 gp->addKeyword(PvlKeyword("Incidence"));
318 gp->addKeyword(PvlKeyword("Emission"));
319 gp->addKeyword(PvlKeyword("NorthAzimuth"));
320 gp->addKeyword(PvlKeyword("EphemerisTime"));
321 gp->addKeyword(PvlKeyword("UTC"));
322 gp->addKeyword(PvlKeyword("LocalSolarTime"));
323 gp->addKeyword(PvlKeyword("SolarLongitude"));
324 gp->addKeyword(PvlKeyword("LookDirectionBodyFixed"));
325 gp->addKeyword(PvlKeyword("LookDirectionJ2000"));
326 gp->addKeyword(PvlKeyword("LookDirectionCamera"));
327 gp->addKeyword(PvlKeyword("ObliqueDetectorResolution"));
328 gp->addKeyword(PvlKeyword("ObliquePixelResolution"));
329 gp->addKeyword(PvlKeyword("ObliqueLineResolution"));
330 gp->addKeyword(PvlKeyword("ObliqueSampleResolution"));
331 if (allowErrors) gp->addKeyword(PvlKeyword("Error"));
332
333
334
335
336 }
337
338 bool noErrors = passed;
339 QString error = "";
341 error = "Requested position does not project in camera model; no surface intersection";
342 noErrors = false;
343 if (!allowErrors) throw IException(IException::Unknown, error, _FILEINFO_);
344 }
345 if (!m_camera->InCube() && !allowOutside) {
346 error = "Requested position does not project in camera model; not inside cube";
347 noErrors = false;
348 if (!allowErrors) throw IException(IException::Unknown, error, _FILEINFO_);
349 }
350
351 if (!noErrors) {
352 for (int i = 0; i < gp->keywords(); i++) {
353 QString name = (*gp)[i].name();
354 // These three keywords have 3 values, so they must have 3 NULLs
355 if (name == "BodyFixedCoordinate" || name == "SpacecraftPosition" ||
356 name == "SunPosition") {
357 (*gp)[i].addValue("NULL");
358 (*gp)[i].addValue("NULL");
359 (*gp)[i].addValue("NULL");
360 }
361 else {
362 (*gp)[i].setValue("NULL");
363 }
364 }
365 // Set all keywords that still have valid information
366 gp->findKeyword("Error").setValue(error);
367 gp->findKeyword("FileName").setValue(m_currentCube->fileName());
368 gp->findKeyword("Sample").setValue(toString(m_camera->Sample()));
369 gp->findKeyword("Line").setValue(toString(m_camera->Line()));
370 gp->findKeyword("EphemerisTime").setValue(
371 toString(m_camera->time().Et()), "seconds");
372 gp->findKeyword("EphemerisTime").addComment("Time");
373 QString utc = m_camera->time().UTC();
374 gp->findKeyword("UTC").setValue(utc);
375 gp->findKeyword("SpacecraftPosition").addComment("Spacecraft Information");
376 gp->findKeyword("SunPosition").addComment("Sun Information");
377 gp->findKeyword("Phase").addComment("Illumination and Other");
378 }
379 else {
380
381 Brick b(3, 3, 1, m_currentCube->pixelType());
382
383 int intSamp = (int)(m_camera->Sample() + 0.5);
384 int intLine = (int)(m_camera->Line() + 0.5);
385 b.SetBasePosition(intSamp, intLine, 1);
387
388 double pB[3], spB[3], sB[3];
389 QString utc;
390 double ssplat, ssplon, ocentricLat, ographicLat, pe360Lon, pw360Lon;
391
392 {
393 gp->findKeyword("FileName").setValue(m_currentCube->fileName());
394 gp->findKeyword("Sample").setValue(toString(m_camera->Sample()));
395 gp->findKeyword("Line").setValue(toString(m_camera->Line()));
396 gp->findKeyword("PixelValue").setValue(PixelToString(b[0]));
397 try {
398 gp->findKeyword("RightAscension").setValue(toString(
399 m_camera->RightAscension()), "DEGREE");
400 }
401 catch (IException &e) {
402 gp->findKeyword("RightAscension").setValue("Null");
403 }
404 try {
405 gp->findKeyword("Declination").setValue(toString(
406 m_camera->Declination()), "DEGREE");
407 }
408 catch (IException &e) {
409 gp->findKeyword("Declination").setValue("Null");
410 }
411 ocentricLat = m_camera->UniversalLatitude();
412 gp->findKeyword("PlanetocentricLatitude").setValue(toString(ocentricLat), "DEGREE");
413
414 // Convert lat to planetographic
415 Distance radii[3];
416 m_camera->radii(radii);
417 ographicLat = TProjection::ToPlanetographic(ocentricLat,
418 radii[0].kilometers(),
419 radii[2].kilometers());
420 gp->findKeyword("PlanetographicLatitude").setValue(toString(ographicLat), "DEGREE");
421
422 pe360Lon = m_camera->UniversalLongitude();
423 gp->findKeyword("PositiveEast360Longitude").setValue(toString(pe360Lon), "DEGREE");
424
425 //Convert lon to -180 - 180 range
426 gp->findKeyword("PositiveEast180Longitude").setValue(toString(
427 TProjection::To180Domain(pe360Lon)), "DEGREE");
428
429 //Convert lon to positive west
430 pw360Lon = TProjection::ToPositiveWest(pe360Lon, 360);
431 gp->findKeyword("PositiveWest360Longitude").setValue(toString(pw360Lon), "DEGREE");
432
433 //Convert pwlon to -180 - 180 range
434 gp->findKeyword("PositiveWest180Longitude").setValue(
435 toString( TProjection::To180Domain(pw360Lon)), "DEGREE");
436
437 m_camera->Coordinate(pB);
438 gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[0]), "km");
439 gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[1]), "km");
440 gp->findKeyword("BodyFixedCoordinate").addValue(toString(pB[2]), "km");
441
442 gp->findKeyword("LocalRadius").setValue(toString(
443 m_camera->LocalRadius().meters()), "meters");
444 gp->findKeyword("SampleResolution").setValue(toString(
445 m_camera->SampleResolution()), "meters/pixel");
446 gp->findKeyword("LineResolution").setValue(toString(
447 m_camera->LineResolution()), "meters/pixel");
448
449 gp->findKeyword("ObliqueDetectorResolution").setValue(
451 gp->findKeyword("ObliqueLineResolution").setValue(
453 gp->findKeyword("ObliqueSampleResolution").setValue(
455 gp->findKeyword("ObliquePixelResolution").setValue(
456 toString(m_camera->ObliquePixelResolution()), "meters/pix");
457
458
459 //body fixed
461 gp->findKeyword("SpacecraftPosition").addValue(toString(spB[0]), "km");
462 gp->findKeyword("SpacecraftPosition").addValue(toString(spB[1]), "km");
463 gp->findKeyword("SpacecraftPosition").addValue(toString(spB[2]), "km");
464 gp->findKeyword("SpacecraftPosition").addComment("Spacecraft Information");
465
466 double spacecraftAzi = m_camera->SpacecraftAzimuth();
467 if (Isis::IsValidPixel(spacecraftAzi)) {
468 gp->findKeyword("SpacecraftAzimuth").setValue(toString(spacecraftAzi), "DEGREE");
469 }
470 else {
471 gp->findKeyword("SpacecraftAzimuth").setValue("NULL");
472 }
473
474 gp->findKeyword("SlantDistance").setValue(toString(
475 m_camera->SlantDistance()), "km");
476 gp->findKeyword("TargetCenterDistance").setValue(toString(
478 m_camera->subSpacecraftPoint(ssplat, ssplon);
479 gp->findKeyword("SubSpacecraftLatitude").setValue(toString(ssplat), "DEGREE");
480 gp->findKeyword("SubSpacecraftLongitude").setValue(toString(ssplon), "DEGREE");
481 gp->findKeyword("SpacecraftAltitude").setValue(toString(
482 m_camera->SpacecraftAltitude()), "km");
483 gp->findKeyword("OffNadirAngle").setValue(toString(
484 m_camera->OffNadirAngle()), "DEGREE");
485 double subspcgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(),
487 ssplat, ssplon);
488 gp->findKeyword("SubSpacecraftGroundAzimuth").setValue(
489 toString(subspcgrdaz), "DEGREE");
490
491 try {
493 gp->findKeyword("SunPosition").addValue(toString(sB[0]), "km");
494 gp->findKeyword("SunPosition").addValue(toString(sB[1]), "km");
495 gp->findKeyword("SunPosition").addValue(toString(sB[2]), "km");
496 gp->findKeyword("SunPosition").addComment("Sun Information");
497 }
498 catch (IException &e) {
499 gp->findKeyword("SunPosition").addValue("Null");
500 gp->findKeyword("SunPosition").addValue("Null");
501 gp->findKeyword("SunPosition").addValue("Null");
502 gp->findKeyword("SunPosition").addComment("Sun Information");
503 }
504
505 try {
506 double sunAzi = m_camera->SunAzimuth();
507 if (Isis::IsValidPixel(sunAzi)) {
508 gp->findKeyword("SubSolarAzimuth").setValue(toString(sunAzi), "DEGREE");
509 }
510 else {
511 gp->findKeyword("SubSolarAzimuth").setValue("NULL");
512 }
513 }
514 catch(IException &e) {
515 gp->findKeyword("SubSolarAzimuth").setValue("NULL");
516 }
517
518 try {
519 gp->findKeyword("SolarDistance").setValue(toString(
520 m_camera->SolarDistance()), "AU");
521 }
522 catch(IException &e) {
523 gp->findKeyword("SolarDistance").setValue("NULL");
524 }
525 try {
526 double sslat, sslon;
527 m_camera->subSolarPoint(sslat, sslon);
528 gp->findKeyword("SubSolarLatitude").setValue(toString(sslat), "DEGREE");
529 gp->findKeyword("SubSolarLongitude").setValue(toString(sslon), "DEGREE");
530
531 try {
532 double subsolgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(),
534 sslat, sslon);
535 gp->findKeyword("SubSolarGroundAzimuth").setValue(toString(subsolgrdaz), "DEGREE");
536 }
537 catch(IException &e) {
538 gp->findKeyword("SubSolarGroundAzimuth").setValue("NULL");
539 }
540 }
541 catch(IException &e) {
542 gp->findKeyword("SubSolarLatitude").setValue("NULL");
543 gp->findKeyword("SubSolarLongitude").setValue("NULL");
544 gp->findKeyword("SubSolarGroundAzimuth").setValue("NULL");
545 }
546
547 gp->findKeyword("Phase").setValue(toString(m_camera->PhaseAngle()), "DEGREE");
548 gp->findKeyword("Phase").addComment("Illumination and Other");
549 gp->findKeyword("Incidence").setValue(toString(
550 m_camera->IncidenceAngle()), "DEGREE");
551 gp->findKeyword("Emission").setValue(toString(
552 m_camera->EmissionAngle()), "DEGREE");
553
554 double northAzi = m_camera->NorthAzimuth();
555 if (Isis::IsValidPixel(northAzi)) {
556 gp->findKeyword("NorthAzimuth").setValue(toString(northAzi), "DEGREE");
557 }
558 else {
559 gp->findKeyword("NorthAzimuth").setValue("NULL");
560 }
561
562 gp->findKeyword("EphemerisTime").setValue(toString(
563 m_camera->time().Et()), "seconds");
564 gp->findKeyword("EphemerisTime").addComment("Time");
565 utc = m_camera->time().UTC();
566 gp->findKeyword("UTC").setValue(utc);
567 try {
568 gp->findKeyword("LocalSolarTime").setValue(toString(
569 m_camera->LocalSolarTime()), "hour");
570 }
571 catch (IException &e) {
572 gp->findKeyword("LocalSolarTime").setValue("Null");
573 }
574 try {
575 gp->findKeyword("SolarLongitude").setValue(toString(
576 m_camera->solarLongitude().degrees()), "DEGREE");
577 }
578 catch (IException &e) {
579 gp->findKeyword("SolarLongitude").setValue("Null");
580 }
581
582 std::vector<double>lookB = m_camera->lookDirectionBodyFixed();
583 gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[0]), "DEGREE");
584 gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[1]), "DEGREE");
585 gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[2]), "DEGREE");
586 gp->findKeyword("LookDirectionBodyFixed").addComment("Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems.");
587
588 try {
589 std::vector<double>lookJ = m_camera->lookDirectionJ2000();
590 gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[0]), "DEGREE");
591 gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[1]), "DEGREE");
592 gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[2]), "DEGREE");
593 }
594 catch (IException &e) {
595 gp->findKeyword("LookDirectionJ2000").addValue("Null");
596 gp->findKeyword("LookDirectionJ2000").addValue("Null");
597 gp->findKeyword("LookDirectionJ2000").addValue("Null");
598 }
599
600 try {
601 double lookC[3];
602 m_camera->LookDirection(lookC);
603 gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[0]), "DEGREE");
604 gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[1]), "DEGREE");
605 gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[2]), "DEGREE");
606 }
607 catch (IException &e) {
608 gp->findKeyword("LookDirectionCamera").addValue("Null");
609 gp->findKeyword("LookDirectionCamera").addValue("Null");
610 gp->findKeyword("LookDirectionCamera").addValue("Null");
611 }
612
613
614 if (allowErrors) gp->findKeyword("Error").setValue("NULL");
615 }
616 }
617 return gp;
618 }
619
620
629
630
639}
640
Buffer for containing a three dimensional section of an image.
Definition Brick.h:45
double NorthAzimuth()
Returns the North Azimuth.
Definition Camera.cpp:1927
virtual double SampleResolution()
Returns the sample resolution at the current position in meters.
Definition Camera.cpp:640
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,...
Definition Camera.cpp:2267
double SpacecraftAzimuth()
Return the Spacecraft Azimuth.
Definition Camera.cpp:1968
virtual double Line() const
Returns the current line number.
Definition Camera.cpp:2740
double SunAzimuth()
Returns the Sun Azimuth.
Definition Camera.cpp:1954
virtual double ObliquePixelResolution(bool useLocal=true)
Returns the oblique pixel resolution at the current position in meters/pixel.
Definition Camera.cpp:696
virtual double Sample() const
Returns the current sample number.
Definition Camera.cpp:2720
double OffNadirAngle()
Return the off nadir angle in degrees.
Definition Camera.cpp:2229
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
Definition Camera.cpp:156
virtual double LineResolution()
Returns the line resolution at the current position in meters.
Definition Camera.cpp:660
bool InCube()
This returns true if the current Sample() or Line() value is outside of the cube (meaning the point m...
Definition Camera.cpp:2649
virtual bool SetUniversalGround(const double latitude, const double longitude)
Sets the lat/lon values to get the sample/line values.
Definition Camera.cpp:382
virtual double ObliqueLineResolution(bool useLocal=true)
Returns the oblique line resolution at the current position in meters.
Definition Camera.cpp:672
virtual double ObliqueSampleResolution(bool useLocal=true)
Returns the oblique sample resolution at the current position in m.
Definition Camera.cpp:650
virtual double ObliqueDetectorResolution(bool useLocal=true)
This method returns the Oblique Detector Resolution if the Look Vector intersects the target and if t...
Definition Camera.cpp:583
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.
Definition Cube.h:168
int lineCount() const
Definition Cube.cpp:1740
Camera * camera()
Return a camera associated with the cube.
Definition Cube.cpp:1457
int sampleCount() const
Definition Cube.cpp:1813
PixelType pixelType() const
Definition Cube.cpp:1764
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition Cube.cpp:813
virtual QString fileName() const
Returns the opened cube's filename.
Definition Cube.cpp:1569
Class for quick re-accessing of cubes based on file name.
Definition CubeManager.h:70
Cube * OpenCube(const QString &cubeFileName)
This method opens a cube.
void SetNumOpenCubes(unsigned int numCubes)
This sets the maximum number of opened cubes for this instance of CubeManager.
Distance measurement, usually in meters.
Definition Distance.h:34
double meters() const
Get the distance in meters.
Definition Distance.cpp:85
Isis exception class.
Definition IException.h:91
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition IException.h:118
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
Contains multiple PvlContainers.
Definition PvlGroup.h:41
A single keyword-value pair.
Definition PvlKeyword.h:87
double LocalSolarTime()
Return the local solar time in hours.
Definition Sensor.cpp:665
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
Definition Sensor.cpp:212
virtual double RightAscension()
Returns the right ascension angle (sky longitude).
Definition Sensor.cpp:565
virtual double SolarDistance() const
Returns the distance between the sun and surface point in AU.
Definition Sensor.cpp:682
bool HasSurfaceIntersection() const
Returns if the last call to either SetLookDirection or SetUniversalGround had a valid intersection wi...
Definition Sensor.cpp:188
virtual double SlantDistance() const
Return the distance between the spacecraft and surface point in kmv.
Definition Sensor.cpp:646
double SpacecraftAltitude()
Returns the distance from the spacecraft to the subspacecraft point in km.
Definition Sensor.cpp:703
virtual std::vector< double > lookDirectionBodyFixed() const
Returns the look direction in the body fixed coordinate system.
Definition Sensor.cpp:539
virtual std::vector< double > lookDirectionJ2000() const
Returns the look direction in the camera coordinate system.
Definition Sensor.cpp:553
virtual double PhaseAngle() const
Returns the phase angle in degrees.
Definition Sensor.cpp:314
virtual double IncidenceAngle() const
Returns the incidence angle in degrees.
Definition Sensor.cpp:339
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
Definition Sensor.cpp:235
void Coordinate(double p[3]) const
Returns the x,y,z of the surface intersection in BodyFixed km.
Definition Sensor.cpp:198
Distance LocalRadius() const
Returns the local radius at the intersection point.
Definition Sensor.cpp:269
virtual double Declination()
Returns the declination angle (sky latitude).
Definition Sensor.cpp:578
virtual double EmissionAngle() const
Returns the emission angle in degrees.
Definition Sensor.cpp:328
void LookDirection(double v[3]) const
Returns the look direction in the camera coordinate system.
Definition Sensor.cpp:527
virtual Longitude solarLongitude()
Returns the solar longitude.
Definition Spice.cpp:1521
virtual double targetCenterDistance() const
Calculates and returns the distance from the spacecraft to the target center.
Definition Spice.cpp:925
virtual void subSolarPoint(double &lat, double &lon)
Returns the sub-solar latitude/longitude in universal coordinates (0-360 positive east,...
Definition Spice.cpp:1341
void radii(Distance r[3]) const
Returns the radii of the body in km.
Definition Spice.cpp:937
void instrumentPosition(double p[3]) const
Returns the spacecraft position in body-fixed frame km units.
Definition Spice.cpp:829
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition Spice.cpp:891
virtual void sunPosition(double p[3]) const
Fills the input vector with sun position information, in either body-fixed or J2000 reference frame a...
Definition Spice.cpp:909
virtual void subSpacecraftPoint(double &lat, double &lon)
Returns the sub-spacecraft latitude/longitude in universal coordinates (0-360 positive east,...
Definition Spice.cpp:1290
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.
Definition Apollo.h:16
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition IString.cpp:211
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.