273 cvp->viewportToCube(p.x(), p.y(), sample, line);
274 int isample = int (sample + 0.5);
275 int iline = int (line + 0.5);
279 if(cvp->isLinked()) {
292 QTableWidgetItem *item =
new QTableWidgetItem(
"");
304 if(sample < 0.5)
return;
305 if(line < 0.5)
return;
306 if(sample > cvp->cubeSamples() + 0.5)
return;
307 if(line > cvp->cubeLines() + 0.5)
return;
324 QString fnamePath = fname.path();
325 QString fnameName = fname.name();
328 if (!cvp->cube()->hasGroup(
"Tracking") && !cvp->cube()->hasTable(
"InputImages")){
333 if((sample < 0.5) || (line < 0.5) ||
334 (sample > cvp->cubeSamples() + 0.5) ||
335 (line > cvp->cubeLines() + 0.5)) {
350 if(cvp->camera() != NULL) {
351 if(cvp->camera()->SetImage(sample, line)) {
352 if (cvp->camera()->target()->isSky()) {
353 double dec = cvp->camera()->Declination();
354 double ra = cvp->camera()->RightAscension();
356 setText(QString::number(ra,
'f', 15));
358 setText(QString::number(dec,
'f', 15));
362 double lat = cvp->camera()->UniversalLatitude();
363 double lon = cvp->camera()->UniversalLongitude();
365 double radius = cvp->camera()->LocalRadius().meters();
367 setText(QString::number(lat,
'f', 15));
369 setText(QString::number(lon,
'f', 15));
371 setText(QString::number(radius,
'f', 15));
379 while(lon < 0.0) lon += 360.0;
381 cvp->camera()->radii(radii);
384 setText(QString::number(lat,
'f', 15));
386 setText(QString::number(lon,
'f', 15));
394 cvp->camera()->Coordinate(pos);
400 double res = cvp->camera()->PixelResolution();
409 double obliquePRes = cvp->camera()->ObliquePixelResolution();
412 setText(QString::number(obliquePRes));
419 double phase = cvp->camera()->PhaseAngle();
421 double incidence = cvp->camera()->IncidenceAngle();
423 double emission = cvp->camera()->EmissionAngle();
430 Angle phaseAngle, incidenceAngle, emissionAngle;
431 bool bSuccess =
false;
432 cvp->camera()->LocalPhotometricAngles(phaseAngle, incidenceAngle, emissionAngle, bSuccess);
435 setText(QString::number(incidenceAngle.
degrees()));
437 setText(QString::number(emissionAngle.
degrees()));
446 double northAzi = cvp->camera()->NorthAzimuth();
447 if (cvp->camera()->target()->shape()->name() !=
"Plane"
450 setText(QString::number(northAzi));
458 double sunAzi = cvp->camera()->SunAzimuth();
461 setText(QString::number(sunAzi));
472 double spacecraftAzi = cvp->camera()->SpacecraftAzimuth();
475 setText(QString::number(spacecraftAzi));
483 double solarLon = cvp->camera()->solarLongitude().degrees();
485 setText(QString::number(solarLon));
492 double slantDistance = cvp->camera()->SlantDistance();
494 setText(QString::number(slantDistance));
496 double lst = cvp->camera()->LocalSolarTime();
498 setText(QString::number(lst));
509 if (cvp->camera()->DistortionMap() != NULL) {
513 setText(QString::number(undistortedFocalPlaneX));
514 double undistortedFocalPlaneY = distortedMap->UndistortedFocalPlaneY();
516 setText(QString::number(undistortedFocalPlaneY));
517 double undistortedFocalPlaneZ = distortedMap->UndistortedFocalPlaneZ();
519 setText(QString::number(undistortedFocalPlaneZ));
531 if (cvp->camera()->FocalPlaneMap() != NULL) {
533 double distortedFocalPlaneX = focalPlaneMap->
FocalPlaneX();
535 setText(QString::number(distortedFocalPlaneX));
536 double distortedFocalPlaneY = focalPlaneMap->FocalPlaneY();
538 setText(QString::number(distortedFocalPlaneY));
549 double ra = cvp->camera()->RightAscension();
551 double dec = cvp->camera()->Declination();
555 iTime time(cvp->camera()->time());
557 setText(QString::number(time.
Et(),
'f', 15));
558 QString time_utc = time.
UTC();
563 cvp->camera()->instrumentPosition(pos);
569 else if (cvp->projection() != NULL) {
573 if (cvp->projection()->SetWorld(sample, line)) {
577 double lon = tproj->UniversalLongitude();
579 double glat = tproj->ToPlanetographic(lat);
581 while(wlon < 0.0) wlon += 360.0;
582 if (tproj->IsSky()) {
583 lon = tproj->Longitude();
585 setText(QString::number(lon,
'f', 15));
587 setText(QString::number(lat,
'f', 15));
590 double radius = tproj->LocalRadius();
592 setText(QString::number(lat,
'f', 15));
594 setText(QString::number(glat,
'f', 15));
596 setText(QString::number(lon,
'f', 15));
600 setText(QString::number(wlon,
'f', 15));
609 double lon = rproj->UniversalRingLongitude();
612 while(wlon < 0.0) wlon += 360.0;
617 setText(QString::number(lon,
'f', 15));
621 setText(QString::number(wlon,
'f', 15));
625 setText(QString::number(radius,
'f', 15));
631 if(cvp->projection() != NULL) {
632 if(cvp->projection()->SetWorld(sample, line)) {
633 double projX = cvp->projection()->XCoord();
634 double projY = cvp->projection()->YCoord();
636 setText(QString::number(projX,
'f', 15));
638 setText(QString::number(projY,
'f', 15));
643 if (cvp->cube()->hasTable(
"InputImages") || cvp->cube()->hasGroup(
"Tracking")) {
644 int iMosaicOrigin = -1;
645 QString sSrcFileName =
"";
646 QString sSrcSerialNum =
"";
647 TrackMosaicOrigin(cvp, iline, isample, iMosaicOrigin, sSrcFileName, sSrcSerialNum);
649 setText(QString::number(iMosaicOrigin));
651 setText(QString(sSrcFileName));
653 setText(QString(sSrcSerialNum));
675 int piSample,
int &piOrigin, QString &psSrcFileName,
676 QString &psSrcSerialNum) {
678 Cube *cCube = cvp->cube();
682 if(cCube->hasGroup(
"Tracking") ||
683 (cCube->hasTable(trackingTableName) && cCube->bandCount() == 1)) {
685 if(cCube->hasGroup(
"Tracking")) {
686 trackingCube = cvp->trackingCube();
689 trackingCube = cCube;
694 trackingPortal.SetPosition(piSample, piLine, 1);
695 trackingCube->
read(trackingPortal);
697 unsigned int currentPixel = trackingPortal[0];
698 if (currentPixel != NULLUI4) {
702 FileName trackingFileName = trackingTable.pixelToFileName(currentPixel);
703 psSrcFileName = trackingFileName.
name();
704 psSrcSerialNum = trackingTable.pixelToSN(currentPixel);
705 piOrigin = trackingTable.fileNameToIndex(trackingFileName, psSrcSerialNum);
709 else if(cCube->hasTable(trackingTableName)) {
710 Pvl *cPvl = cCube->label();
712 PvlGroup cGrpBandBin = cObjIsisCube.findGroup(
"BandBin");
713 for(
int i = 0; i < cGrpBandBin.keywords(); i++) {
715 for(
int j = 0; j < cKeyTrackBand.size(); j++) {
716 if(cKeyTrackBand[j] ==
"TRACKING") {
723 if(iTrackBand > 0 && iTrackBand <= cCube->bandCount()) {
724 Portal cOrgPortal(cCube->sampleCount(), 1,
726 cOrgPortal.SetPosition(piSample, piLine, iTrackBand + 1);
727 cCube->read(cOrgPortal);
728 piOrigin = (int)cOrgPortal[0];
729 switch(
SizeOf(cCube->pixelType())) {
731 piOrigin -= VALID_MIN1;
735 piOrigin -= VALID_MIN2;
739 piOrigin -= FLOAT_MIN;
744 Table cFileTable = cCube->readTable(trackingTableName);
745 int iRecs = cFileTable.
Records();
746 if(piOrigin >= 0 && piOrigin < iRecs) {
747 psSrcFileName = QString(cFileTable[piOrigin][0]);
748 psSrcSerialNum = QString(cFileTable[piOrigin][1]);
760 if (piOrigin == -1) {
761 psSrcFileName =
"N/A";
762 psSrcSerialNum =
"N/A";
void addToTable(bool setOn, const QString &heading, const QString &menuText="", int insertAt=-1, Qt::Orientation o=Qt::Horizontal, QString toolTip="")
Adds a new column to the table when a new curve is added to the plot.