Isis 3 Programmer Reference
HiLab.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "HiLab.h"
10 #include "IException.h"
11 
12 using namespace std;
13 
14 namespace Isis {
19  HiLab::HiLab(Cube *cube) {
20  PvlGroup group = cube->group("Instrument");
21  p_cpmmNumber = group["CpmmNumber"];
22  p_channel = group["ChannelNumber"];
23 
24  if(group.hasKeyword("Summing")) {
25  p_bin = group["Summing"];
26  }
27  else {
28  std::string msg = "Cannot find required Summing keyword in label";
29  throw IException(IException::Io, msg, _FILEINFO_);
30  }
31 
32  if(group.hasKeyword("Tdi")) {
33  p_tdi = group["Tdi"];
34  }
35  else {
36  std::string msg = "Cannot find required Tdi keyword in label";
37  throw IException(IException::Io, msg, _FILEINFO_);
38  }
39  }
40 
41  int HiLab::getCcd() {
42  const int cpmm2ccd[] = {0, 1, 2, 3, 12, 4, 10, 11, 5, 13, 6, 7, 8, 9};
43  return cpmm2ccd[p_cpmmNumber];
44  }
45 }
Isis::Cube::group
PvlGroup & group(const QString &group) const
Read a group from the cube into a Label.
Definition: Cube.cpp:1991
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
std
Namespace for the standard library.
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16