Isis 3 Programmer Reference
HiCalData.h
Go to the documentation of this file.
1 #ifndef HiCalData_h
2 #define HiCalData_h
3 
27 #include <string>
28 #include <vector>
29 
30 #include "IString.h"
31 #include "HiCalTypes.h"
32 #include "HiCalUtil.h"
33 #include "HiBlob.h"
34 #include "Cube.h"
35 
36 #include "IException.h"
37 
38 namespace Isis {
39 
50  class HiCalData {
51 
52  public:
53  // Constructors and Destructor
54  HiCalData() : _calimage(), _calbuffer(), _caldark(), _buffer(),
55  _dark(), _binning(0), _tdi(0), _cpmm(0), _channelNo(0),
56  _firstReverseLine(0), _lastReverseLine(0),
57  _firstMaskLine(0), _lastMaskLine(0),
58  _firstRampLine(0), _lastRampLine(0) { }
59  HiCalData(Cube &cube) {
60  load(cube);
61  }
62 
64  virtual ~HiCalData() { }
65 
66  void load(Cube &cube) {
67  Progress progress;
68  progress.SetText("HiCalData");
69 
70  _calimage = HiBlob(cube, "HiRISE Calibration Image", "Calibration").buffer();
71  _calbuffer = HiBlob(cube, "HiRISE Calibration Ancillary", "BufferPixels").buffer();
72  _caldark = HiBlob(cube, "HiRISE Calibration Ancillary", "DarkPixels").buffer();
73  _buffer = HiBlob(cube, "HiRISE Ancillary", "BufferPixels").buffer();
74  _dark = HiBlob(cube, "HiRISE Ancillary", "DarkPixels").buffer();
75 
76  PvlGroup &instrument = cube.group("Instrument");
77 
78 // Extract what is needed
79  _binning = instrument["Summing"];
80  _tdi = instrument["Tdi"];
81  _cpmm = instrument["CpmmNumber"];
82  _channelNo = instrument["ChannelNumber"];
83 
84 // Determine start/end lines
85  _firstReverseLine = 0;
86  _lastReverseLine = 19;
87 
88 // Set the mask depending on the binning mode
89  _firstMaskLine = 20;
90  _lastMaskLine = _firstMaskLine + 20 / _binning - 1;
91  _firstRampLine = _lastMaskLine + 1;
92  _lastRampLine = _calimage.dim1() - 1;
93  }
94 
95 
96  HiMatrix getReverseClock() {
97  return (cropLines(_calimage, _firstReverseLine, _lastReverseLine));
98  }
99  HiMatrix getMask() {
100  return (cropLines(_calimage, _firstMaskLine, _lastMaskLine));
101  }
102  HiMatrix getRamp() {
103  return (cropLines(_calimage, _firstRampLine, _lastRampLine));
104  }
105 
106  HiMatrix getDark() {
107  return (_dark.copy());
108  }
109  HiMatrix getBuffer() {
110  return (_buffer.copy());
111  }
112 
113  HiMatrix getReverseClockExtended() {
114  return (
115  appendSamples(
116  appendSamples(
117  cropLines(_calbuffer, _firstReverseLine, _lastReverseLine),
118  cropLines(_calimage, _firstReverseLine, _lastReverseLine)),
119  cropLines(_caldark, _firstReverseLine, _lastReverseLine)
120  )
121  );
122  }
123  HiMatrix getMaskExtended() {
124  return (
125  appendSamples(
126  appendSamples(cropLines(_calbuffer, _firstMaskLine, _lastMaskLine),
127  cropLines(_calimage, _firstMaskLine, _lastMaskLine)),
128  cropLines(_caldark, _firstMaskLine, _lastMaskLine)
129  )
130  );
131  }
132  HiMatrix getRampExtended() {
133  return (
134  appendSamples(
135  appendSamples(cropLines(_calbuffer, _firstRampLine, _lastRampLine),
136  cropLines(_calimage, _firstRampLine, _lastRampLine)),
137  cropLines(_caldark, _firstRampLine, _lastRampLine)
138  )
139  );
140 
141  }
142  HiMatrix getDarkExtended() {
143  return (appendLines(_caldark, _dark));
144  }
145  HiMatrix getBufferExtended() {
146  return (appendLines(_calbuffer, _buffer));
147  }
148 
149  private:
150 
151  HiMatrix _calimage;
152  HiMatrix _calbuffer;
153  HiMatrix _caldark;
154  HiMatrix _buffer;
155  HiMatrix _dark;
156 
157  int _binning;
158  int _tdi;
159  int _cpmm;
160  int _channelNo;
161 
162  int _firstReverseLine;
163  int _lastReverseLine;
164  int _firstMaskLine;
165  int _lastMaskLine;
166  int _firstRampLine;
167  int _lastRampLine;
168  };
169 
170 } // namespace Isis
171 #endif
172 
173 
PvlGroup & group(const QString &group) const
Read a group from the cube into a Label.
Definition: Cube.cpp:1636
Program progress reporter.
Definition: Progress.h:58
virtual ~HiCalData()
Destructor.
Definition: HiCalData.h:64
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:77
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
BLOB extraction class.
Definition: HiBlob.h:52
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
HiMatrix cropLines(const HiMatrix &m, int sline, int eline)
Crop specified lines from a buffer.
Definition: HiCalUtil.h:125
const HiMatrix & buffer() const
Return a reference to the data.
Definition: HiBlob.h:71
Container for HiRISE calibration data.
Definition: HiCalData.h:50
TNT::Array2D< double > HiMatrix
2-D buffer
Definition: HiCalTypes.h:41
IO Handler for Isis Cubes.
Definition: Cube.h:170