9 #include "BundleObservationVector.h"
15 #include "BundleObservation.h"
16 #include "IsisBundleObservation.h"
18 #include "CsmBundleObservation.h"
19 #include "IException.h"
99 QString observationNumber,
100 QString instrumentId,
104 bool addToExisting =
false;
106 if (bundleSettings->solveObservationMode() &&
110 addToExisting =
true;
116 bundleObservation->append(bundleImage);
118 bundleImage->setParentObservation(bundleObservation);
129 bool isIsisObservation = bundleImage->camera()->GetCameraType() !=
Camera::Csm;
131 if (isIsisObservation) {
135 bundleSettings->bundleTargetBody()));
141 bundleSettings->bundleTargetBody()));
144 if (!bundleObservation) {
145 QString message =
"Unable to allocate new BundleObservation ";
146 message +=
"for " + bundleImage->fileName();
153 if ( bundleSettings->numberSolveSettings() == 1) {
154 solveSettings = bundleSettings->observationSolveSettings(0);
159 solveSettings = bundleSettings->observationSolveSettings(observationNumber);
162 bundleObservation->setSolveSettings(solveSettings);
164 bundleObservation->setIndex(size());
166 bundleImage->setParentObservation(bundleObservation);
168 append(bundleObservation);
170 if (isIsisObservation) {
172 isisObs->initializeExteriorOrientation();
173 if (bundleSettings->solveTargetBody()) {
174 isisObs->initializeBodyRotation();
186 if (bundleObservation->numberParameters() == 0) {
194 return bundleObservation;
205 int numParameters = 0;
207 for (
int i = 0; i < size(); i++) {
208 numParameters += at(i)->numberParameters();
210 return numParameters;
231 return bundleObservation;
250 std::reverse(std::begin(list), std::end(list));