-
Notifications
You must be signed in to change notification settings - Fork 173
/
Copy pathmain.cpp
648 lines (550 loc) · 21.3 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
#include "Isis.h"
#include <iomanip>
#include <queue>
#include <QList>
#include <QString>
#include <QStringList>
#include <QVector>
#include "Camera.h"
#include "CameraFactory.h"
#include "FileName.h"
#include "IException.h"
#include "Kernel.h"
#include "KernelDb.h"
#include "Longitude.h"
#include "Process.h"
#include "PvlToPvlTranslationManager.h"
#include "SpiceClient.h"
#include "SpiceClientStarter.h"
#include "Table.h"
using namespace std;
using namespace Isis;
void getUserEnteredKernel(const QString ¶m, Kernel &kernel);
bool tryKernels(Cube *icube, Process &p,
Kernel lk, Kernel pck,
Kernel targetSpk, Kernel ck,
Kernel fk, Kernel ik,
Kernel sclk, Kernel spk,
Kernel iak, Kernel dem,
Kernel exk);
void requestSpice(Cube *icube, Pvl &labels, QString missionName);
void IsisMain() {
// Open the input cube
Process p;
UserInterface &ui = Application::GetUserInterface();
CubeAttributeInput cai;
Cube *icube = p.SetInputCube(ui.GetFileName("FROM"), cai, ReadWrite);
// Make sure at least one CK & SPK quality was selected
if (!ui.GetBoolean("CKPREDICTED") && !ui.GetBoolean("CKRECON") &&
!ui.GetBoolean("CKSMITHED") && !ui.GetBoolean("CKNADIR")) {
QString msg = "At least one CK quality must be selected";
throw IException(IException::User, msg, _FILEINFO_);
}
if (!ui.GetBoolean("SPKPREDICTED") && !ui.GetBoolean("SPKRECON") &&
!ui.GetBoolean("SPKSMITHED")) {
QString msg = "At least one SPK quality must be selected";
throw IException(IException::User, msg, _FILEINFO_);
}
// Make sure it is not projected
Projection *proj = NULL;
try {
proj = icube->projection();
}
catch(IException &) {
proj = NULL;
}
if (proj != NULL) {
QString msg = "Can not initialize SPICE for a map projected cube";
throw IException(IException::User, msg, _FILEINFO_);
}
Pvl lab = *icube->label();
// if cube has existing polygon delete it
if (icube->label()->hasObject("Polygon")) {
icube->label()->deleteObject("Polygon");
}
// Set up for getting the mission name
// Get the directory where the system missions translation table is.
QString transFile = p.MissionData("base",
"translations/MissionName2DataDir.trn");
// Get the mission translation manager ready
PvlToPvlTranslationManager missionXlater(lab, transFile);
// Get the mission name so we can search the correct DB's for kernels
QString mission = missionXlater.Translate("MissionName");
if (ui.GetBoolean("WEB")) {
requestSpice(icube, *icube->label(), mission);
}
else {
// Get system base kernels
unsigned int allowed = 0;
unsigned int allowedCK = 0;
unsigned int allowedSPK = 0;
if (ui.GetBoolean("CKPREDICTED"))
allowedCK |= Kernel::typeEnum("PREDICTED");
if (ui.GetBoolean("CKRECON"))
allowedCK |= Kernel::typeEnum("RECONSTRUCTED");
if (ui.GetBoolean("CKSMITHED"))
allowedCK |= Kernel::typeEnum("SMITHED");
if (ui.GetBoolean("CKNADIR"))
allowedCK |= Kernel::typeEnum("NADIR");
if (ui.GetBoolean("SPKPREDICTED"))
allowedSPK |= Kernel::typeEnum("PREDICTED");
if (ui.GetBoolean("SPKRECON"))
allowedSPK |= Kernel::typeEnum("RECONSTRUCTED");
if (ui.GetBoolean("SPKSMITHED"))
allowedSPK |= Kernel::typeEnum("SMITHED");
KernelDb baseKernels(allowed);
KernelDb ckKernels(allowedCK);
KernelDb spkKernels(allowedSPK);
baseKernels.loadSystemDb(mission, lab);
ckKernels.loadSystemDb(mission, lab);
spkKernels.loadSystemDb(mission, lab);
Kernel lk, pck, targetSpk, fk, ik, sclk, spk, iak, dem, exk;
QList< priority_queue<Kernel> > ck;
lk = baseKernels.leapSecond(lab);
pck = baseKernels.targetAttitudeShape(lab);
targetSpk = baseKernels.targetPosition(lab);
ik = baseKernels.instrument(lab);
sclk = baseKernels.spacecraftClock(lab);
iak = baseKernels.instrumentAddendum(lab);
fk = ckKernels.frame(lab);
ck = ckKernels.spacecraftPointing(lab);
spk = spkKernels.spacecraftPosition(lab);
if (ui.GetBoolean("CKNADIR")) {
// Only add nadir if no spacecraft pointing found, so we will set (priority) type to 0.
QStringList nadirCk;
nadirCk.push_back("Nadir");
// if a priority queue already exists, add Nadir with low priority of 0
if (ck.size() > 0) {
ck[0].push(Kernel((Kernel::Type)0, nadirCk));
}
// if no queue exists, create a nadir queue
else {
priority_queue<Kernel> nadirQueue;
nadirQueue.push(Kernel((Kernel::Type)0, nadirCk));
ck.push_back(nadirQueue);
}
}
// Get user defined kernels and override ones already found
getUserEnteredKernel("LS", lk);
getUserEnteredKernel("PCK", pck);
getUserEnteredKernel("TSPK", targetSpk);
getUserEnteredKernel("FK", fk);
getUserEnteredKernel("IK", ik);
getUserEnteredKernel("SCLK", sclk);
getUserEnteredKernel("SPK", spk);
getUserEnteredKernel("IAK", iak);
getUserEnteredKernel("EXTRA", exk);
// Get shape kernel
if (ui.GetString("SHAPE") == "USER") {
getUserEnteredKernel("MODEL", dem);
}
else if (ui.GetString("SHAPE") == "SYSTEM") {
dem = baseKernels.dem(lab);
}
bool kernelSuccess = false;
if ((ck.size() == 0 || ck.at(0).size() == 0) && !ui.WasEntered("CK")) {
// no ck was found in system and user did not enter ck, throw error
throw IException(IException::Unknown,
"No Camera Kernels found for the image [" + ui.GetFileName("FROM")
+ "]",
_FILEINFO_);
}
else if (ui.WasEntered("CK")) {
// if user entered ck
// empty ck queue list found in system
while (ck.size()) {
ck.pop_back();
}
// create queue with empty kernel so ck[0].size() != 0,
// this allows us to get into the coming while loop
priority_queue< Kernel > emptyKernelQueue;
emptyKernelQueue.push(Kernel());
ck.push_back(emptyKernelQueue);
}
// while the first queue is not empty, loop through it until tryKernels() succeeds
while (ck.at(0).size() != 0 && !kernelSuccess) {
// create an empty kernel
Kernel realCkKernel;
QStringList ckKernelList;
// if the user entered ck kernels, populate the ck kernel list with the
// user entered files
if (ui.WasEntered("CK")) {
vector<QString> userEnteredCks;
ui.GetAsString("CK", userEnteredCks);
// convert user entered std vector to QStringList and add to ckKernelList
ckKernelList = QVector<QString>::fromStdVector(userEnteredCks).toList();
}
else {// loop through cks found in the system
// Add the list of cks from each Kernel object at the top of each
// priority queue. If multiple priority queues exist, we will not
// pop of the top priority from any of the queues except for the
// first one. So each time tryKernels() fails, the same files
// will be loaded with the next priority from the first queue.
for (int i = ck.size() - 1; i >= 0; i--) {
if (ck.at(i).size() != 0) {
Kernel topPriority = ck.at(i).top();
ckKernelList.append(topPriority.kernels());
// set the type to equal the type of the to priority of the first
//queue
realCkKernel.setType(topPriority.type());
}
}
}
// pop the top priority ck off only the first queue so that the next
// iteration will test the next highest priority of the first queue with
// the top priority of each of the other queues.
ck[0].pop();
// Merge SpacecraftPointing and Frame into ck
for (int i = 0; i < fk.size(); i++) {
ckKernelList.push_back(fk[i]);
}
realCkKernel.setKernels(ckKernelList);
kernelSuccess = tryKernels(icube, p, lk, pck, targetSpk,
realCkKernel, fk, ik, sclk, spk, iak, dem, exk);
}
if (!kernelSuccess)
throw IException(IException::Unknown,
"Unable to initialize camera model",
_FILEINFO_);
}
p.EndProcess();
}
/**
* If the user entered the parameter param, then kernel is replaced by the
* user's values and quality is reset to 0. Otherwise, the kernels loaded by the
* KernelDb class will be kept.
*
* @param param Name of the kernel input parameter
*
* @param kernel Kernel object to be overwritten if the specified user parameter
* was entered.
*/
void getUserEnteredKernel(const QString ¶m, Kernel &kernel) {
UserInterface &ui = Application::GetUserInterface();
if (ui.WasEntered(param)) {
kernel = Kernel();
// NOTE: This is using GetAsString so that vars like $mgs can be used.
vector<QString> kernels;
ui.GetAsString(param, kernels);
kernel.setKernels(QVector<QString>::fromStdVector(kernels).toList());
}
}
/**
* This fuction now also adds any ShapeModel information specified in a
* preferences file to the Kernels group.
*/
bool tryKernels(Cube *icube, Process &p,
Kernel lk, Kernel pck,
Kernel targetSpk, Kernel ck,
Kernel fk, Kernel ik, Kernel sclk,
Kernel spk, Kernel iak,
Kernel dem, Kernel exk) {
// Add the new kernel files to the existing kernels group
PvlKeyword lkKeyword("LeapSecond");
PvlKeyword pckKeyword("TargetAttitudeShape");
PvlKeyword targetSpkKeyword("TargetPosition");
PvlKeyword ckKeyword("InstrumentPointing");
PvlKeyword ikKeyword("Instrument");
PvlKeyword sclkKeyword("SpacecraftClock");
PvlKeyword spkKeyword("InstrumentPosition");
PvlKeyword iakKeyword("InstrumentAddendum");
PvlKeyword demKeyword("ShapeModel");
PvlKeyword exkKeyword("Extra");
for (int i = 0; i < lk.size(); i++) {
lkKeyword.addValue(lk[i]);
}
for (int i = 0; i < pck.size(); i++) {
pckKeyword.addValue(pck[i]);
}
for (int i = 0; i < targetSpk.size(); i++) {
targetSpkKeyword.addValue(targetSpk[i]);
}
for (int i = 0; i < ck.size(); i++) {
ckKeyword.addValue(ck[i]);
}
for (int i = 0; i < ik.size(); i++) {
ikKeyword.addValue(ik[i]);
}
for (int i = 0; i < sclk.size(); i++) {
sclkKeyword.addValue(sclk[i]);
}
for (int i = 0; i < spk.size(); i++) {
spkKeyword.addValue(spk[i]);
}
for (int i = 0; i < iak.size(); i++) {
iakKeyword.addValue(iak[i]);
}
UserInterface &ui = Application::GetUserInterface();
if (ui.GetString("SHAPE") == "RINGPLANE") {
demKeyword.addValue("RingPlane");
}
else {
for (int i = 0; i < dem.size(); i++) {
demKeyword.addValue(dem[i]);
}
}
for (int i = 0; i < exk.size(); i++) {
exkKeyword.addValue(exk[i]);
}
PvlGroup originalKernels = icube->group("Kernels");
PvlGroup currentKernels = originalKernels;
currentKernels.addKeyword(lkKeyword, Pvl::Replace);
currentKernels.addKeyword(pckKeyword, Pvl::Replace);
currentKernels.addKeyword(targetSpkKeyword, Pvl::Replace);
currentKernels.addKeyword(ckKeyword, Pvl::Replace);
currentKernels.addKeyword(ikKeyword, Pvl::Replace);
currentKernels.addKeyword(sclkKeyword, Pvl::Replace);
currentKernels.addKeyword(spkKeyword, Pvl::Replace);
currentKernels.addKeyword(iakKeyword, Pvl::Replace);
currentKernels.addKeyword(demKeyword, Pvl::Replace);
// report qualities
PvlKeyword spkQuality("InstrumentPositionQuality");
spkQuality.addValue(Kernel::typeEnum(spk.type()));
currentKernels.addKeyword(spkQuality, Pvl::Replace);
PvlKeyword ckQuality("InstrumentPointingQuality");
ckQuality.addValue(Kernel::typeEnum(ck.type()));
currentKernels.addKeyword(ckQuality, Pvl::Replace);
if (!exkKeyword.isNull()) {
currentKernels.addKeyword(exkKeyword, Pvl::Replace);
}
else if (currentKernels.hasKeyword("EXTRA")) {
currentKernels.deleteKeyword("EXTRA");
}
// Get rid of old keywords from previously inited cubes
if (currentKernels.hasKeyword("SpacecraftPointing"))
currentKernels.deleteKeyword("SpacecraftPointing");
if (currentKernels.hasKeyword("SpacecraftPosition"))
currentKernels.deleteKeyword("SpacecraftPosition");
if (currentKernels.hasKeyword("ElevationModel"))
currentKernels.deleteKeyword("ElevationModel");
if (currentKernels.hasKeyword("Frame"))
currentKernels.deleteKeyword("Frame");
if (currentKernels.hasKeyword("StartPadding"))
currentKernels.deleteKeyword("StartPadding");
if (currentKernels.hasKeyword("EndPadding"))
currentKernels.deleteKeyword("EndPadding");
if (currentKernels.hasKeyword("RayTraceEngine")) {
currentKernels.deleteKeyword("RayTraceEngine");
}
if (currentKernels.hasKeyword("OnError")) {
currentKernels.deleteKeyword("OnError");
}
if (currentKernels.hasKeyword("Tolerance")) {
currentKernels.deleteKeyword("Tolerance");
}
// Add any time padding the user specified to the spice group
if (ui.GetDouble("STARTPAD") > DBL_EPSILON) {
currentKernels.addKeyword(PvlKeyword("StartPadding",
toString(ui.GetDouble("STARTPAD")), "seconds"));
}
if (ui.GetDouble("ENDPAD") > DBL_EPSILON) {
currentKernels.addKeyword(PvlKeyword("EndPadding",
toString(ui.GetDouble("ENDPAD")), "seconds"));
}
currentKernels.addKeyword(
PvlKeyword("CameraVersion", toString(CameraFactory::CameraVersion(*icube))),
Pvl::Replace);
// Add the modified Kernels group to the input cube labels
icube->putGroup(currentKernels);
// Create the camera so we can get blobs if necessary
try {
Camera *cam;
try {
cam = icube->camera();
currentKernels = icube->group("Kernels");
Application::Log(currentKernels);
}
catch(IException &e) {
Pvl errPvl = e.toPvl();
if (errPvl.groups() > 0) {
currentKernels += PvlKeyword("Error", errPvl.group(errPvl.groups() - 1)["Message"][0]);
}
Application::Log(currentKernels);
icube->putGroup(originalKernels);
throw IException(e);
}
if (ui.GetBoolean("ATTACH")) {
Table ckTable = cam->instrumentRotation()->Cache("InstrumentPointing");
ckTable.Label() += PvlKeyword("Description", "Created by spiceinit");
ckTable.Label() += PvlKeyword("Kernels");
for (int i = 0; i < ckKeyword.size(); i++)
ckTable.Label()["Kernels"].addValue(ckKeyword[i]);
icube->write(ckTable);
Table spkTable = cam->instrumentPosition()->Cache("InstrumentPosition");
spkTable.Label() += PvlKeyword("Description", "Created by spiceinit");
spkTable.Label() += PvlKeyword("Kernels");
for (int i = 0; i < spkKeyword.size(); i++)
spkTable.Label()["Kernels"].addValue(spkKeyword[i]);
icube->write(spkTable);
Table bodyTable = cam->bodyRotation()->Cache("BodyRotation");
bodyTable.Label() += PvlKeyword("Description", "Created by spiceinit");
bodyTable.Label() += PvlKeyword("Kernels");
for (int i = 0; i < targetSpkKeyword.size(); i++)
bodyTable.Label()["Kernels"].addValue(targetSpkKeyword[i]);
for (int i = 0; i < pckKeyword.size(); i++)
bodyTable.Label()["Kernels"].addValue(pckKeyword[i]);
bodyTable.Label() += PvlKeyword("SolarLongitude",
toString(cam->solarLongitude().degrees()));
icube->write(bodyTable);
Table sunTable = cam->sunPosition()->Cache("SunPosition");
sunTable.Label() += PvlKeyword("Description", "Created by spiceinit");
sunTable.Label() += PvlKeyword("Kernels");
for (int i = 0; i < targetSpkKeyword.size(); i++)
sunTable.Label()["Kernels"].addValue(targetSpkKeyword[i]);
icube->write(sunTable);
// Save original kernels in keyword before changing to Table
PvlKeyword origCk = currentKernels["InstrumentPointing"];
PvlKeyword origSpk = currentKernels["InstrumentPosition"];
PvlKeyword origTargPos = currentKernels["TargetPosition"];
currentKernels["InstrumentPointing"] = "Table";
for (int i = 0; i < origCk.size(); i++)
currentKernels["InstrumentPointing"].addValue(origCk[i]);
currentKernels["InstrumentPosition"] = "Table";
for (int i = 0; i < origSpk.size(); i++)
currentKernels["InstrumentPosition"].addValue(origSpk[i]);
currentKernels["TargetPosition"] = "Table";
for (int i = 0; i < origTargPos.size(); i++)
currentKernels["TargetPosition"].addValue(origTargPos[i]);
icube->putGroup(currentKernels);
Pvl *label = icube->label();
int i = 0;
while (i < label->objects()) {
PvlObject currObj = label->object(i);
if (currObj.isNamed("NaifKeywords")) {
label->deleteObject(i);
}
else {
i ++;
}
}
*icube->label() += cam->getStoredNaifKeywords();
}
//modify Kernels group only
else {
Pvl *label = icube->label();
int i = 0;
while (i < label->objects()) {
PvlObject currObj = label->object(i);
if (currObj.isNamed("Table")) {
if (currObj["Name"][0] == QString("InstrumentPointing") ||
currObj["Name"][0] == QString("InstrumentPosition") ||
currObj["Name"][0] == QString("BodyRotation") ||
currObj["Name"][0] == QString("SunPosition")) {
label->deleteObject(i);
}
else {
i++;
}
}
else if (currObj.isNamed("NaifKeywords")) {
label->deleteObject(i);
}
else {
i++;
}
}
}
p.WriteHistory(*icube);
}
catch(IException &) {
icube->putGroup(originalKernels);
return false;
}
return true;
}
void requestSpice(Cube *icube, Pvl &labels, QString missionName) {
UserInterface &ui = Application::GetUserInterface();
QString instrumentId =
labels.findGroup("Instrument", Pvl::Traverse)["InstrumentId"][0];
QString url = ui.GetString("URL") + "?mission=" + missionName +
"&instrument=" + instrumentId;
int port = ui.GetInteger("PORT");
bool ckSmithed = ui.GetBoolean("CKSMITHED");
bool ckRecon = ui.GetBoolean("CKRECON");
bool ckPredicted = ui.GetBoolean("CKPREDICTED");
bool ckNadir = ui.GetBoolean("CKNADIR");
bool spkSmithed = ui.GetBoolean("SPKSMITHED");
bool spkRecon = ui.GetBoolean("SPKRECON");
bool spkPredicted = ui.GetBoolean("SPKPREDICTED");
QString shape = QString(ui.GetString("SHAPE")).toLower();
if (shape == "user") {
shape = QString(ui.GetAsString("MODEL"));
// Test for valid labels with mapping group at least
Pvl shapeTest(shape);
shapeTest.findGroup("Mapping", Pvl::Traverse);
}
double startPad = ui.GetDouble("STARTPAD");
double endPad = ui.GetDouble("ENDPAD");
SpiceClient client(url, port, labels,
ckSmithed, ckRecon, ckPredicted, ckNadir,
spkSmithed, spkRecon, spkPredicted,
shape, startPad, endPad);
Progress connectionProgress;
connectionProgress.SetText("Requesting Spice Data");
connectionProgress.SetMaximumSteps(1);
connectionProgress.CheckStatus();
SpiceClientStarter starter(client);
starter.start();
client.blockUntilComplete();
connectionProgress.CheckStatus();
PvlGroup kernelsGroup = client.kernelsGroup();
PvlGroup logGrp = client.applicationLog();
PvlObject naifKeywords = client.naifKeywordsObject();
Table *pointingTable = client.pointingTable();
Table *positionTable = client.positionTable();
Table *bodyTable = client.bodyRotationTable();
Table *sunPosTable = client.sunPositionTable();
// Verify everything in the kernels group exists, if not then our kernels are
// out of date.
for (int keywordIndex = 0;
keywordIndex < kernelsGroup.keywords();
keywordIndex++) {
PvlKeyword &curKeyword = kernelsGroup[keywordIndex];
if (curKeyword.name() == "NaifFrameCode" ||
curKeyword.name() == "InstrumentPointingQuality" ||
curKeyword.name() == "InstrumentPositionQuality" ||
curKeyword.name() == "CameraVersion" ||
curKeyword.name() == "TargetPosition" ||
curKeyword.name() == "InstrumentPointing" ||
curKeyword.name() == "InstrumentPosition" ||
curKeyword.name() == "TargetAttitudeShape") {
continue;
}
/*for (int valueIndex = 0; valueIndex < curKeyword.Size(); valueIndex ++) {
IString value = curKeyword[valueIndex];
if (value == "Table" || value == "Null")
continue;
IString fullFileName = FileName(value).expanded();
QFile testFile(fullFileName.ToQt());
if (!testFile.exists()) {
IString msg = "The spice server says you need the kernel [" +
value + "] which is not present. " +
"Please update your spice kernels";
throw iException::Message(iException::Spice, msg, _FILEINFO_);
}
}*/
}
Application::Log(logGrp);
icube->putGroup(kernelsGroup);
icube->label()->addObject(naifKeywords);
icube->write(*pointingTable);
icube->write(*positionTable);
icube->write(*bodyTable);
icube->write(*sunPosTable);
try {
icube->camera();
}
catch (IException &e) {
throw IException(e, IException::Unknown,
"The SPICE server returned incompatible SPICE data",
_FILEINFO_);
}
delete pointingTable;
pointingTable = NULL;
delete positionTable;
positionTable = NULL;
delete bodyTable;
bodyTable = NULL;
delete sunPosTable;
sunPosTable = NULL;
}