Commit c4e455cf authored by Jens Kroeger's avatar Jens Kroeger
Browse files

Detector class: change ERROR to WARNING when mask file not found or pixels out...

Detector class: change ERROR to WARNING when mask file not found or pixels out of matrix as these might change the result but don't terminate corry
parent 8a348921
......@@ -142,7 +142,7 @@ void Detector::processMaskFile() {
// Open the file with masked pixels
std::ifstream inputMaskFile(m_maskfile, std::ios::in);
if(!inputMaskFile.is_open()) {
LOG(ERROR) << "Could not open mask file " << m_maskfile;
LOG(WARNING) << "Could not open mask file " << m_maskfile;
} else {
int row = 0, col = 0;
std::string id;
......@@ -151,8 +151,8 @@ void Detector::processMaskFile() {
if(id == "c") {
inputMaskFile >> col;
if(col > nPixels().X() - 1) {
LOG(ERROR) << "Column " << col << " outside of pixel matrix, chip has only " << nPixels().X()
<< " columns!";
LOG(WARNING) << "Column " << col << " outside of pixel matrix, chip has only " << nPixels().X()
<< " columns!";
}
LOG(TRACE) << "Masking column " << col;
for(int r = 0; r < nPixels().Y(); r++) {
......@@ -161,7 +161,7 @@ void Detector::processMaskFile() {
} else if(id == "r") {
inputMaskFile >> row;
if(row > nPixels().Y() - 1) {
LOG(ERROR) << "Row " << col << " outside of pixel matrix, chip has only " << nPixels().Y() << " rows!";
LOG(WARNING) << "Row " << col << " outside of pixel matrix, chip has only " << nPixels().Y() << " rows!";
}
LOG(TRACE) << "Masking row " << row;
for(int c = 0; c < nPixels().X(); c++) {
......@@ -170,13 +170,13 @@ void Detector::processMaskFile() {
} else if(id == "p") {
inputMaskFile >> col >> row;
if(col > nPixels().X() - 1 || row > nPixels().Y() - 1) {
LOG(ERROR) << "Pixel " << col << " " << row << " outside of pixel matrix, chip has only "
<< nPixels().X() << " x " << nPixels().Y() << " pixels!";
LOG(WARNING) << "Pixel " << col << " " << row << " outside of pixel matrix, chip has only "
<< nPixels().X() << " x " << nPixels().Y() << " pixels!";
}
LOG(TRACE) << "Masking pixel " << col << " " << row;
maskChannel(col, row); // Flag to mask a pixel
} else {
LOG(ERROR) << "Could not parse mask entry (id \"" << id << "\")";
LOG(WARNING) << "Could not parse mask entry (id \"" << id << "\")";
}
}
LOG(INFO) << m_masked.size() << " masked pixels";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment