Isis Developer Reference
HiCalData.h
Go to the documentation of this file.
1 #ifndef HiCalData_h
2 #define HiCalData_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <string>
13 #include <vector>
14 
15 #include "IString.h"
16 #include "HiCalTypes.h"
17 #include "HiCalUtil.h"
18 #include "HiBlob.h"
19 #include "Cube.h"
20 
21 #include "IException.h"
22 
23 namespace Isis {
24 
35  class HiCalData {
36 
37  public:
38  // Constructors and Destructor
39  HiCalData() : _calimage(), _calbuffer(), _caldark(), _buffer(),
40  _dark(), _binning(0), _tdi(0), _cpmm(0), _channelNo(0),
41  _firstReverseLine(0), _lastReverseLine(0),
42  _firstMaskLine(0), _lastMaskLine(0),
43  _firstRampLine(0), _lastRampLine(0) { }
44  HiCalData(Cube &cube) {
45  load(cube);
46  }
47 
49  virtual ~HiCalData() { }
50 
51  void load(Cube &cube) {
52  Progress progress;
53  progress.SetText("HiCalData");
54 
55  _calimage = HiBlob(cube, "HiRISE Calibration Image", "Calibration").buffer();
56  _calbuffer = HiBlob(cube, "HiRISE Calibration Ancillary", "BufferPixels").buffer();
57  _caldark = HiBlob(cube, "HiRISE Calibration Ancillary", "DarkPixels").buffer();
58  _buffer = HiBlob(cube, "HiRISE Ancillary", "BufferPixels").buffer();
59  _dark = HiBlob(cube, "HiRISE Ancillary", "DarkPixels").buffer();
60 
61  PvlGroup &instrument = cube.group("Instrument");
62 
63 // Extract what is needed
64  _binning = instrument["Summing"];
65  _tdi = instrument["Tdi"];
66  _cpmm = instrument["CpmmNumber"];
67  _channelNo = instrument["ChannelNumber"];
68 
69 // Determine start/end lines
70  _firstReverseLine = 0;
71  _lastReverseLine = 19;
72 
73 // Set the mask depending on the binning mode
74  _firstMaskLine = 20;
75  _lastMaskLine = _firstMaskLine + 20 / _binning - 1;
76  _firstRampLine = _lastMaskLine + 1;
77  _lastRampLine = _calimage.dim1() - 1;
78  }
79 
80 
82  return (cropLines(_calimage, _firstReverseLine, _lastReverseLine));
83  }
85  return (cropLines(_calimage, _firstMaskLine, _lastMaskLine));
86  }
88  return (cropLines(_calimage, _firstRampLine, _lastRampLine));
89  }
90 
92  return (_dark.copy());
93  }
95  return (_buffer.copy());
96  }
97 
99  return (
102  cropLines(_calbuffer, _firstReverseLine, _lastReverseLine),
103  cropLines(_calimage, _firstReverseLine, _lastReverseLine)),
104  cropLines(_caldark, _firstReverseLine, _lastReverseLine)
105  )
106  );
107  }
109  return (
111  appendSamples(cropLines(_calbuffer, _firstMaskLine, _lastMaskLine),
112  cropLines(_calimage, _firstMaskLine, _lastMaskLine)),
113  cropLines(_caldark, _firstMaskLine, _lastMaskLine)
114  )
115  );
116  }
118  return (
120  appendSamples(cropLines(_calbuffer, _firstRampLine, _lastRampLine),
121  cropLines(_calimage, _firstRampLine, _lastRampLine)),
122  cropLines(_caldark, _firstRampLine, _lastRampLine)
123  )
124  );
125 
126  }
128  return (appendLines(_caldark, _dark));
129  }
131  return (appendLines(_calbuffer, _buffer));
132  }
133 
134  private:
135 
136  HiMatrix _calimage;
137  HiMatrix _calbuffer;
138  HiMatrix _caldark;
139  HiMatrix _buffer;
140  HiMatrix _dark;
141 
142  int _binning;
143  int _tdi;
144  int _cpmm;
145  int _channelNo;
146 
147  int _firstReverseLine;
148  int _lastReverseLine;
149  int _firstMaskLine;
150  int _lastMaskLine;
151  int _firstRampLine;
152  int _lastRampLine;
153  };
154 
155 } // namespace Isis
156 #endif
Isis::HiCalData::getBufferExtended
HiMatrix getBufferExtended()
Definition: HiCalData.h:130
Cube.h
Isis::Cube::group
PvlGroup & group(const QString &group) const
Read a group from the cube into a Label.
Definition: Cube.cpp:1991
Isis::HiMatrix
TNT::Array2D< double > HiMatrix
2-D buffer
Definition: HiCalTypes.h:28
Isis::HiCalData::getRampExtended
HiMatrix getRampExtended()
Definition: HiCalData.h:117
Isis::HiCalData::getRamp
HiMatrix getRamp()
Definition: HiCalData.h:87
HiBlob.h
Isis::HiCalData::getMaskExtended
HiMatrix getMaskExtended()
Definition: HiCalData.h:108
Isis::HiCalData::HiCalData
HiCalData(Cube &cube)
Definition: HiCalData.h:44
Isis::HiCalData::getBuffer
HiMatrix getBuffer()
Definition: HiCalData.h:94
IString.h
Isis::HiCalData::load
void load(Cube &cube)
Definition: HiCalData.h:51
Isis::HiCalData::getReverseClock
HiMatrix getReverseClock()
Definition: HiCalData.h:81
Isis::HiCalData::getReverseClockExtended
HiMatrix getReverseClockExtended()
Definition: HiCalData.h:98
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::Progress::SetText
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:61
HiCalUtil.h
HiCalTypes.h
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::cropLines
HiMatrix cropLines(const HiMatrix &m, int sline, int eline)
Crop specified lines from a buffer.
Definition: HiCalUtil.h:111
Isis::HiCalData::getDarkExtended
HiMatrix getDarkExtended()
Definition: HiCalData.h:127
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::appendLines
HiMatrix appendLines(const HiMatrix &top, const HiMatrix &bottom)
Definition: HiCalUtil.h:300
Isis::appendSamples
HiMatrix appendSamples(const HiMatrix &left, const HiMatrix &right)
Definition: HiCalUtil.h:327
Isis::HiCalData::getMask
HiMatrix getMask()
Definition: HiCalData.h:84
IException.h
Isis::HiCalData::HiCalData
HiCalData()
Definition: HiCalData.h:39
Isis::HiBlob
BLOB extraction class.
Definition: HiBlob.h:38
Isis::HiCalData::~HiCalData
virtual ~HiCalData()
Destructor.
Definition: HiCalData.h:49
Isis::HiBlob::buffer
const HiMatrix & buffer() const
Return a reference to the data.
Definition: HiBlob.h:57
Isis::HiCalData
Container for HiRISE calibration data.
Definition: HiCalData.h:35
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::HiCalData::getDark
HiMatrix getDark()
Definition: HiCalData.h:91