本文整理汇总了C++中Process::MissionData方法的典型用法代码示例。如果您正苦于以下问题:C++ Process::MissionData方法的具体用法?C++ Process::MissionData怎么用?C++ Process::MissionData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Process
的用法示例。
在下文中一共展示了Process::MissionData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TranslateApolloLabels
// Populate cube label using filname and film code
// Code decrypted as specified in film decoder document (July 23, 1971 Revision)
// available at ASU Apollo Resources archive
void TranslateApolloLabels (IString filename, Cube *opack) {
//Instrument group
PvlGroup inst("Instrument");
PvlGroup kern("Kernels");
PvlGroup codeGroup("Code");
inst += PvlKeyword("SpacecraftName", apollo->SpacecraftName());
inst += PvlKeyword("InstrumentId", apollo->InstrumentId());
inst += PvlKeyword("TargetName", apollo->TargetName());
if ( !IsValidCode() ){
PvlGroup error("ERROR");
error.addComment("The decrypted code is invalid.");
for (int i=0; i<4; i++) {
PvlKeyword keyword("Column"+toString(i+1));
for (int j=0; j<32; j++) {
keyword += toString((int)code[i][j]);
}
error.addKeyword(keyword);
codeGroup += keyword;
}
Application::Log(error);
}
else {
codeGroup += PvlKeyword("StartTime", FrameTime());
codeGroup += PvlKeyword("SpacecraftAltitude", toString(Altitude()),"meters");
if (apollo->IsMetric()){
codeGroup += PvlKeyword("ExposureDuration", toString(ShutterInterval()), "milliseconds");
codeGroup += PvlKeyword("ForwardMotionCompensation", FMC());
}
for (int i=0; i<4; i++) {
PvlKeyword keyword("Column"+toString(i+1));
for (int j=0; j<32; j++) {
keyword += toString((int)code[i][j]);
}
codeGroup += keyword;
}
}
PvlGroup bandBin("BandBin");
// There are no filters on the camera, so the default is clear with id # of 1
// the BandBin group is only included to work with the spiceinit application
bandBin += PvlKeyword("FilterName", "CLEAR");
bandBin += PvlKeyword("FilterId", "1");
kern += PvlKeyword("NaifFrameCode", apollo->NaifFrameCode());
// Set up the nominal reseaus group
Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory");
Process p;
PvlTranslationTable tTable(
(QString)p.MissionData("base", "translations/MissionName2DataDir.trn"));
QString missionDir = dataDir[tTable.Translate("MissionName", apollo->SpacecraftName())][0];
Pvl resTemplate(missionDir + "/reseaus/" + apollo->InstrumentId() + "_NOMINAL.pvl");
PvlGroup *reseaus = &resTemplate.findGroup("Reseaus");
// Update reseau locations based on refined code location
for (int i=0; i<(reseaus->findKeyword("Type")).size(); i++) {
double x = toDouble(reseaus->findKeyword("Sample")[i]) + sampleTranslation + 2278,
y = toDouble(reseaus->findKeyword("Line")[i]) + lineTranslation - 20231;
if (apollo->IsApollo17()) {
x += 50;
y += 20;
}
reseaus->findKeyword("Sample")[i] = toString(
cos(rotation)*(x-sampleTranslation) - sin(rotation)*(y-lineTranslation) + sampleTranslation);
reseaus->findKeyword("Line")[i] = toString(
sin(rotation)*(x-sampleTranslation) + cos(rotation)*(y-lineTranslation) + lineTranslation);
}
inst += PvlKeyword("StartTime", utcTime);
opack->putGroup(inst);
opack->putGroup(bandBin);
opack->putGroup(kern);
opack->putGroup(*reseaus);
opack->putGroup(codeGroup);
}
示例2: IsisMain
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")) {
string msg = "At least one CK quality must be selected";
throw iException::Message(iException::User,msg,_FILEINFO_);
}
if (!ui.GetBoolean("SPKPREDICTED") && !ui.GetBoolean("SPKRECON") && !ui.GetBoolean("SPKSMITHED")) {
string msg = "At least one SPK quality must be selected";
throw iException::Message(iException::User,msg,_FILEINFO_);
}
// Make sure it is not projected
Projection *proj = NULL;
try {
proj = icube->Projection();
} catch (iException &e) {
proj = NULL;
e.Clear();
}
if (proj != NULL) {
string msg = "Can not initialize SPICE for a map projected cube";
throw iException::Message(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.
string transFile = p.MissionData("base", "translations/MissionName2DataDir.trn");
// Get the mission translation manager ready
PvlTranslationManager missionXlater (lab, transFile);
// Get the mission name so we can search the correct DB's for kernels
string mission = missionXlater.Translate ("MissionName");
// Get system base kernels
unsigned int allowed = 0;
unsigned int allowedCK = 0;
unsigned int allowedSPK = 0;
if (ui.GetBoolean("CKPREDICTED")) allowedCK |= spiceInit::kernelTypeEnum("PREDICTED");
if (ui.GetBoolean("CKRECON")) allowedCK |= spiceInit::kernelTypeEnum("RECONSTRUCTED");
if (ui.GetBoolean("CKSMITHED")) allowedCK |= spiceInit::kernelTypeEnum("SMITHED");
if (ui.GetBoolean("CKNADIR")) allowedCK |= spiceInit::kernelTypeEnum("NADIR");
if (ui.GetBoolean("SPKPREDICTED")) allowedSPK |= spiceInit::kernelTypeEnum("PREDICTED");
if (ui.GetBoolean("SPKRECON")) allowedSPK |= spiceInit::kernelTypeEnum("RECONSTRUCTED");
if (ui.GetBoolean("SPKSMITHED")) allowedSPK |= spiceInit::kernelTypeEnum("SMITHED");
KernelDb baseKernels (allowed);
KernelDb ckKernels (allowedCK);
KernelDb spkKernels (allowedSPK);
baseKernels.LoadSystemDb(mission);
ckKernels.LoadSystemDb(mission);
spkKernels.LoadSystemDb(mission);
Kernel lk, pck, targetSpk, fk, ik, sclk, spk, iak, dem, exk;
std::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
std::vector<std::string> kernels;
kernels.push_back("Nadir");
ck.push(Kernel((spiceInit::kernelTypes)0, kernels));
}
// 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);
//.........这里部分代码省略.........