Isis 3 Programmer Reference
BundleObservation.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "BundleObservation.h"
10 
11 #include <QDebug>
12 #include <QString>
13 #include <QStringList>
14 #include <QVector>
15 
16 #include "BundleImage.h"
17 #include "BundleObservationSolveSettings.h"
18 #include "BundleTargetBody.h"
19 #include "Camera.h"
20 #include "LinearAlgebra.h"
21 #include "SpicePosition.h"
22 #include "SpiceRotation.h"
23 
24 using namespace std;
25 
26 namespace Isis {
27 
31  BundleObservation::BundleObservation() {
32  m_serialNumbers.clear();
33  m_imageNames.clear();
34  m_observationNumber = "";
35  m_instrumentId = "";
36  m_index = 0;
37  m_weights.clear();
38  m_corrections.clear();
39  m_aprioriSigmas.clear();
40  m_adjustedSigmas.clear();
41  }
42 
43 
53  BundleObservation::BundleObservation(BundleImageQsp image, QString observationNumber,
54  QString instrumentId, BundleTargetBodyQsp bundleTargetBody) {
55  m_serialNumbers.clear();
56  m_imageNames.clear();
57  m_observationNumber = "";
58  m_instrumentId = "";
59  m_index = 0;
60  m_weights.clear();
61  m_corrections.clear();
62  m_aprioriSigmas.clear();
63  m_adjustedSigmas.clear();
64 
65  m_observationNumber = observationNumber;
66  m_instrumentId = instrumentId;
67 
68  if (image) {
69  append(image);
70  m_serialNumbers.append(image->serialNumber());
71  m_imageNames.append(image->fileName());
72  m_cubeSerialNumberToBundleImageMap.insert(image->serialNumber(), image);
73  }
74  }
75 
76 
82  BundleObservation::BundleObservation(const BundleObservation &src) {
83  m_serialNumbers = src.m_serialNumbers;
84  m_cubeSerialNumberToBundleImageMap = src.m_cubeSerialNumberToBundleImageMap;
85 
86  m_observationNumber = src.m_observationNumber;
87  m_instrumentId = src.m_instrumentId;
88 
89  m_index = src.m_index;
90  }
91 
92 
98  BundleObservation::~BundleObservation() {
99  clear();
100  }
101 
102 
112  BundleObservation &BundleObservation::operator=(const BundleObservation &src) {
113  if (&src != this) {
114  m_serialNumbers = src.m_serialNumbers;
115  m_cubeSerialNumberToBundleImageMap = src.m_cubeSerialNumberToBundleImageMap;
116 
117  m_observationNumber = src.m_observationNumber;
118  m_instrumentId = src.m_instrumentId;
119 
120  }
121 
122  return *this;
123  }
124 
125 
135  void BundleObservation::append(const BundleImageQsp &value) {
136  if (value) {
137  m_cubeSerialNumberToBundleImageMap.insert(value->serialNumber(), value);
138  }
140  }
141 
142 
151  BundleImageQsp BundleObservation::imageByCubeSerialNumber(QString cubeSerialNumber) {
152  BundleImageQsp bundleImage;
153 
154  if (m_cubeSerialNumberToBundleImageMap.contains(cubeSerialNumber)) {
155  bundleImage = m_cubeSerialNumberToBundleImageMap.value(cubeSerialNumber);
156  }
157 
158  return bundleImage;
159  }
160 
161 
167  QString BundleObservation::instrumentId() {
168  return m_instrumentId;
169  }
170 
171 
177  LinearAlgebra::Vector &BundleObservation::parameterWeights() {
178  return m_weights;
179  }
180 
181 
187  LinearAlgebra::Vector &BundleObservation::parameterCorrections() {
188  return m_corrections;
189  }
190 
191 
197  LinearAlgebra::Vector &BundleObservation::aprioriSigmas() {
198  return m_aprioriSigmas;
199  }
200 
201 
207  LinearAlgebra::Vector &BundleObservation::adjustedSigmas() {
208  return m_adjustedSigmas;
209  }
210 
211 
217  void BundleObservation::setIndex(int n) {
218  m_index = n;
219  }
220 
221 
227  int BundleObservation::index() {
228  return m_index;
229  }
230 
231 
237  QStringList BundleObservation::imageNames() {
238  return m_imageNames;
239  }
240 }
Isis::BundleObservation::m_instrumentId
QString m_instrumentId
Spacecraft instrument id.
Definition: BundleObservation.h:100
QSharedPointer
Definition: JigsawWorkOrder.h:28
QStringList
Isis::BundleObservation::m_index
int m_index
Index of this observation in the set of observations. Map between cube serial number and BundleImage ...
Definition: BundleObservation.h:95
Isis::LinearAlgebra::Vector
boost::numeric::ublas::vector< double > Vector
Definition for an Isis::LinearAlgebra::Vector of doubles.
Definition: LinearAlgebra.h:120
Isis::BundleObservation::m_observationNumber
QString m_observationNumber
The shared portion of the serial numbers of all images in the observation.
Definition: BundleObservation.h:93
std
Namespace for the standard library.
QVector
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:18
Isis::BundleObservation::m_serialNumbers
QStringList m_serialNumbers
List of all cube serial numbers in observation.
Definition: BundleObservation.h:98
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::BundleObservation
Abstract base class for an observation in bundle adjustment.
Definition: BundleObservation.h:35