File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
ControlPoint.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "IsisDebug.h"
10 #include "ControlPoint.h"
11 
12 #include <boost/numeric/ublas/symmetric.hpp>
13 #include <boost/numeric/ublas/io.hpp>
14 
15 #include <QDebug>
16 #include <QHash>
17 #include <QString>
18 #include <QStringList>
19 
20 #include "Application.h"
21 #include "CameraDetectorMap.h"
22 #include "CameraDistortionMap.h"
23 #include "CameraFocalPlaneMap.h"
24 #include "CameraGroundMap.h"
25 #include "ControlMeasure.h"
26 #include "ControlMeasureLogData.h"
27 #include "ControlNet.h"
28 #include "Cube.h"
29 #include "IString.h"
30 #include "Latitude.h"
31 #include "Longitude.h"
32 #include "PvlObject.h"
33 #include "SerialNumberList.h"
34 #include "SpecialPixel.h"
35 #include "Statistics.h"
36 
37 using boost::numeric::ublas::symmetric_matrix;
38 using boost::numeric::ublas::upper;
39 using namespace std;
40 
41 namespace Isis {
48  ControlPoint::ControlPoint() : invalid(false) {
49  measures = NULL;
50  cubeSerials = NULL;
51 
53  cubeSerials = new QStringList;
54 
55  type = Free;
56  dateTime = "";
57  editLock = false;
58  ignore = false;
59  jigsawRejected = false;
60  referenceExplicitlySet = false;
61  aprioriSurfacePointSource = SurfacePointSource::None;
62  aprioriRadiusSource = RadiusSource::None;
63  parentNetwork = NULL;
64  referenceMeasure = NULL;
66  constraintStatus.reset();
67  }
68 
69 
76  measures = NULL;
77  cubeSerials = NULL;
78  referenceMeasure = NULL;
79  parentNetwork = NULL;
80 
81  editLock = false;
82 
84  cubeSerials = new QStringList;
85 
86  QListIterator<QString> i(*other.cubeSerials);
87  while (i.hasNext()) {
88  QString sn = i.next();
89 
90  const ControlMeasure *otherCm = other.GetMeasure(sn);
91  ControlMeasure *newMeasure = new ControlMeasure(*otherCm);
92  AddMeasure(newMeasure);
93 
94  if (other.referenceMeasure == otherCm) {
95  SetRefMeasure(newMeasure);
96  }
97  }
98 
99  id = other.id;
100  chooserName = other.chooserName;
101  dateTime = other.dateTime;
102  type = other.type;
103  invalid = other.invalid;
104  editLock = other.editLock;
107  ignore = other.ignore;
116  }
117 
118 
124  ControlPoint::ControlPoint(const QString &newId) : invalid(false) {
125  parentNetwork = NULL;
126  measures = NULL;
127  referenceMeasure = NULL;
129  measures = new QHash< QString, ControlMeasure * >;
130  cubeSerials = new QStringList;
131 
132  id = newId;
133  type = Free;
134  editLock = false;
135  jigsawRejected = false;
136  referenceExplicitlySet = false;
137  ignore = false;
138  aprioriSurfacePointSource = SurfacePointSource::None;
139  aprioriRadiusSource = RadiusSource::None;
140  constraintStatus.reset();
141  }
142 
148  if (measures != NULL) {
149  QList< QString > keys = measures->keys();
150  for (int i = 0; i < keys.size(); i++) {
151  delete(*measures)[keys[i]];
152  (*measures)[keys[i]] = NULL;
153  }
154 
155  delete measures;
156  measures = NULL;
157  }
158 
159  if (cubeSerials) {
160  delete cubeSerials;
161  cubeSerials = NULL;
162  }
163 
164  referenceMeasure = NULL;
165  }
166 
213 
214  }
215 
216 
224  PointModified();
225  AddMeasure(measure);
226  }
227 
228 
234  // Make sure measure is unique
235  foreach(ControlMeasure * m, measures->values()) {
236  if (m->GetCubeSerialNumber() == measure->GetCubeSerialNumber()) {
237  QString msg = "The SerialNumber is not unique. A measure with "
238  "serial number [" + measure->GetCubeSerialNumber() + "] already "
239  "exists for ControlPoint [" + GetId() + "]";
240  throw IException(IException::Programmer, msg, _FILEINFO_);
241  }
242  }
243 
244  if (!measures->size()) {
245  ASSERT(!HasRefMeasure());
246  referenceMeasure = measure;
247  }
248  else if (referenceMeasure->IsIgnored() && !measure->IsIgnored() &&
249  !IsReferenceExplicit() && !IsEditLocked()) {
250  // The current "implicit" reference is ignored, but this new measure
251  // isn't, and the point is not edit locked, so make this measure the new
252  // reference
253  referenceMeasure = measure;
254  }
255 
256  measure->parentPoint = this;
257  QString newSerial = measure->GetCubeSerialNumber();
258  measures->insert(newSerial, measure);
259  cubeSerials->append(newSerial);
260 
261  // notify parent network if we have one
262  if (parentNetwork) {
263  parentNetwork->measureAdded(measure);
265  }
266  }
267 
268 
276  void ControlPoint::ValidateMeasure(QString serialNumber) const {
277  if (!measures->contains(serialNumber)) {
278  QString msg = "No measure with serial number [" + serialNumber +
279  "] is owned by this point";
280  throw IException(IException::Programmer, msg, _FILEINFO_);
281  }
282  }
283 
284 
291  int ControlPoint::Delete(QString serialNumber) {
292  ValidateMeasure(serialNumber);
293  ControlMeasure *cm = (*measures)[serialNumber];
294 
295  // notify parent network of the change
296  if (parentNetwork) {
298 
299  if (!IsIgnored() && !cm->IsIgnored()) {
301  }
302  }
303 
304  if (cm->IsEditLocked()) {
305  return ControlMeasure::MeasureLocked;
306  }
307 
308  // remove measure from the point's data structures
309  measures->remove(serialNumber);
310  cubeSerials->removeAt(cubeSerials->indexOf(serialNumber));
311 
312  // update the reference measure
313  if (cubeSerials->size()) {
314  if (referenceMeasure == cm) {
315  referenceMeasure = (*measures)[cubeSerials->at(0)];
316  referenceExplicitlySet = false;
317  }
318  }
319  else {
320  referenceMeasure = NULL;
321  }
322 
323  delete cm;
324  cm = NULL;
325 
326  PointModified();
327 
328  return ControlMeasure::Success;
329  }
330 
331 
341  void ControlPoint::emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType modType, QVariant oldValue, QVariant newValue) {
342  if (parentNetwork) {
343  parentNetwork->emitMeasureModified(measure, modType, oldValue, newValue);
344  }
345  }
346 
347 
355  ASSERT(measure);
356  return Delete(measure->GetCubeSerialNumber());
357  }
358 
359 
366  int ControlPoint::Delete(int index) {
367  if (index < 0 || index >= cubeSerials->size()) {
368  QString msg = "index [" + QString(index) + "] out of bounds";
369  throw IException(IException::Programmer, msg, _FILEINFO_);
370  }
371 
372  return Delete(cubeSerials->at(index));
373  }
374 
375 
382  if (IsEditLocked()) {
383  return PointLocked;
384  }
385 
386  aprioriSurfacePointSource = SurfacePointSource::None;
388  aprioriRadiusSource = RadiusSource::None;
390 
392  constraintStatus.reset();
393 
394  return Success;
395  }
396 
397 
404  ControlMeasure *ControlPoint::GetMeasure(QString serialNumber) {
405  ValidateMeasure(serialNumber);
406  return (*measures)[serialNumber];
407  }
408 
409 
416  const ControlMeasure *ControlPoint::GetMeasure(QString serialNumber) const {
417  ValidateMeasure(serialNumber);
418  return measures->value(serialNumber);
419  }
420 
421 
422  const ControlMeasure *ControlPoint::GetMeasure(int index) const {
423  if (index < 0 || index >= cubeSerials->size()) {
424  QString msg = "Index [" + toString(index) + "] out of range";
425  throw IException(IException::Programmer, msg, _FILEINFO_);
426  }
427 
428  return GetMeasure(cubeSerials->at(index));
429  }
430 
431 
432  ControlMeasure *ControlPoint::GetMeasure(int index) {
433  if (index < 0 || index >= cubeSerials->size()) {
434  QString msg = "Index [" + toString(index) + "] out of range";
435  throw IException(IException::Programmer, msg, _FILEINFO_);
436  }
437 
438  return GetMeasure(cubeSerials->at(index));
439  }
440 
441 
448  return !(referenceMeasure == NULL);
449  }
450 
451 
458  if (!HasRefMeasure()) {
459  QString msg = "Control point [" + GetId() + "] has no reference measure!";
460  throw IException(IException::Programmer, msg, _FILEINFO_);
461  }
462 
463  return referenceMeasure;
464  }
465 
466 
471  if (!HasRefMeasure()) {
472  QString msg = "Control point [" + GetId() + "] has no reference measure!";
473  throw IException(IException::Programmer, msg, _FILEINFO_);
474  }
475 
476  return referenceMeasure;
477  }
478 
479 
488  if (editLock) {
489  return PointLocked;
490  }
491  chooserName = name;
492  return Success;
493  }
494 
495 
505  if (editLock) {
506  return PointLocked;
507  }
508  dateTime = newDateTime;
509  return Success;
510  }
511 
512 
523  if (parentNetwork) {
524  parentNetwork->emitPointModified(this, ControlPoint::EditLockModified, editLock, lock);
525  }
526  editLock = lock;
527  return Success;
528  }
529 
530 
540  jigsawRejected = reject;
541  return Success;
542  }
543 
544 
553  if (editLock) {
554  return PointLocked;
555  }
556  QString oldId = id;
557  id = newId;
558  if (parentNetwork) {
559  parentNetwork->UpdatePointReference(this, oldId);
560  }
561  return Success;
562  }
563 
564 
571  if (editLock) {
572  return PointLocked;
573  }
574 
575  ASSERT(cm);
577  return Success;
578  }
579 
580 
587  if (editLock) {
588  return PointLocked;
589  }
590 
591  if (index < 0 || index >= cubeSerials->size()) {
592  QString msg = "Index [";
593  msg += toString(index) + "] out of range";
594  throw IException(IException::Programmer, msg, _FILEINFO_);
595  }
596 
597  SetExplicitReference((*measures)[cubeSerials->at(index)]);
598  return Success;
599  }
600 
601 
608  if (editLock) {
609  return PointLocked;
610  }
611 
612  if (!cubeSerials->contains(sn)) {
613  QString msg = "Point [" + id + "] has no measure with serial number [" +
614  sn + "]";
615  throw IException(IException::Programmer, msg, _FILEINFO_);
616  }
617 
618  SetExplicitReference((*measures)[sn]);
619  return Success;
620  }
621 
622 
642  referenceExplicitlySet = true;
643  referenceMeasure = measure;
644  }
645 
646 
654  if (editLock) {
655  return PointLocked;
656  }
657 
658  bool oldStatus = ignore;
659  ignore = newIgnoreStatus;
660 
661  // only update if there was a change in status
662  if (oldStatus != ignore) {
663  PointModified();
664  if (parentNetwork) {
665  if (ignore) {
667  }
668  else {
670  }
671  parentNetwork->emitPointModified(this, ControlPoint::IgnoredModified, oldStatus, ignore);
672  }
673  }
674 
675  return Success;
676  }
677 
678 
693  SurfacePoint newSurfacePoint) {
694 
695  PointModified();
696  adjustedSurfacePoint = newSurfacePoint;
697  return Success;
698  }
699 
700 
710  if (type != Fixed && type != Free && type != Constrained) {
711  QString msg = "Invalid Point Enumeration, [" + QString(type) + "], for "
712  "Control Point [" + GetId() + "]";
713  throw IException(IException::Programmer, msg, _FILEINFO_);
714  }
715 
716  if (editLock) {
717  return PointLocked;
718  }
719  if (parentNetwork) {
720  parentNetwork->emitPointModified(this, ControlPoint::TypeModified, type, newType);
721  }
722 
723  PointModified();
724  type = newType;
725  return Success;
726  }
727 
728 
737  RadiusSource::Source source) {
738  if (editLock) {
739  return PointLocked;
740  }
741  PointModified();
742  aprioriRadiusSource = source;
743  return Success;
744  }
745 
746 
756  QString sourceFile) {
757  if (editLock) {
758  return PointLocked;
759  }
760  PointModified();
761  aprioriRadiusSourceFile = sourceFile;
762  return Success;
763  }
764 
765 
780  SurfacePoint aprioriSP) {
782  if (parentNetwork) {
783  coordType = parentNetwork->GetCoordType();
784  }
785  if (editLock) {
786  return PointLocked;
787  }
788  // ***TBD*** Does it make sense to try to do a generic check here? The
789  // data types are different (angles vs distance) so for now do a switch.
790  switch (coordType) {
792  if (aprioriSP.GetLatSigma().isValid())
793  constraintStatus.set(Coord1Constrained);
794  if (aprioriSP.GetLonSigma().isValid())
795  constraintStatus.set(Coord2Constrained);
796  if (aprioriSP.GetLocalRadiusSigma().isValid())
797  constraintStatus.set(Coord3Constrained);
798  break;
800  if (aprioriSP.GetXSigma().isValid())
801  constraintStatus.set(Coord1Constrained);
802  if (aprioriSP.GetYSigma().isValid())
803  constraintStatus.set(Coord2Constrained);
804  if (aprioriSP.GetZSigma().isValid())
805  constraintStatus.set(Coord3Constrained);
806  }
807 
808  PointModified();
809  aprioriSurfacePoint = aprioriSP;
810  return Success;
811  }
812 
813 
822  SurfacePointSource::Source source) {
823  if (editLock) {
824  return PointLocked;
825  }
826  PointModified();
827  aprioriSurfacePointSource = source;
828  return Success;
829  }
830 
831 
840  QString sourceFile) {
841  if (editLock) {
842  return PointLocked;
843  }
844  PointModified();
845  aprioriSurfacePointSourceFile = sourceFile;
846  return Success;
847  }
848 
849 
900  // TODO (KLE): where should call this go? Also, what's the point? The method has no description.
901  PointModified();
902 
903  // if point is fixed or constrained, ensure valid a priori point coordinates exist
904  if ( (IsFixed() || IsConstrained()) && !aprioriSurfacePoint.Valid() ) {
905  QString msg = "In method ControlPoint::ComputeApriori(). ControlPoint [" + GetId() + "] is ";
906  msg += "fixed or constrained and requires a priori coordinates";
907  throw IException(IException::User, msg, _FILEINFO_);
908  }
909 
910  double xB = 0.0; // body-fixed x
911  double yB = 0.0; // body-fixed y
912  double zB = 0.0; // body-fixed z
913  double r2B = 0.0; // radius squared in body-fixed
914  int goodMeasures = 0;
915  double pB[3];
916 
917  // loop over measures to ...
918  // 1) set focal plane x,y coordinates for all unignored measures;
919  // 2) sum latitude, longitude, and radius coordinates in preparation for computing a priori
920  // coordinates by averaging.
921  for (int i = 0; i < cubeSerials->size(); i++) {
922  ControlMeasure *m = GetMeasure(i);
923  if (m->IsIgnored()) {
924  continue;
925  }
926 
927  Camera *cam = m->Camera();
928  if (cam == NULL) {
929  QString cubeSN = m->GetCubeSerialNumber();
930  QString msg = "in method ControlPoint::ComputeApriori(). Camera has not been set in ";
931  msg += "measure for cube serial number [" + cubeSN + "], Control Point id ";
932  msg += "[" + GetId() + "]. Camera must be set prior to calculating a priori coordinates";
933  throw IException(IException::Programmer, msg, _FILEINFO_);
934  }
935 
936  bool setImageSuccess = cam->SetImage(m->GetSample(), m->GetLine());
937  // CSM cameras do not have focal planes so use sample and line instead
938  if (cam->GetCameraType() == Camera::Csm) {
939  m->SetFocalPlaneMeasured(m->GetSample(),
940  m->GetLine());
941  }
942  else {
945  }
946 
947  // TODO: Seems like we should be able to skip this computation if point is fixed or
948  // constrained in any coordinate. Currently we are always summing coordinates here. We could
949  // save time by not doing this for fixed or constrained points.
950  if (setImageSuccess) {
951  goodMeasures++;
952  cam->Coordinate(pB);
953  xB += pB[0];
954  yB += pB[1];
955  zB += pB[2];
956  r2B += pB[0]*pB[0] + pB[1]*pB[1] + pB[2]*pB[2];
957  }
958  }
959 
960  // if point is Fixed or Constrained in any number of coordinates, initialize adjusted surface
961  // point to a priori coordinates (set in e.g. qnet or cneteditor) and exit
962  if( IsFixed() || IsConstrained()) {
964  return Success;
965  }
966 
967  // if point is Free, we continue to compute a priori coordinates
968 
969  // if no good measures, we're done
970  // TODO: is the message true/meaningful?
971  if (goodMeasures == 0) {
972  QString msg = "in method ControlPoint::ComputeApriori(). ControlPoint [" + GetId() + "] has ";
973  msg += "no measures which project to the body";
974  throw IException(IException::User, msg, _FILEINFO_);
975  }
976 
977  // Compute the averages if all coordinates are free
978  // TODO: confirm if this "if" statement is necessary
979  if (GetType() == Free || NumberOfConstrainedCoordinates() == 0) {
980  double avgX = xB / goodMeasures;
981  double avgY = yB / goodMeasures;
982  double avgZ = zB / goodMeasures;
983  double avgR2 = r2B / goodMeasures;
984  double scale = sqrt(avgR2/(avgX*avgX+avgY*avgY+avgZ*avgZ));
985 
987  Displacement((avgX*scale), Displacement::Kilometers),
988  Displacement((avgY*scale), Displacement::Kilometers),
989  Displacement((avgZ*scale), Displacement::Kilometers));
990  }
991 
993  SetAprioriSurfacePointSource(SurfacePointSource::AverageOfMeasures);
994  SetAprioriRadiusSource(RadiusSource::AverageOfMeasures);
995 
996  return Success;
997  }
998 
999 
1029  if (IsIgnored()) {
1030  return Failure;
1031  }
1032 
1033  PointModified();
1034 
1035  // Loop for each measure to compute the error
1036  QList<QString> keys = measures->keys();
1037 
1038  for (int j = 0; j < keys.size(); j++) {
1039  ControlMeasure *m = (*measures)[keys[j]];
1040  if (m->IsIgnored()) {
1041  continue;
1042  }
1043 
1044  Camera *cam = m->Camera();
1045 
1046  double cuSamp;
1047  double cuLine;
1048  CameraFocalPlaneMap *fpmap = m->Camera()->FocalPlaneMap();
1049 
1050  // Map the coordinates of the control point through the Spice of the
1051  // measurement sample/line to get the computed sample/line. This must be
1052  // done manually because the camera will compute a new time for line scanners,
1053  // instead of using the measured time.
1055 
1056  // Convert the residuals in millimeters to undistorted pixels
1057  if (cam->GetCameraType() == Isis::Camera::Radar) {
1058  // For radar line is calculated from time in the camera. Use the
1059  // closest line to scale the focal plane y (doppler shift) to image line
1060  // for computing the line residual. Get a local ratio
1061  // measureLine = adjacentLine
1062  // ------------ -------------- in both cases, doppler shift
1063  // dopplerMLine dopplerAdjLine is calculated using SPICE
1064  // at the time of the measurement
1065  //
1066  // 1. Get the surface point mapped to by an adjacent pixel above (if
1067  // doppler is < 0) or below (if doppler is > 0) the measured pixel
1068  // 2. Set image to the measured sample/line to load the SPICE for the
1069  // time of the measurement.
1070  // 3. Map the surface point from the adjacent pixel through the SPICE
1071  // into the image plane to get a scale for mapping from doppler
1072  // shift to line. Apply the scale to get the line residual
1073  double sample = m->GetSample();
1074  double computedY = m->GetFocalPlaneComputedY();
1075  double computedX = m->GetFocalPlaneComputedX();
1076  double adjLine;
1077 
1078  // Step 1. What happens if measured line is 1??? TODO
1079  if (computedY < 0) {
1080  adjLine = m->GetLine() - 1.;
1081  }
1082  else {
1083  adjLine = m->GetLine() + 1.;
1084  }
1085 
1086  cam->SetImage(sample, adjLine);
1087  SurfacePoint sp = cam->GetSurfacePoint();
1088 
1089  // Step 2.
1090  cam->SetImage(sample, m->GetLine());
1091  double focalplaneX;
1092  double scalingY;
1093 
1094  // Step 3.
1095  // The default bool value will come from CameraGroundMap instead of
1096  // RadarGroundMap so be explicit to turn off back-of-planet test.
1097  cam->GroundMap()->GetXY(sp, &focalplaneX, &scalingY, false);
1098  double deltaLine;
1099 
1100  if (computedY < 0) {
1101  deltaLine = -computedY/scalingY;
1102  }
1103  else {
1104  deltaLine = computedY/scalingY;
1105  }
1106 
1107  // Now map through the camera steps to take X from slant range to ground
1108  // range to pixels. Y just tracks through as 0.
1109  if (cam->DistortionMap()->SetUndistortedFocalPlane(computedX,
1110  computedY)){
1111  double focalPlaneX = cam->DistortionMap()->FocalPlaneX();
1112  double focalPlaneY = cam->DistortionMap()->FocalPlaneY();
1113  fpmap->SetFocalPlane(focalPlaneX,focalPlaneY);
1114  }
1115  cuSamp = fpmap->DetectorSample();
1116  cuLine = m->GetLine() + deltaLine;
1117  }
1118  else if (cam->GetCameraType() == Isis::Camera::Csm) {
1119  //
1120  cuSamp = m->GetFocalPlaneComputedX();
1121  cuLine = m->GetFocalPlaneComputedY();
1122  }
1123  else {
1124  // Now things get tricky. We want to produce errors in pixels not mm
1125  // but some of the camera maps could fail. One that won't is the
1126  // FocalPlaneMap which takes x/y to detector s/l. We will bypass the
1127  // distortion map and have residuals in undistorted pixels.
1128  if (!fpmap->SetFocalPlane(m->GetFocalPlaneComputedX(), m->GetFocalPlaneComputedY())) {
1129  QString msg = "Sanity check #1 for ControlPoint [" + GetId() +
1130  "], ControlMeasure [" + m->GetCubeSerialNumber() + "]";
1131  throw IException(IException::Programmer, msg, _FILEINFO_);
1132  // This error shouldn't happen but check anyways
1133  }
1134 
1135  cuSamp = fpmap->DetectorSample();
1136  cuLine = fpmap->DetectorLine();
1137  }
1138 
1139  // Compute the measures sample and line
1140 
1141  double muSamp;
1142  double muLine;
1143 
1144  if (cam->GetCameraType() == Isis::Camera::Radar ||
1145  cam->GetCameraType() == Isis::Camera::Csm) {
1146  // For CSM and Radar we use distorted pixels
1147  muSamp = m->GetSample();
1148  muLine = m->GetLine();
1149  }
1150  else {
1151  // For other sensors conver to undistorted pixels
1152  // Again we will bypass the distortion map and have residuals in undistorted pixels.
1153  if (!fpmap->SetFocalPlane(m->GetFocalPlaneMeasuredX(), m->GetFocalPlaneMeasuredY())) {
1154  QString msg = "Sanity check #2 for ControlPoint [" + GetId() +
1155  "], ControlMeasure [" + m->GetCubeSerialNumber() + "]";
1156  throw IException(IException::Programmer, msg, _FILEINFO_);
1157  // This error shouldn't happen but check anyways
1158  }
1159  muSamp = fpmap->DetectorSample();
1160  muLine = fpmap->DetectorLine();
1161  }
1162 
1163  // The units are in detector sample/lines. We will apply the instrument
1164  // summing mode to get close to real pixels. Note however we are in
1165  // undistorted pixels except for radar and CSM instruments.
1166  double sampResidual = muSamp - cuSamp;
1167  double lineResidual = muLine - cuLine;
1168  m->SetResidual(sampResidual, lineResidual);
1169  }
1170 
1171  return Success;
1172  }
1173 
1193  if (IsIgnored()) {
1194  return Failure;
1195  }
1196 
1197  PointModified();
1198 
1199  // Loop for each measure to compute the error
1200  QList<QString> keys = measures->keys();
1201 
1202  for (int j = 0; j < keys.size(); j++) {
1203  ControlMeasure *m = (*measures)[keys[j]];
1204  if (m->IsIgnored()) {
1205  continue;
1206  }
1207 
1208  Camera *cam = m->Camera();
1209  double cudx, cudy;
1210 
1211  // Map the coordinates of the control point through the Spice of the
1212  // measurement sample/line to get the computed undistorted focal plane
1213  // coordinates (mm if not radar).
1214  // This works for radar too because in the undistorted focal plane,
1215  // y has not been set to 0 (set to 0 when going to distorted focal plane
1216  // or ground range in this case), so we can hold the Spice to calculate
1217  // residuals in undistorted focal plane coordinates.
1218  // This does not work with CSM as it does not have a focal plane so
1219  // just use the sample and line
1220  if (cam->GetCameraType() == Camera::Csm) {
1221  cam->SetGround(GetAdjustedSurfacePoint());
1222  cudx = cam->Sample();
1223  cudy = cam->Line();
1224  // Reset to measure
1225  cam->SetImage(m->GetSample(), m->GetLine());
1226  }
1227  else {
1228  // no need to call setimage for framing camera
1229  if (cam->GetCameraType() != 0) {
1230  cam->SetImage(m->GetSample(), m->GetLine());
1231  }
1232  // The default bool value is true. Turn back-of-planet test off for bundle adjustment.
1233  cam->GroundMap()->GetXY(GetAdjustedSurfacePoint(), &cudx, &cudy, false);
1234  }
1235 
1236  m->SetFocalPlaneComputed(cudx, cudy);
1237  }
1238 
1239  return Success;
1240  }
1241 
1242  QString ControlPoint::GetChooserName() const {
1243  if (chooserName != "") {
1244  return chooserName;
1245  }
1246  else {
1247  return FileName(Application::Name()).name();
1248  }
1249  }
1250 
1253  return !chooserName.isEmpty();
1254  }
1255 
1258  return !dateTime.isEmpty();
1259  }
1260 
1261 
1262  QString ControlPoint::GetDateTime() const {
1263  if (dateTime != "") {
1264  return dateTime;
1265  }
1266  else {
1267  return Application::DateTime();
1268  }
1269  }
1270 
1271 
1272  bool ControlPoint::IsEditLocked() const {
1273  return editLock;
1274  }
1275 
1276 
1277  bool ControlPoint::IsRejected() const {
1278  return jigsawRejected;
1279  }
1280 
1281 
1282  SurfacePoint ControlPoint::GetAdjustedSurfacePoint() const {
1283  return adjustedSurfacePoint;
1284  }
1285 
1286 
1292  if (adjustedSurfacePoint.Valid()) {
1293  return adjustedSurfacePoint;
1294  }
1295  else {
1296  return aprioriSurfacePoint;
1297  }
1298  }
1299 
1300 
1306  QString ControlPoint::GetId() const {
1307  return id;
1308  }
1309 
1310 
1311  bool ControlPoint::IsIgnored() const {
1312  return ignore;
1313  }
1314 
1315 
1316  bool ControlPoint::IsValid() const {
1317  return !invalid;
1318  }
1319 
1320 
1321  bool ControlPoint::IsInvalid() const {
1322  return invalid;
1323  }
1324 
1325 
1334  QString str;
1335 
1336  switch (pointType) {
1337  case Fixed:
1338  str = "Fixed";
1339  break;
1340  case Constrained:
1341  str = "Constrained";
1342  break;
1343  case Free:
1344  str = "Free";
1345  break;
1346  }
1347 
1348  return str;
1349  }
1350 
1351 
1360  QString pointTypeString) {
1361 
1362  // On failure assume Free
1364 
1365  QString errMsg = "There is no PointType that has a string representation"
1366  " of \"";
1367  errMsg += pointTypeString;
1368  errMsg += "\".";
1369 
1370  if (pointTypeString == "Fixed") {
1372  }
1373  else if (pointTypeString == "Constrained") {
1375  }
1376  else if (pointTypeString == "Free") {
1378  }
1379  else {
1380  throw IException(IException::Programmer, errMsg, _FILEINFO_);
1381  }
1382 
1383  return type;
1384  }
1385 
1386 
1393  return PointTypeToString(GetType());
1394  }
1395 
1396 
1402  return type;
1403  }
1404 
1405 
1413  QString ControlPoint::RadiusSourceToString(RadiusSource::Source source) {
1414  QString str;
1415 
1416  switch (source) {
1417  case RadiusSource::None:
1418  str = "None";
1419  break;
1420  case RadiusSource::User:
1421  str = "User";
1422  break;
1423  case RadiusSource::AverageOfMeasures:
1424  str = "AverageOfMeasures";
1425  break;
1426  case RadiusSource::Ellipsoid:
1427  str = "Ellipsoid";
1428  break;
1429  case RadiusSource::DEM:
1430  str = "DEM";
1431  break;
1432  case RadiusSource::BundleSolution:
1433  str = "BundleSolution";
1434  break;
1435  }
1436 
1437  return str;
1438  }
1439 
1440 
1448  ControlPoint::RadiusSource::Source ControlPoint::StringToRadiusSource(
1449  QString str) {
1450 
1451  str = str.toLower();
1452  RadiusSource::Source source = RadiusSource::None;
1453 
1454  if (str == "user") {
1455  source = RadiusSource::User;
1456  }
1457  else if (str == "averageofmeasures") {
1458  source = RadiusSource::AverageOfMeasures;
1459  }
1460  else if (str == "ellipsoid") {
1461  source = RadiusSource::Ellipsoid;
1462  }
1463  else if (str == "dem") {
1464  source = RadiusSource::DEM;
1465  }
1466  else if (str == "bundlesolution") {
1467  source = RadiusSource::BundleSolution;
1468  }
1469 
1470  return source;
1471  }
1472 
1473 
1474 
1482  }
1483 
1484 
1493  SurfacePointSource::Source source) {
1494 
1495  QString str;
1496 
1497  switch (source) {
1498  case SurfacePointSource::None:
1499  str = "None";
1500  break;
1501  case SurfacePointSource::User:
1502  str = "User";
1503  break;
1504  case SurfacePointSource::AverageOfMeasures:
1505  str = "AverageOfMeasures";
1506  break;
1507  case SurfacePointSource::Reference:
1508  str = "Reference";
1509  break;
1510  case SurfacePointSource::Basemap:
1511  str = "Basemap";
1512  break;
1513  case SurfacePointSource::BundleSolution:
1514  str = "BundleSolution";
1515  break;
1516  }
1517 
1518  return str;
1519  }
1520 
1521 
1529  ControlPoint::SurfacePointSource::Source
1531  QString str) {
1532 
1533  str = str.toLower();
1534  SurfacePointSource::Source source = SurfacePointSource::None;
1535 
1536  if (str == "user") {
1537  source = SurfacePointSource::User;
1538  }
1539  else if (str == "averageofmeasures") {
1540  source = SurfacePointSource::AverageOfMeasures;
1541  }
1542  else if (str == "reference") {
1543  source = SurfacePointSource::Reference;
1544  }
1545  else if (str == "basemap") {
1546  source = SurfacePointSource::Basemap;
1547  }
1548  else if (str == "bundlesolution") {
1549  source = SurfacePointSource::BundleSolution;
1550  }
1551 
1552  return source;
1553  }
1554 
1555 
1563  }
1564 
1565 
1566  SurfacePoint ControlPoint::GetAprioriSurfacePoint() const {
1567  return aprioriSurfacePoint;
1568  }
1569 
1570 
1571  ControlPoint::RadiusSource::Source ControlPoint::GetAprioriRadiusSource()
1572  const {
1573  return aprioriRadiusSource;
1574  }
1575 
1576 
1577  bool ControlPoint::HasAprioriCoordinates() {
1578  if (aprioriSurfacePoint.GetX().isValid() &&
1579  aprioriSurfacePoint.GetY().isValid() &&
1580  aprioriSurfacePoint.GetZ().isValid()) {
1581  return true;
1582  }
1583 
1584  return false;
1585  // return aprioriSurfacePoint.Valid(); ???
1586  }
1587 
1588 
1594  bool ControlPoint::IsFree() const {
1595  return (type != Fixed && type != Constrained);
1596  }
1597 
1598 
1604  bool ControlPoint::IsFixed() const {
1605  return (type == Fixed);
1606  }
1607 
1608 
1615  // if point type is Free, we ignore any a priori sigmas on the coordinates
1616  if (type == Free) {
1617  return false;
1618  }
1619 
1620  return constraintStatus.any();
1621  }
1622 
1623 
1631  return constraintStatus[Coord1Constrained];
1632  }
1633 
1634 
1642  return constraintStatus[Coord2Constrained];
1643  }
1644 
1652  return constraintStatus[Coord3Constrained];
1653  }
1654 
1655 
1662  return constraintStatus.count();
1663  }
1664 
1665 
1672  return !( aprioriRadiusSourceFile.isEmpty() || aprioriRadiusSourceFile.isNull() );
1673  }
1674 
1675 
1676  QString ControlPoint::GetAprioriRadiusSourceFile() const {
1677  return aprioriRadiusSourceFile;
1678  }
1679 
1680 
1681  ControlPoint::SurfacePointSource::Source
1682  ControlPoint::GetAprioriSurfacePointSource() const {
1684  }
1685 
1686 
1693  return !( aprioriSurfacePointSourceFile.isEmpty() || aprioriSurfacePointSourceFile.isNull() );
1694  }
1695 
1696 
1697  QString ControlPoint::GetAprioriSurfacePointSourceFile() const {
1699  }
1700 
1701 
1702  int ControlPoint::GetNumMeasures() const {
1703  return measures->size();
1704  }
1705 
1706 
1712  int size = 0;
1713  QList<QString> keys = measures->keys();
1714  for (int cm = 0; cm < keys.size(); cm++) {
1715  if (!(*measures)[keys[cm]]->IsIgnored()) {
1716  size++;
1717  }
1718  }
1719  return size;
1720  }
1721 
1722 
1729  int size = 0;
1730  QList<QString> keys = measures->keys();
1731  for (int cm = 0; cm < keys.size(); cm++) {
1732  if ((*measures)[keys[cm]]->IsEditLocked()) {
1733  size++;
1734  }
1735  }
1736  return size;
1737  }
1738 
1739 
1746  bool ControlPoint::HasSerialNumber(QString serialNumber) const {
1747  return cubeSerials->contains(serialNumber);
1748  }
1749 
1750 
1756  return referenceExplicitlySet;
1757  }
1758 
1759 
1764  if (!HasRefMeasure()) {
1765  QString msg = "There is no reference measure set in the ControlPoint [" +
1766  GetId() + "]";
1767  throw IException(IException::Programmer, msg, _FILEINFO_);
1768  }
1769 
1770  return referenceMeasure->GetCubeSerialNumber();
1771  }
1772 
1773 
1782  int ControlPoint::IndexOf(ControlMeasure *cm, bool throws) const {
1783  ASSERT(cm);
1784  return IndexOf(cm->GetCubeSerialNumber(), throws);
1785  }
1786 
1787 
1796  int ControlPoint::IndexOf(QString sn, bool throws) const {
1797  int index = cubeSerials->indexOf(sn);
1798 
1799  if (throws && index == -1) {
1800  QString msg = "ControlMeasure [" + sn + "] does not exist in point [" +
1801  id + "]";
1802  throw IException(IException::Programmer, msg, _FILEINFO_);
1803  }
1804 
1805  return index;
1806  }
1807 
1808 
1818  if (!HasRefMeasure()) {
1819  QString msg = "There is no reference measure for point [" + id + "]."
1820  " This also means of course that the point is empty!";
1821  throw IException(IException::Programmer, msg, _FILEINFO_);
1822  }
1823 
1824  int index = cubeSerials->indexOf(referenceMeasure->GetCubeSerialNumber());
1825  ASSERT(index != -1)
1826 
1827  return index;
1828  }
1829 
1830 
1843  double(ControlMeasure::*statFunc)() const) const {
1844  Statistics stats;
1845  foreach(ControlMeasure * cm, *measures) {
1846  if (!cm->IsIgnored()) {
1847  stats.AddData((cm->*statFunc)());
1848  }
1849  }
1850 
1851  return stats;
1852  }
1853 
1854 
1855  Statistics ControlPoint::GetStatistic(long dataType) const {
1856  Statistics stats;
1857  foreach(ControlMeasure * cm, *measures) {
1858  if (!cm->IsIgnored()) {
1859  stats.AddData(cm->GetLogData(dataType).GetNumericalValue());
1860  }
1861  }
1862 
1863  return stats;
1864  }
1865 
1866 
1874  bool excludeIgnored) const {
1875  QList< ControlMeasure * > orderedMeasures;
1876  for (int i = 0; i < cubeSerials->size(); i++) {
1877  ControlMeasure *measure = measures->value((*cubeSerials)[i]);
1878  if (!excludeIgnored || !measure->IsIgnored()) {
1879  orderedMeasures.append(measures->value((*cubeSerials)[i]));
1880  }
1881  }
1882  return orderedMeasures;
1883  }
1884 
1885 
1890  return *cubeSerials;
1891  }
1892 
1893 
1901  const ControlMeasure *ControlPoint::operator[](QString serialNumber) const {
1902  return GetMeasure(serialNumber);
1903  }
1904 
1905 
1913  ControlMeasure *ControlPoint::operator[](QString serialNumber) {
1914  return GetMeasure(serialNumber);
1915  }
1916 
1917 
1926  const ControlMeasure *ControlPoint::operator[](int index) const {
1927  return GetMeasure(index);
1928  }
1929 
1930 
1940  return GetMeasure(index);
1941  }
1942 
1943 
1951  bool ControlPoint::operator!=(const ControlPoint &other) const {
1952  return !(*this == other);
1953  }
1954 
1955 
1964  bool ControlPoint::operator==(const ControlPoint &other) const {
1965  return other.GetNumMeasures() == GetNumMeasures() &&
1966  other.id == id &&
1967  other.type == type &&
1968  other.chooserName == chooserName &&
1969  other.editLock == editLock &&
1970  other.ignore == ignore &&
1977  other.invalid == invalid &&
1978  other.measures == measures &&
1979  other.dateTime == dateTime &&
1980  other.jigsawRejected == jigsawRejected &&
1984  other.cubeSerials == cubeSerials &&
1985  other.referenceMeasure == referenceMeasure;
1986  }
1987 
1988 
2006 
2007  if (this != &other) {
2008  bool oldLock = editLock;
2009  editLock = false;
2010  for (int i = cubeSerials->size() - 1; i >= 0; i--) {
2011  (*measures)[cubeSerials->at(i)]->SetEditLock(false);
2012  Delete(cubeSerials->at(i));
2013  }
2014 
2015  //measures->clear(); = new QHash< QString, ControlMeasure * >;
2016 
2017  QHashIterator< QString, ControlMeasure * > i(*other.measures);
2018  while (i.hasNext()) {
2019  i.next();
2020  ControlMeasure *newMeasure = new ControlMeasure;
2021  *newMeasure = *i.value();
2022  AddMeasure(newMeasure);
2023  if (other.referenceMeasure == i.value()) {
2024  SetRefMeasure(newMeasure);
2025  }
2026  }
2027 
2028  invalid = other.invalid;
2032 
2033  SetId(other.id);
2034  SetChooserName(other.chooserName);
2035  SetDateTime(other.dateTime);
2036  SetType(other.type);
2037  SetRejected(other.jigsawRejected);
2038  SetIgnored(other.ignore);
2045 
2046  // Set edit lock last so the it doesn't interfere with copying the other fields over.
2047  editLock = oldLock;
2048  SetEditLock(other.editLock);
2049  }
2050 
2051  return *this;
2052  }
2053 
2054 
2060  dateTime = "";
2061  }
2062 
2063 
2066 
2067  {
2069  }
2070 
2071 
2079  numberOfRejectedMeasures = numRejected;
2080  }
2081 
2082 
2090  return numberOfRejectedMeasures;
2091  }
2092 
2100  int nmeasures = measures->size();
2101  if ( nmeasures <= 0 ) {
2102  return 0.0;
2103  }
2104 
2105  Statistics stats;
2106 
2107  for( int i = 0; i < nmeasures; i++) {
2108  const ControlMeasure* m = GetMeasure(i);
2109  if ( !m ) {
2110  continue;
2111  }
2112 
2113  if ( !m->IsIgnored() || m->IsRejected() ) {
2114  continue;
2115  }
2116 
2117  stats.AddData(m->GetSampleResidual());
2118  }
2119 
2120  return stats.Rms();
2121  }
2122 
2123 
2131  int nmeasures = measures->size();
2132  if ( nmeasures <= 0 ) {
2133  return 0.0;
2134  }
2135 
2136  Statistics stats;
2137 
2138  for( int i = 0; i < nmeasures; i++) {
2139  const ControlMeasure* m = GetMeasure(i);
2140  if ( !m ) {
2141  continue;
2142  }
2143 
2144  if ( !m->IsIgnored() || m->IsRejected() ) {
2145  continue;
2146  }
2147 
2148  stats.AddData(m->GetLineResidual());
2149  }
2150 
2151  return stats.Rms();
2152  }
2153 
2154 
2162  int nmeasures = measures->size();
2163  if ( nmeasures <= 0 ) {
2164  return 0.0;
2165  }
2166 
2167  Statistics stats;
2168 
2169  for( int i = 0; i < nmeasures; i++) {
2170  const ControlMeasure* m = GetMeasure(i);
2171  if ( !m ) {
2172  continue;
2173  }
2174 
2175  if ( m->IsIgnored() || m->IsRejected() ) {
2176  continue;
2177  }
2178 
2179  stats.AddData(m->GetSampleResidual());
2180  stats.AddData(m->GetLineResidual());
2181  }
2182 
2183  return stats.Rms();
2184  }
2185 
2192  int nmeasures = measures->size();
2193  if ( nmeasures <= 0 ) {
2194  return;
2195  }
2196 
2197  for( int i = 0; i < nmeasures; i++) {
2198  ControlMeasure* m = GetMeasure(i);
2199  if ( !m ) {
2200  continue;
2201  }
2202 
2203  m->SetRejected(false);
2204  }
2205 
2206  SetRejected(false);
2207  }
2208 
2209 }
Isis::ControlPoint::editLock
bool editLock
This stores the edit lock state.
Definition: ControlPoint.h:651
Isis::ControlPoint::HasDateTime
bool HasDateTime() const
Returns true if the datetime is not empty.
Definition: ControlPoint.cpp:1257
Isis::ControlPoint::ClearJigsawRejected
void ClearJigsawRejected()
Set jigsaw rejected flag for all measures to false and set the jigsaw rejected flag for the point its...
Definition: ControlPoint.cpp:2191
Isis::SurfacePoint::SetRectangular
void SetRectangular(const Displacement &x, const Displacement &y, const Displacement &z, const Distance &xSigma=Distance(), const Distance &ySigma=Distance(), const Distance &zSigma=Distance())
Set surface point in rectangular body-fixed coordinates wtih optional sigmas.
Definition: SurfacePoint.cpp:283
Isis::ControlPoint::getMeasures
QList< ControlMeasure * > getMeasures(bool excludeIgnored=false) const
Definition: ControlPoint.cpp:1873
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::Statistics::AddData
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:141
Isis::ControlPoint::PointTypeToString
static QString PointTypeToString(PointType type)
Obtain a string representation of a given PointType.
Definition: ControlPoint.cpp:1333
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::ControlPoint::ZeroNumberOfRejectedMeasures
void ZeroNumberOfRejectedMeasures()
Initialize the number of rejected measures to 0.
Definition: ControlPoint.cpp:2065
Isis::ControlPoint::SetAprioriRadiusSourceFile
Status SetAprioriRadiusSourceFile(QString sourceFile)
This updates the filename of the DEM that the apriori radius came from.
Definition: ControlPoint.cpp:755
Isis::ControlPoint::IsCoord3Constrained
bool IsCoord3Constrained()
Return bool indicating if 3rd coordinate is Constrained or not.
Definition: ControlPoint.cpp:1651
Isis::CameraGroundMap::GetXY
virtual bool GetXY(const SurfacePoint &spoint, double *cudx, double *cudy, bool test=true)
Compute undistorted focal plane coordinate from ground position using current Spice from SetImage cal...
Definition: CameraGroundMap.cpp:152
Isis::ControlPoint::GetMeasure
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
Definition: ControlPoint.cpp:416
Isis::ControlMeasureLogData::GetNumericalValue
double GetNumericalValue() const
Get the value associated with this log data.
Definition: ControlMeasureLogData.cpp:123
QList< QString >
Isis::ControlPoint::SetIgnored
Status SetIgnored(bool newIgnoreStatus)
Set whether to ignore or use control point.
Definition: ControlPoint.cpp:653
Isis::ControlPoint::GetSampleResidualRms
double GetSampleResidualRms() const
Get rms of sample residuals.
Definition: ControlPoint.cpp:2099
Isis::ControlPoint::jigsawRejected
bool jigsawRejected
This stores the jigsaw rejected state.
Definition: ControlPoint.h:657
Isis::ControlPoint::SetChooserName
Status SetChooserName(QString name)
Set the point's chooser name.
Definition: ControlPoint.cpp:487
Isis::ControlMeasure::parentPoint
ControlPoint * parentPoint
Pointer to parent ControlPoint, may be null.
Definition: ControlMeasure.h:343
Isis::Camera::SetImage
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:154
Isis::ControlPoint::id
QString id
This is the control point ID.
Definition: ControlPoint.h:616
Isis::ControlNet::measureAdded
void measureAdded(ControlMeasure *measure)
Updates the ControlNet graph for the measure's serial number to reflect the addition.
Definition: ControlNet.cpp:580
Isis::Camera::Radar
@ Radar
Radar Camera.
Definition: Camera.h:361
Isis::ControlPoint::PointLocked
@ PointLocked
This is returned when the operation requires Edit Lock to be false but it is currently true.
Definition: ControlPoint.h:408
Isis::ControlPoint::SetEditLock
Status SetEditLock(bool editLock)
Set the EditLock state.
Definition: ControlPoint.cpp:522
Isis::ControlNet::GetCoordType
SurfacePoint::CoordinateType GetCoordType()
Get the control point coordinate type (see the available types in SurfacePoint.h).
Definition: ControlNet.cpp:1862
Isis::ControlPoint::GetResidualRms
double GetResidualRms() const
Get rms of residuals.
Definition: ControlPoint.cpp:2161
Isis::CameraDistortionMap::UndistortedFocalPlaneX
double UndistortedFocalPlaneX() const
Gets the x-value in the undistorted focal plane coordinate system.
Definition: CameraDistortionMap.cpp:237
Isis::Camera::Sample
virtual double Sample() const
Returns the current sample number.
Definition: Camera.cpp:2690
Isis::Camera::GetCameraType
virtual CameraType GetCameraType() const =0
Returns the type of camera that was created.
Isis::ControlPoint::GetReferenceSN
QString GetReferenceSN() const
Definition: ControlPoint.cpp:1763
Isis::ControlPoint::HasAprioriRadiusSourceFile
bool HasAprioriRadiusSourceFile() const
Checks to see if the radius source file has been set.
Definition: ControlPoint.cpp:1671
Isis::ControlPoint::SetAdjustedSurfacePoint
Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint)
Set or update the surface point relating to this control point.
Definition: ControlPoint.cpp:692
Isis::CameraDistortionMap::SetUndistortedFocalPlane
virtual bool SetUndistortedFocalPlane(double ux, double uy)
Compute distorted focal plane x/y.
Definition: CameraDistortionMap.cpp:130
Isis::ControlPoint::SetNumberOfRejectedMeasures
void SetNumberOfRejectedMeasures(int numRejected)
Set (update) the number of rejected measures for the control point.
Definition: ControlPoint.cpp:2078
Isis::ControlMeasure::SetResidual
Status SetResidual(double sampResidual, double lineResidual)
Set the BundleAdjust Residual of the coordinate.
Definition: ControlMeasure.cpp:399
Isis::ControlPoint::GetStatistic
Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const
This function will call a given method on every control measure that this point has.
Definition: ControlPoint.cpp:1842
Isis::ControlMeasure::SetFocalPlaneMeasured
Status SetFocalPlaneMeasured(double x, double y)
Set the focal plane x/y for the measured line/sample.
Definition: ControlMeasure.cpp:299
Isis::ControlPoint::Success
@ Success
This is returned when the operation successfully took effect.
Definition: ControlPoint.h:403
Isis::CameraDistortionMap::FocalPlaneX
double FocalPlaneX() const
Gets the x-value in the focal plane coordinate system.
Definition: CameraDistortionMap.cpp:215
Isis::CameraFocalPlaneMap::DetectorLine
double DetectorLine() const
Definition: CameraFocalPlaneMap.cpp:263
Isis::ControlPoint::aprioriSurfacePoint
SurfacePoint aprioriSurfacePoint
The apriori surface point.
Definition: ControlPoint.h:704
Isis::ControlPoint::ComputeApriori
Status ComputeApriori()
Computes a priori lat/lon/radius point coordinates by determining the average lat/lon/radius of all m...
Definition: ControlPoint.cpp:899
Isis::ControlPoint::ControlPoint
ControlPoint()
Construct a control point.
Definition: ControlPoint.cpp:48
Isis::CameraDistortionMap::FocalPlaneY
double FocalPlaneY() const
Gets the y-value in the focal plane coordinate system.
Definition: CameraDistortionMap.cpp:226
Isis::ControlPoint::ComputeResiduals_Millimeters
Status ComputeResiduals_Millimeters()
This method computes the residuals for a point.
Definition: ControlPoint.cpp:1192
Isis::ControlPoint::PointType
PointType
These are the valid 'types' of point.
Definition: ControlPoint.h:364
Isis::ControlPoint::parentNetwork
ControlNet * parentNetwork
List of Control Measures.
Definition: ControlPoint.h:602
Isis::Camera::DistortionMap
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
Definition: Camera.cpp:2826
Isis::ControlPoint::HasAprioriSurfacePointSourceFile
bool HasAprioriSurfacePointSourceFile() const
Checks to see if the surface point source file has been set.
Definition: ControlPoint.cpp:1692
Isis::ControlPoint::dateTime
QString dateTime
This is the last modified date and time.
Definition: ControlPoint.h:632
Isis::ControlPoint::GetNumberOfRejectedMeasures
int GetNumberOfRejectedMeasures() const
Get the number of rejected measures on the control point.
Definition: ControlPoint.cpp:2089
Isis::ControlPoint::GetId
QString GetId() const
Return the Id of the control point.
Definition: ControlPoint.cpp:1306
Isis::ControlPoint::GetBestSurfacePoint
SurfacePoint GetBestSurfacePoint() const
Returns the adjusted surface point if it exists, otherwise returns the a priori surface point.
Definition: ControlPoint.cpp:1291
Isis::Camera::SetGround
virtual bool SetGround(Latitude latitude, Longitude longitude)
Sets the lat/lon values to get the sample/line values.
Definition: Camera.cpp:401
Isis::Sensor::GetSurfacePoint
SurfacePoint GetSurfacePoint() const
Returns the surface point (most efficient accessor).
Definition: Sensor.cpp:255
Isis::Camera
Definition: Camera.h:236
QStringList
Isis::ControlPoint::SetAprioriSurfacePointSourceFile
Status SetAprioriSurfacePointSourceFile(QString sourceFile)
This updates the filename of where the apriori surface point came from.
Definition: ControlPoint.cpp:839
Isis::CameraFocalPlaneMap::DetectorSample
double DetectorSample() const
Definition: CameraFocalPlaneMap.cpp:255
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::ControlPoint::GetNumValidMeasures
int GetNumValidMeasures() const
Definition: ControlPoint.cpp:1711
Isis::ControlPoint::getCubeSerialNumbers
QList< QString > getCubeSerialNumbers() const
Definition: ControlPoint.cpp:1889
Isis::ControlMeasure::SetRejected
Status SetRejected(bool rejected)
Set "jigsaw" rejected flag for a measure.
Definition: ControlMeasure.cpp:343
Isis::ControlPoint::GetRadiusSourceString
QString GetRadiusSourceString() const
Obtain a string representation of the RadiusSource.
Definition: ControlPoint.cpp:1480
Isis::Displacement
Displacement is a signed length, usually in meters.
Definition: Displacement.h:31
Isis::ControlMeasure::GetCubeSerialNumber
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
Definition: ControlMeasure.cpp:557
Isis::ControlPoint::referenceExplicitlySet
bool referenceExplicitlySet
This indicates if a program has explicitely set the reference in this point or the implicit reference...
Definition: ControlPoint.h:671
Isis::ControlPoint::RadiusSourceToString
static QString RadiusSourceToString(RadiusSource::Source source)
Obtain a string representation of a given RadiusSource.
Definition: ControlPoint.cpp:1413
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
Isis::ControlPoint::Fixed
@ Fixed
A Fixed point is a Control Point whose lat/lon is well established and should not be changed.
Definition: ControlPoint.h:371
Isis::ControlPoint::operator=
const ControlPoint & operator=(const ControlPoint &pPoint)
Definition: ControlPoint.cpp:2005
Isis::ControlPoint::IsCoord2Constrained
bool IsCoord2Constrained()
Return bool indicating if 2nd coordinate is Constrained or not.
Definition: ControlPoint.cpp:1641
Isis::ControlPoint::constraintStatus
std::bitset< 3 > constraintStatus
This stores the constraint status of the a priori SurfacePoint.
Definition: ControlPoint.h:663
QHash
This is free and unencumbered software released into the public domain.
Definition: ControlNet.h:32
Isis::SurfacePoint::Rectangular
@ Rectangular
Body-fixed rectangular x/y/z coordinates.
Definition: SurfacePoint.h:141
Isis::ControlPoint::operator!=
bool operator!=(const ControlPoint &pPoint) const
Compare two Control Points for inequality.
Definition: ControlPoint.cpp:1951
Isis::ControlMeasure::ModType
ModType
Control Measure Modification Types.
Definition: ControlMeasure.h:232
Isis::ControlPoint::GetLineResidualRms
double GetLineResidualRms() const
Get rms of line residuals.
Definition: ControlPoint.cpp:2130
Isis::ControlPoint::SetRefMeasure
Status SetRefMeasure(ControlMeasure *cm)
Set the point's reference measure.
Definition: ControlPoint.cpp:570
Isis::Statistics::Rms
double Rms() const
Computes and returns the rms.
Definition: Statistics.cpp:365
Isis::ControlPoint::HasChooserName
bool HasChooserName() const
Returns true if the choosername is not empty.
Definition: ControlPoint.cpp:1252
Isis::ControlPoint::emitMeasureModified
void emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType modType, QVariant oldValue, QVariant newValue)
This method is a wrapper to emit the measureModified() signal in the parent network is called wheneve...
Definition: ControlPoint.cpp:341
Isis::ControlPoint::invalid
bool invalid
If we forced a build that we would normally have thrown an exception for then this is set to true.
Definition: ControlPoint.h:645
Isis::SurfacePoint::CoordinateType
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:139
Isis::ControlPoint::SetAprioriSurfacePoint
Status SetAprioriSurfacePoint(SurfacePoint aprioriSP)
This updates the apriori surface point.
Definition: ControlPoint.cpp:779
Isis::ControlPoint::SetType
Status SetType(PointType newType)
Updates the control point's type.
Definition: ControlPoint.cpp:709
Isis::CameraFocalPlaneMap::SetFocalPlane
virtual bool SetFocalPlane(const double dx, const double dy)
Compute detector position (sample,line) from focal plane coordinates.
Definition: CameraFocalPlaneMap.cpp:143
Isis::ControlNet::UpdatePointReference
void UpdatePointReference(ControlPoint *point, QString oldId)
Updates the key reference (poind Id) from the old one to what the point id was changet to.
Definition: ControlNet.cpp:741
Isis::ControlPoint::GetSurfacePointSourceString
QString GetSurfacePointSourceString() const
Obtain a string representation of the SurfacePointSource.
Definition: ControlPoint.cpp:1561
Isis::ControlPoint::type
PointType type
What this control point is tying together.
Definition: ControlPoint.h:638
Isis::ControlPoint::GetNumLockedMeasures
int GetNumLockedMeasures() const
Returns the number of locked control measures.
Definition: ControlPoint.cpp:1728
Isis::ControlPoint::operator[]
const ControlMeasure * operator[](QString serialNumber) const
Same as GetMeasure (provided for convenience)
Definition: ControlPoint.cpp:1901
Isis::ControlPoint::SurfacePointSourceToString
static QString SurfacePointSourceToString(SurfacePointSource::Source source)
Obtain a string representation of a given SurfacePointSource.
Definition: ControlPoint.cpp:1492
Isis::ControlPoint::SetId
Status SetId(QString id)
Sets the Id of the control point.
Definition: ControlPoint.cpp:552
Isis::ControlPoint::Constrained
@ Constrained
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
Definition: ControlPoint.h:376
Isis::ControlPoint::StringToSurfacePointSource
static SurfacePointSource::Source StringToSurfacePointSource(QString str)
Obtain a SurfacePoint::Source from a string.
Definition: ControlPoint.cpp:1530
Isis::ControlPoint::StringToRadiusSource
static RadiusSource::Source StringToRadiusSource(QString str)
Obtain a RadiusSource::Source from a string.
Definition: ControlPoint.cpp:1448
Isis::ControlNet::measureDeleted
void measureDeleted(ControlMeasure *measure)
Updates the node for this measure's serial number to reflect the deletion.
Definition: ControlNet.cpp:754
Isis::ControlPoint::adjustedSurfacePoint
SurfacePoint adjustedSurfacePoint
This is the calculated, or aposterori, surface point.
Definition: ControlPoint.h:710
Isis::ControlPoint::Load
void Load(PvlObject &p)
Loads the PvlObject into a ControlPoint.
Definition: ControlPoint.cpp:212
Isis::Application::Name
static QString Name()
Returns the name of the application.
Definition: Application.cpp:729
Isis::ControlPoint::SetDateTime
Status SetDateTime(QString newDateTime)
Set the point's last modified time.
Definition: ControlPoint.cpp:504
Isis::ControlPoint::IsFree
bool IsFree() const
Return bool indicating if point is Free or not.
Definition: ControlPoint.cpp:1594
Isis::ControlPoint::aprioriRadiusSourceFile
QString aprioriRadiusSourceFile
The name of the file that derives the apriori surface point's radius.
Definition: ControlPoint.h:694
Isis::ControlPoint::HasRefMeasure
bool HasRefMeasure() const
Checks to see if a reference measure is set.
Definition: ControlPoint.cpp:447
Isis::ControlMeasure::IsEditLocked
bool IsEditLocked() const
Return value for p_editLock or implicit lock on reference measure.
Definition: ControlMeasure.cpp:601
Isis::Distance::isValid
bool isValid() const
Test if this distance has been initialized or not.
Definition: Distance.cpp:192
Isis::ControlPoint::ignore
bool ignore
True if we should preserve but ignore the entire control point and its measures.
Definition: ControlPoint.h:677
Isis::ControlPoint::IndexOfRefMeasure
int IndexOfRefMeasure() const
Definition: ControlPoint.cpp:1817
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ControlPoint::aprioriSurfacePointSource
SurfacePointSource::Source aprioriSurfacePointSource
Where the apriori surface point originated from.
Definition: ControlPoint.h:680
Isis::ControlNet::pointUnIgnored
void pointUnIgnored(ControlPoint *point)
Update the ControlNet's internal structure when a ControlPoint is un-ignored.
Definition: ControlNet.cpp:637
Isis::ControlPoint::SetExplicitReference
void SetExplicitReference(ControlMeasure *measure)
Explicitly defines a new reference measure by pointer.
Definition: ControlPoint.cpp:641
Isis::ControlPoint::chooserName
QString chooserName
This is the user name of the person who last modified this control point.
Definition: ControlPoint.h:626
Isis::ControlNet::emitMeasureModified
void emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType type, QVariant oldValue, QVariant newValue)
This method is a wrapper to emit the measureModified() signal and is called whenever a change is made...
Definition: ControlNet.cpp:153
Isis::ControlPoint::numberOfRejectedMeasures
int numberOfRejectedMeasures
This parameter is used and maintained by BundleAdjust for the jigsaw application.
Definition: ControlPoint.h:717
Isis::Camera::Csm
@ Csm
Community Sensor Model Camera.
Definition: Camera.h:364
Isis::ControlPoint::IndexOf
int IndexOf(ControlMeasure *, bool throws=true) const
Definition: ControlPoint.cpp:1782
Isis::ControlPoint::NumberOfConstrainedCoordinates
int NumberOfConstrainedCoordinates()
Return bool indicating if point is Constrained or not.
Definition: ControlPoint.cpp:1661
Isis::ControlNet::emitPointModified
void emitPointModified(ControlPoint *point, ControlPoint::ModType type, QVariant oldValue, QVariant newValue)
This method is a wrapper to emit the pointModified() signal and is called whenever a change is made t...
Definition: ControlNet.cpp:167
Isis::Camera::FocalPlaneMap
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
Definition: Camera.cpp:2836
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::ControlPoint::IsCoord1Constrained
bool IsCoord1Constrained()
Return bool indicating if 1st coordinate is Constrained or not.
Definition: ControlPoint.cpp:1630
std
Namespace for the standard library.
Isis::ControlPoint::GetRefMeasure
const ControlMeasure * GetRefMeasure() const
Get the reference control measure.
Definition: ControlPoint.cpp:457
Isis::Angle::isValid
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid,...
Definition: Angle.cpp:95
Isis::CameraFocalPlaneMap
Convert between distorted focal plane and detector coordinates.
Definition: CameraFocalPlaneMap.h:85
Isis::Camera::GroundMap
CameraGroundMap * GroundMap()
Returns a pointer to the CameraGroundMap object.
Definition: Camera.cpp:2856
Isis::ControlNet::emitNetworkStructureModified
void emitNetworkStructureModified()
This method is a wrapper to emit the networkStructureModified() signal.
Definition: ControlNet.cpp:869
Isis::ControlPoint::operator==
bool operator==(const ControlPoint &pPoint) const
Compare two Control Points for equality.
Definition: ControlPoint.cpp:1964
Isis::ControlPoint::ResetApriori
Status ResetApriori()
Reset all the Apriori info to defaults.
Definition: ControlPoint.cpp:381
Isis::ControlNet::pointIgnored
void pointIgnored(ControlPoint *point)
Update the ControlNet's internal structure when a ControlPoint is ignored.
Definition: ControlNet.cpp:779
Isis::ControlPoint::Free
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
Definition: ControlPoint.h:384
Isis::Displacement::isValid
bool isValid() const
Test if this displacement has been initialized or not.
Definition: Displacement.cpp:141
Isis::ControlPoint::Delete
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
Definition: ControlPoint.cpp:354
Isis::ControlPoint::aprioriSurfacePointSourceFile
QString aprioriSurfacePointSourceFile
FileName where the apriori surface point originated from.
Definition: ControlPoint.h:683
Isis::ControlPoint::GetType
PointType GetType() const
Definition: ControlPoint.cpp:1401
Isis::ControlPoint::SetRejected
Status SetRejected(bool rejected)
Set the jigsawRejected state.
Definition: ControlPoint.cpp:539
Isis::ControlPoint::~ControlPoint
~ControlPoint()
This destroys the current instance and cleans up any and all allocated memory.
Definition: ControlPoint.cpp:147
Isis::Sensor::Coordinate
void Coordinate(double p[3]) const
Returns the x,y,z of the surface intersection in BodyFixed km.
Definition: Sensor.cpp:196
Isis::SurfacePoint::Latitudinal
@ Latitudinal
Planetocentric latitudinal (lat/lon/rad) coordinates.
Definition: SurfacePoint.h:140
Isis::ControlPoint::SetAprioriSurfacePointSource
Status SetAprioriSurfacePointSource(SurfacePointSource::Source source)
This updates the source of the surface point.
Definition: ControlPoint.cpp:821
Isis::ControlPoint::ValidateMeasure
void ValidateMeasure(QString serialNumber) const
Throws an exception if none of the point's measures have the given serial number.
Definition: ControlPoint.cpp:276
Isis::ControlPoint::Status
Status
This is a return status for many of the mutating (setter) method calls.
Definition: ControlPoint.h:393
Isis::Camera::Line
virtual double Line() const
Returns the current line number.
Definition: Camera.cpp:2710
Isis::ControlPoint::Failure
@ Failure
This is returned when an operation cannot be performed due to a problem such as the point is ignored ...
Definition: ControlPoint.h:399
Isis::ControlPoint::HasSerialNumber
bool HasSerialNumber(QString serialNumber) const
Return true if given serial number exists in point.
Definition: ControlPoint.cpp:1746
Isis::Application::DateTime
static QString DateTime(time_t *curtime=0)
Returns the date and time as a QString.
Definition: Application.cpp:802
Isis::ControlPoint::IsConstrained
bool IsConstrained()
Return bool indicating if point is Constrained or not.
Definition: ControlPoint.cpp:1614
Isis::ControlMeasure::SetFocalPlaneComputed
Status SetFocalPlaneComputed(double x, double y)
Set the computed focal plane x/y for the apriori lat/lon.
Definition: ControlMeasure.cpp:319
Isis::ControlPoint::AddMeasure
void AddMeasure(ControlMeasure *measure)
Do the actual work of adding a measure to this point, without changing any extra data.
Definition: ControlPoint.cpp:233
Isis::ControlPoint::IsReferenceExplicit
bool IsReferenceExplicit() const
Definition: ControlPoint.cpp:1755
Isis::CameraDistortionMap::UndistortedFocalPlaneY
double UndistortedFocalPlaneY() const
Gets the y-value in the undistorted focal plane coordinate system.
Definition: CameraDistortionMap.cpp:248
Isis::ControlPoint::StringToPointType
static PointType StringToPointType(QString pointTypeString)
Obtain a PointType given a string representation of it.
Definition: ControlPoint.cpp:1359
Isis::ControlPoint::PointModified
void PointModified()
What the heck is the point of this?
Definition: ControlPoint.cpp:2059
Isis::ControlPoint::Add
void Add(ControlMeasure *measure)
Add a measurement to the control point, taking ownership of the measure in the process.
Definition: ControlPoint.cpp:223
Isis::Displacement::Kilometers
@ Kilometers
The distance is being specified in kilometers.
Definition: Displacement.h:42
Isis::ControlPoint::aprioriRadiusSource
RadiusSource::Source aprioriRadiusSource
Where the apriori surface point's radius originated from, most commonly used by jigsaw.
Definition: ControlPoint.h:689
Isis::SurfacePoint
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:132
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ControlPoint::IsFixed
bool IsFixed() const
Return bool indicating if point is Fixed or not.
Definition: ControlPoint.cpp:1604
Isis::ControlPoint::GetPointTypeString
QString GetPointTypeString() const
Obtain a string representation of the PointType.
Definition: ControlPoint.cpp:1392
Isis::ControlPoint::SetAprioriRadiusSource
Status SetAprioriRadiusSource(RadiusSource::Source source)
This updates the source of the radius of the apriori surface point.
Definition: ControlPoint.cpp:736
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126
Isis::ControlPoint::ComputeResiduals
Status ComputeResiduals()
This method computes the BundleAdjust residuals for a point.
Definition: ControlPoint.cpp:1028
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:19