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
23namespace 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
IO Handler for Isis Cubes.
Definition Cube.h:168
PvlGroup & group(const QString &group) const
Read a group from the cube into a Label.
Definition Cube.cpp:1998
BLOB extraction class.
Definition HiBlob.h:38
const HiMatrix & buffer() const
Return a reference to the data.
Definition HiBlob.h:57
Container for HiRISE calibration data.
Definition HiCalData.h:35
HiMatrix getReverseClock()
Definition HiCalData.h:81
virtual ~HiCalData()
Destructor.
Definition HiCalData.h:49
HiCalData(Cube &cube)
Definition HiCalData.h:44
HiCalData()
Definition HiCalData.h:39
HiMatrix getRamp()
Definition HiCalData.h:87
void load(Cube &cube)
Definition HiCalData.h:51
HiMatrix getMaskExtended()
Definition HiCalData.h:108
HiMatrix getDarkExtended()
Definition HiCalData.h:127
HiMatrix getRampExtended()
Definition HiCalData.h:117
HiMatrix getBuffer()
Definition HiCalData.h:94
HiMatrix getDark()
Definition HiCalData.h:91
HiMatrix getMask()
Definition HiCalData.h:84
HiMatrix getReverseClockExtended()
Definition HiCalData.h:98
HiMatrix getBufferExtended()
Definition HiCalData.h:130
Program progress reporter.
Definition Progress.h:42
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition Progress.cpp:61
Contains multiple PvlContainers.
Definition PvlGroup.h:41
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
HiMatrix appendSamples(const HiMatrix &left, const HiMatrix &right)
Definition HiCalUtil.h:317
HiMatrix appendLines(const HiMatrix &top, const HiMatrix &bottom)
Definition HiCalUtil.h:290
TNT::Array2D< double > HiMatrix
2-D buffer
Definition HiCalTypes.h:28
HiMatrix cropLines(const HiMatrix &m, int sline, int eline)
Crop specified lines from a buffer.
Definition HiCalUtil.h:101