10 #include "CissLabels.h"
13 #include "SpecialPixel.h"
14 #include "IException.h"
24 CissLabels::CissLabels(
Pvl &lab) {
33 CissLabels::CissLabels(
const QString &file) {
45 void CissLabels::Init(
Pvl &lab) {
48 ComputeImgProperties();
52 string msg =
"Labels do not appear contain a valid Cassini ISS instrument";
53 throw IException(IException::Unknown, msg, _FILEINFO_);
65 void CissLabels::ReadLabels(
Pvl &lab) {
68 p_ABflag = (QString) inst[
"AntiBloomingStateFlag"];
69 p_biasStripMean = (double) inst[
"BiasStripMean"];
70 p_compressionRatio = (QString) inst[
"CompressionRatio"];
71 p_compressionType = (QString) inst[
"CompressionType"];
72 p_dataConversionType = (QString) inst[
"DataConversionType"];
73 p_delayedReadoutFlag = (QString) inst[
"DelayedReadoutFlag"];
74 p_exposureDuration = (double) inst[
"ExposureDuration"];
75 p_flightSoftwareVersion = (QString) inst[
"FlightSoftwareVersionId"];
76 p_gainModeId = (int) inst[
"GainModeId"];
77 p_gainState = (int) inst[
"GainState"];
78 p_instrumentDataRate = (double) inst[
"InstrumentDataRate"];
79 p_instrumentModeId = (QString) inst[
"InstrumentModeId"];
80 p_instrumentId = (QString) inst[
"InstrumentId"];
81 p_readoutCycleIndex = (QString) inst[
"ReadoutCycleIndex"];
82 p_readoutOrder = (int) inst[
"ReadoutOrder"];
83 p_shutterModeId = (QString) inst[
"ShutterModeId"];
84 p_shutterStateId = (QString) inst[
"ShutterStateId"];
85 p_summingMode = (int) inst[
"SummingMode"];
86 p_frontOpticsTemp =
toDouble(inst[
"OpticsTemperature"][0]);
87 p_imageTime = (QString) inst[
"ImageTime"];
88 p_targetName = (QString) inst[
"TargetName"];
91 p_imageNumber = (double) arch[
"ImageNumber"];
94 IString filter = (QString) bandbin[
"FilterName"];
95 p_filter.push_back(filter.
Token(
"/").
ToQt());
96 p_filter.push_back(filter.
ToQt());
107 void CissLabels::ComputeImgProperties() {
109 if(p_ABflag ==
"On") p_antiblooming =
true;
110 else p_antiblooming =
false;
113 if(p_instrumentId ==
"ISSNA") p_cissNA =
true;
114 else p_cissNA =
false;
117 if(p_filter[0] ==
"UV1") p_filterIndex.push_back(0);
118 else if(p_filter[0] ==
"UV2") p_filterIndex.push_back(1);
119 else if(p_filter[0] ==
"BL1") p_filterIndex.push_back(3);
120 else if(p_filter[0] ==
"RED") p_filterIndex.push_back(6);
121 else if(p_filter[0] ==
"IR2") p_filterIndex.push_back(8);
122 else if(p_filter[0] ==
"IR4") p_filterIndex.push_back(10);
123 else if(p_filter[0] ==
"CL1") p_filterIndex.push_back(17);
124 else if(p_filter[0] ==
"HAL") p_filterIndex.push_back(19);
125 else if(p_filter[0] ==
"IRP0") p_filterIndex.push_back(20);
126 else if(p_filter[0] ==
"P0") p_filterIndex.push_back(21);
127 else if(p_filter[0] ==
"P60") p_filterIndex.push_back(22);
128 else if(p_filter[0] ==
"P120") p_filterIndex.push_back(23);
129 else if(p_filter[0] ==
"IR3") p_filterIndex.push_back(24);
130 else if(p_filter[0] ==
"IR5") p_filterIndex.push_back(25);
131 else if(p_filter[0] ==
"CB3") p_filterIndex.push_back(26);
132 else if(p_filter[0] ==
"MT3") p_filterIndex.push_back(27);
133 else if(p_filter[0] ==
"CB2") p_filterIndex.push_back(28);
134 else if(p_filter[0] ==
"MT2") p_filterIndex.push_back(29);
135 else throw IException(IException::Unknown,
"Labels have invalid filter 1 name. Cannot get filter 1 index.", _FILEINFO_);
137 if(p_filter[1] ==
"UV3") p_filterIndex.push_back(2);
138 else if(p_filter[1] ==
"BL2") p_filterIndex.push_back(4);
139 else if(p_filter[1] ==
"GRN") p_filterIndex.push_back(5);
140 else if(p_filter[1] ==
"IR1") p_filterIndex.push_back(7);
141 else if(p_filter[1] ==
"IR3") p_filterIndex.push_back(9);
142 else if(p_filter[1] ==
"CB1") p_filterIndex.push_back(11);
143 else if(p_filter[1] ==
"CB2") p_filterIndex.push_back(12);
144 else if(p_filter[1] ==
"CB3") p_filterIndex.push_back(13);
145 else if(p_filter[1] ==
"MT1") p_filterIndex.push_back(14);
146 else if(p_filter[1] ==
"MT2") p_filterIndex.push_back(15);
147 else if(p_filter[1] ==
"MT3") p_filterIndex.push_back(16);
148 else if(p_filter[1] ==
"CL2") p_filterIndex.push_back(18);
149 else if(p_filter[1] ==
"RED") p_filterIndex.push_back(30);
150 else if(p_filter[1] ==
"BL1") p_filterIndex.push_back(31);
151 else if(p_filter[1] ==
"VIO") p_filterIndex.push_back(32);
152 else if(p_filter[1] ==
"HAL") p_filterIndex.push_back(33);
153 else if(p_filter[1] ==
"IRP90") p_filterIndex.push_back(34);
154 else if(p_filter[1] ==
"IRP0") p_filterIndex.push_back(35);
155 else throw IException(IException::Unknown,
"Labels have invalid filter 2 name. Cannot get filter 2 index.", _FILEINFO_);