7 #include "CameraPointInfo.h"
15 #include "CameraFocalPlaneMap.h"
17 #include "CubeManager.h"
19 #include "IException.h"
21 #include "Longitude.h"
23 #include "SpecialPixel.h"
24 #include "TProjection.h"
39 m_usedCubes->SetNumOpenCubes(50);
52 m_csvOutput = csvOutput;
76 m_currentCube = m_usedCubes->OpenCube(cubeFileName);
77 m_camera = m_currentCube->camera();
95 const bool allowOutside,
const bool allowErrors) {
97 bool passed = m_camera->SetImage(sample, line);
98 return GetPointInfo(passed, allowOutside, allowErrors);
117 bool passed = m_camera->SetImage(m_currentCube->sampleCount() / 2.0,
118 m_currentCube->lineCount() / 2.0);
119 return GetPointInfo(passed, allowOutside, allowErrors);
139 const bool allowOutside,
140 const bool allowErrors) {
142 bool passed = m_camera->SetImage(sample, m_currentCube->lineCount() / 2.0);
143 return GetPointInfo(passed, allowOutside, allowErrors);
163 const bool allowOutside,
164 const bool allowErrors) {
166 bool passed = m_camera->SetImage(m_currentCube->sampleCount() / 2.0, line);
167 return GetPointInfo(passed, allowOutside, allowErrors);
188 const bool allowOutside,
const bool allowErrors) {
190 bool passed = m_camera->SetUniversalGround(latitude, longitude);
191 return GetPointInfo(passed, allowOutside, allowErrors);
205 if (m_currentCube == NULL) {
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");
371 toString(m_camera->time().Et()),
"seconds");
373 QString utc = m_camera->time().UTC();
381 Brick b(3, 3, 1, m_currentCube->pixelType());
383 int intSamp = (int)(m_camera->Sample() + 0.5);
384 int intLine = (int)(m_camera->Line() + 0.5);
386 m_currentCube->read(b);
388 double pB[3], spB[3], sB[3];
390 double ssplat, ssplon, ocentricLat, ographicLat, pe360Lon, pw360Lon;
399 m_camera->RightAscension()),
"DEGREE");
406 m_camera->Declination()),
"DEGREE");
411 ocentricLat = m_camera->UniversalLatitude();
416 m_camera->radii(radii);
418 radii[0].kilometers(),
419 radii[2].kilometers());
422 pe360Lon = m_camera->UniversalLongitude();
437 m_camera->Coordinate(pB);
443 m_camera->LocalRadius().meters()),
"meters");
445 m_camera->SampleResolution()),
"meters/pixel");
447 m_camera->LineResolution()),
"meters/pixel");
450 toString(m_camera->ObliqueDetectorResolution()),
"meters");
452 toString(m_camera->ObliqueLineResolution()),
"meters");
454 toString(m_camera->ObliqueSampleResolution()),
"meters");
456 toString(m_camera->ObliquePixelResolution()),
"meters/pix");
460 m_camera->instrumentPosition(spB);
466 double spacecraftAzi = m_camera->SpacecraftAzimuth();
475 m_camera->SlantDistance()),
"km");
477 m_camera->targetCenterDistance()),
"km");
478 m_camera->subSpacecraftPoint(ssplat, ssplon);
482 m_camera->SpacecraftAltitude()),
"km");
484 m_camera->OffNadirAngle()),
"DEGREE");
485 double subspcgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(),
486 m_camera->UniversalLongitude(),
492 m_camera->sunPosition(sB);
506 double sunAzi = m_camera->SunAzimuth();
520 m_camera->SolarDistance()),
"AU");
527 m_camera->subSolarPoint(sslat, sslon);
532 double subsolgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(),
533 m_camera->UniversalLongitude(),
550 m_camera->IncidenceAngle()),
"DEGREE");
552 m_camera->EmissionAngle()),
"DEGREE");
554 double northAzi = m_camera->NorthAzimuth();
563 m_camera->time().Et()),
"seconds");
565 utc = m_camera->time().UTC();
569 m_camera->LocalSolarTime()),
"hour");
576 m_camera->solarLongitude().degrees()),
"DEGREE");
582 std::vector<double>lookB = m_camera->lookDirectionBodyFixed();
586 gp->
findKeyword(
"LookDirectionBodyFixed").
addComment(
"Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems.");
589 std::vector<double>lookJ = m_camera->lookDirectionJ2000();
602 m_camera->LookDirection(lookC);
637 return m_currentCube;