Definition at line 129 of file factfits.h.
References ___err___, clear(), fOffsetCalibration, fits::GetNextRow(), zfits::GetNumRows(), fits::GetStr(), gLog, fits::HasKey(), fits::IsCompressedFITS(), and fits::SetPtrAddress().
Referenced by factfits().
135 zfits calib(fileName,
"ZDrsCellOffsets");
139 clear(rdstate()|std::ios::badbit);
147 if (calib.GetNumRows() != 1)
149 clear(rdstate()|std::ios::badbit);
151 throw std::runtime_error(
"Table 'ZDrsCellOffsets' found, but not with one row as expected");
153 gLog <<
___err___ <<
"ERROR - Table 'ZDrsCellOffsets' found, but not with one row as expected" << std::endl;
157 if (calib.GetStr(
"TTYPE1") !=
"OffsetCalibration")
159 clear(rdstate()|std::ios::badbit);
161 throw std::runtime_error(
"Table 'ZDrsCellOffsets' found, but first column is not the one expected");
163 gLog <<
___err___ <<
"ERROR - Table 'ZDrsCellOffsets' found, but first column is not the one expected" << std::endl;
167 bool isColumnPresent =
false;
168 if (calib.HasKey(
"TFORM1") && calib.GetStr(
"TFORM1") ==
"1474560I") isColumnPresent =
true;
169 if (calib.HasKey(
"ZFORM1") && calib.GetStr(
"ZFORM1") ==
"1474560I") isColumnPresent =
true;
170 if (!isColumnPresent)
172 clear(rdstate()|std::ios::badbit);
174 throw std::runtime_error(
"Table 'ZDrsCellOffsets' has wrong column format (TFROM1)");
176 gLog <<
___err___ <<
"ERROR - Table 'ZDrsCellOffsets' has wrong column format (TFORM1)" << std::endl;
184 if (calib.GetNextRow())
187 clear(rdstate()|std::ios::badbit);
190 throw std::runtime_error(
"Reading column 'OffsetCalibration' failed.");
192 gLog <<
___err___ <<
"ERROR - Reading column 'OffsetCalibration' failed." << std::endl;
bool IsCompressedFITS() const
std::vector< int16_t > fOffsetCalibration
integer values of the drs calibration used for compression