12 #include <boost/date_time/local_time/local_time.hpp> 17 #include <QFileDialog> 18 #include <QMouseEvent> 20 #include <qwt_symbol.h> 21 #include <qwt_plot_grid.h> 22 #include <qwt_plot_zoomer.h> 30 #undef ACTUAL_NUM_PIXELS 31 #define ACTUAL_NUM_PIXELS 1440 49 first = neighbors[pixel][
first];
50 second = neighbors[pixel][
second];
53 color[
i] = pixelsColor[pixel][
i];
59 color[
i] += pixelsColor[first][
i];
65 color[
i] += pixelsColor[second][
i];
81 first = neighbors[pixel][
first];
83 color[
i] = pixelsColor[pixel][
i];
89 color[
i] += pixelsColor[first][
i];
103 for (
int i=0;
i<3;
i++)
104 color[
i] = pixelsColor[index][
i];
105 glBegin(GL_TRIANGLES);
106 calcBlurColor(index, 0);
107 glVertex2fv(verticesList[verticesIndices[index][0]]);
109 glVertex2fv(pixelsCoords[index]);
111 calcBlurColor(index, 1);
112 glVertex2fv(verticesList[verticesIndices[index][1]]);
114 glVertex2fv(verticesList[verticesIndices[index][1]]);
116 glVertex2fv(pixelsCoords[index]);
118 calcBlurColor(index, 2);
119 glVertex2fv(verticesList[verticesIndices[index][2]]);
121 glVertex2fv(verticesList[verticesIndices[index][2]]);
123 glVertex2fv(pixelsCoords[index]);
125 calcBlurColor(index, 3);
126 glVertex2fv(verticesList[verticesIndices[index][3]]);
128 glVertex2fv(verticesList[verticesIndices[index][3]]);
130 glVertex2fv(pixelsCoords[index]);
132 calcBlurColor(index, 4);
133 glVertex2fv(verticesList[verticesIndices[index][4]]);
135 glVertex2fv(verticesList[verticesIndices[index][4]]);
137 glVertex2fv(pixelsCoords[index]);
139 calcBlurColor(index, 5);
140 glVertex2fv(verticesList[verticesIndices[index][5]]);
142 glVertex2fv(verticesList[verticesIndices[index][5]]);
144 glVertex2fv(pixelsCoords[index]);
146 calcBlurColor(index, 0);
147 glVertex2fv(verticesList[verticesIndices[index][0]]);
161 glTranslatef(0,-0.44,0);
162 glRotatef(cameraRotation, 0,0,-1);
163 if (cameraRotation == 90)
165 glTranslatef(-0.45,-0.45,0);
167 if (cameraRotation == -90)
169 glTranslatef(0.45,-0.45,0);
175 glRotatef(cameraRotation, 0,0,-1);
176 if (cameraRotation == 90)
178 glTranslatef(-0.45/1.5,-0.45/1.5,0);
180 if (cameraRotation == -90)
182 glTranslatef(0.45/1.5,-0.45/1.5,0);
185 glColor3f(0.5,0.5,0.5);
192 color = (float)(
i)/(float)(ACTUAL_NUM_PIXELS);
198 color = float(eventData[nRoi*hardwareMapping[
i] + whichSlice]+(VALUES_SPAN/2))/(float)(VALUES_SPAN-1);
203 color = log10(color);
208 pixelsColor[
i][0] = tooLowValueCoulour[0];
209 pixelsColor[
i][1] = tooLowValueCoulour[1];
210 pixelsColor[
i][2] = tooLowValueCoulour[2];
215 pixelsColor[
i][0] = tooHighValueCoulour[0];
216 pixelsColor[
i][1] = tooHighValueCoulour[1];
217 pixelsColor[
i][2] = tooHighValueCoulour[2];
221 while (ss[index] < color && index < 4)
224 if (index < 0) index = 0;
225 float weight0 = (color-ss[index]) / (ss[index+1]-ss[index]);
226 if (weight0 > 1.0f) weight0 = 1.0f;
227 if (weight0 < 0.0f) weight0 = 0.0f;
228 float weight1 = 1.0f-weight0;
229 pixelsColor[
i][0] = weight1*rr[index] + weight0*rr[index+1];
230 pixelsColor[
i][1] = weight1*gg[index] + weight0*gg[index+1];
231 pixelsColor[
i][2] = weight1*bb[index] + weight0*bb[index+1];
237 glColor3fv(pixelsColor[
i]);
240 drawBlurryHexagon(i);
247 glTranslatef(0,0,0.1f);
248 glColor3f(0.0f,0.0f,0.0f);
252 drawHexagon(
i,
false);
263 float yRange =
bboxMax[1] - bboxMin[1];
267 glColor3f(0.0,0.0,0.0);
268 glVertex2f(bboxMin[0], bboxMin[1]);
269 glVertex2f(
bboxMax[0], bboxMin[1]);
270 glVertex2f(bboxMin[0], bboxMin[1]);
271 glVertex2f(bboxMin[0],
bboxMax[1]);
272 glVertex2f(bboxMin[0], (bboxMin[1]+
bboxMax[1])/2.0f);
274 glVertex2f(bboxMin[0] + xRange*nRoi/(
float)(nRoi+nRoiTM),
276 glVertex2f(bboxMin[0] + xRange*nRoi/(
float)(nRoi+nRoiTM),
279 glTranslatef(0,0,0.1f);
283 glColor3f(1.0f,1.0f,0.0f);
284 float divideMe = (float)(VALUES_SPAN-1);
285 float plusMe = (float)(VALUES_SPAN)/2;
299 int mapping = hardwareMapping[selectedPixel];
300 const int hw = mapping;
302 const int pixelIdInPatch = mapEntry.
pixel();
303 const int patchId = mapEntry.
patch();
304 const int boardId = mapEntry.
board();
305 const int crateId = mapEntry.
crate();
307 if (selectedPixel != -1)
309 for (
int i=0;
i<nRoi-1;
i++)
311 float d1 = eventData[nRoi*hw +
i]+plusMe;
312 float d2 = eventData[nRoi*hw +
i+1]+plusMe;
313 if (!finite(d1)) d1 = 20000;
314 if (!finite(d2)) d2 = 20000;
315 glVertex2f(bboxMin[0] + xRange*
i/(
float)(nRoi+nRoiTM),
316 bboxMin[1] + yRange*(d1) /divideMe);
317 glVertex2f(bboxMin[0] + xRange*(
i+1)/(
float)(nRoi+nRoiTM),
318 bboxMin[1] + yRange*(d2) /divideMe);
322 glColor3f(0.0f, 1.0f, 1.0f);
324 if (pixelIdInPatch == 8)
327 for (
int i=0;
i<nRoiTM-1;
i++)
329 float d1 = eventData[nRoi*1440 + nRoiTM*(40*crateId + 4*boardId + patchId) +
i] + plusMe;
330 float d2 = eventData[nRoi*1440 + nRoiTM*(40*crateId + 4*boardId + patchId) +
i+1] + plusMe;
331 if (!finite(d1)) d1 = 20000;
332 if (!finite(d2)) d2 = 20000;
333 glVertex2f(bboxMin[0] + xRange*(
i+nRoi)/(
float)(nRoi+nRoiTM),
334 bboxMin[1] + yRange*(d1)/divideMe);
335 glVertex2f(bboxMin[0] + xRange*(
i+1+nRoi)/(
float)(nRoi+nRoiTM),
336 bboxMin[1] + yRange*(d2) / divideMe);
342 glTranslatef(0,0,0.1f);
344 glColor3f(1.0,0.0,0.0);
345 glVertex2f(bboxMin[0] + xRange*whichSlice/(
float)(nRoi+nRoiTM),
347 glVertex2f(bboxMin[0] + xRange*whichSlice/(
float)(nRoi+nRoiTM),
387 if (!mypMap.
Read(
"FACTmap111030.txt"))
389 if (!mypMap.
Read(
"/swdev_nfs/FACT++/FACTmap111030.txt"))
391 if (!mypMap.
Read(
"./FACTmap111030.txt"))
393 cerr <<
"ERROR - Problems reading FACTmap111030.txt" << endl;
401 if (!mypMap.
Read(map))
403 cerr <<
"ERROR - Problems reading mapping file '" << map <<
"'" << endl;
410 for (
int i=0;
i<160;
i++)
412 const float color[3] = { 0.5, 0.5, 0.3 };
414 for (
int j=0;j<3;j++)
453 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
456 glTranslatef(0,0,-0.5);
460 glShadeModel(GL_SMOOTH);
465 glShadeModel(GL_FLAT);
468 glTranslatef(0,0,0.1f);
471 glTranslatef(0,0,0.1f);
475 glColor3f(1.0,1.0,1.0);
478 glTranslatef(0,0,0.1f);
486 glTranslatef(0,0,0.1f);
495 if (cEvent->pos().x() > width()-(width()/50.f))
538 if (cEvent->buttons() & Qt::LeftButton) {
541 }
else if (cEvent->buttons() & Qt::RightButton) {
573 catch (std::runtime_error e)
575 cout <<
"Something went wrong while loading fits. Aborting: " << e.what() << endl;
584 vector<string> entriesToCheck;
586 entriesToCheck.push_back(
"ZNAXIS2");
588 entriesToCheck.push_back(
"NAXIS2");
589 entriesToCheck.push_back(
"NROI");
590 entriesToCheck.push_back(
"REVISION");
591 entriesToCheck.push_back(
"RUNID");
592 entriesToCheck.push_back(
"NBOARD");
593 entriesToCheck.push_back(
"NPIX");
594 entriesToCheck.push_back(
"NROITM");
595 entriesToCheck.push_back(
"TIMESYS");
596 entriesToCheck.push_back(
"DATE");
597 entriesToCheck.push_back(
"NIGHT");
598 entriesToCheck.push_back(
"CAMERA");
599 entriesToCheck.push_back(
"DAQ");
600 entriesToCheck.push_back(
"TSTART");
601 entriesToCheck.push_back(
"TSTOP");
604 for (vector<string>::const_iterator it=entriesToCheck.begin(); it != entriesToCheck.end(); it++)
608 cout <<
"Warning: header keyword " << *it <<
" missing." << endl;
611 catch (std::runtime_error e)
613 cout << e.what() << endl;
649 cout <<
"could not read num pixels from fits header. Assuming 1440 (FACT)." << endl;
655 if (cols.find(
"Data") == cols.end())
657 cout <<
"ERROR: Column \"Data\" could not be found. abortin load." << endl;
660 const fits::Table::Columns::const_iterator col = cols.find(
"Data");
661 if (col->second.type !=
'I')
663 cout <<
"ERROR: Data Column has type " << col->second.type <<
" while viewer expects I" << endl;
666 if (col->second.num %
nPixels != 0)
668 cout <<
"ERROR: Num pixels (" <<
nPixels <<
") does not match Data length (" << col->second.num <<
"). Aborting" << endl;
672 cout <<
"Estimate num samples per pixels to be " <<
nRoi;
702 cout <<
"Warning: could not find column \"EventNum\"" << endl;
706 cout <<
"Warning: could not find column \"TriggerType\"" << endl;
710 cout <<
"Warning: could not find column \"SoftTrig\"" << endl;
714 cout <<
"Warning: could not find column \"BoardTime\"" << endl;
718 cout <<
"Warning: could not find column \"StartCellData\"" << endl;
722 cout <<
"Warning: could not find column \"StartCellTimeMarker\"" << endl;
726 cout <<
"Warning: could not find column \"TimeMarker\"" << endl;
728 catch (
const runtime_error &e)
730 cout << e.what() << endl;
731 cout <<
"Loading aborted." << endl;
744 catch (
const runtime_error&)
751 cout <<
"Warning: could not find column \"UnixTimeUTC\" nor \"PCTime\"" << endl;
754 catch (
const runtime_error&)
785 catch (
const runtime_error &e)
787 msg = string(
"Something went wrong while loading Drs Calib: ") + e.what() + string(
".. Aborting file loading");
793 template <
typename T>
795 const vector<T>& inputData,
800 eventData =
new float[1440*roi + 160*roiTM];
804 long long min, max, mean;
805 min = max = inputData[0];
807 for (
int i=0;
i<1440*roi + 160*roiTM;
i++) {
809 mean += inputData[
i];
810 if (inputData[
i] > max)
812 if (inputData[
i] < min)
815 mean /= 1440*roi + 160*roiTM;
816 for (
int i=0;
i<1440*roi + 160*roiTM;
i++)
860 int nSlicesToRemove = 60;
861 float* backupData = 0;
864 backupData =
new float[nSlicesToRemove*160];
865 for (
int i=0;
i<1440;
i++)
868 const int pixelIdInPatch = mapEntry.
pixel();
869 const int patchId = mapEntry.
patch();
870 const int boardId = mapEntry.
board();
871 const int crateId = mapEntry.
crate();
873 const int hw = mapEntry.
hw();
874 if (pixelIdInPatch == 8)
876 for (
int j=0;j<nSlicesToRemove;j++)
878 backupData[(40*crateId + 4*boardId + patchId)*nSlicesToRemove+j] =
eventData[(hw*
nRoi) + (nRoi-nSlicesToRemove) + j];
879 eventData[(hw*
nRoi) + (nRoi-nSlicesToRemove) + j] = eventData[hw*nRoi + (nRoi-nSlicesToRemove) - 1];
885 vector<float> pixelStatsData(1440*4);
888 for (vector<PixelMapEntry>::const_iterator it=
fPixelMap.begin(); it!=
fPixelMap.end(); it++)
890 Meanvalues[it->index] = pixelStatsData[0*1440+it->hw()];
891 RMSvalues[it->index] = pixelStatsData[1*1440+it->hw()];
892 Maxvalues[it->index] = pixelStatsData[2*1440+it->hw()];
897 for (
int i=0;
i<1440;
i++)
900 const int pixelIdInPatch = mapEntry.
pixel();
901 const int patchId = mapEntry.
patch();
902 const int boardId = mapEntry.
board();
903 const int crateId = mapEntry.
crate();
905 cout <<
"Voila mon probleme: " << patchId << endl;
906 const int hw = mapEntry.
hw();
907 if (pixelIdInPatch == 8)
910 for (
int j=0;j<nSlicesToRemove;j++)
912 eventData[(hw*
nRoi) + (
nRoi - nSlicesToRemove) + j] = backupData[(40*crateId + 4*boardId + patchId)*nSlicesToRemove+j];
939 cout <<
"Warning: did not expect Time Markers data from Monte-Carlo simulations. These will not be mapped properly." << endl;
941 int16_t* tempData =
new int16_t[1440*
nRoi];
945 for (
int i=0;
i<1440;
i++)
946 for (
int j=0;j<
nRoi;j++)
1010 cout <<
"A FITS file must be open in order to complete this operation" << endl;
1044 for (
int i=0;
i<nRoi-3;
i++)
1046 const float fract = 0.8f;
1052 xp =
aMeas[
i+1] - n1mean[
i+1];
1053 xpp =
aMeas[
i+2] - n1mean[
i+2];
1062 if ((xp > -2.*xx*fract) && (xpp < -10.f))
1084 currentFile =
"none";
1085 currentCalibFile =
"none";
1087 updateSpinnerDisplay =
true;
1090 timer.setInterval(10.0);
1091 QObject::connect(&timer, SIGNAL(timeout()),
1092 this, SLOT(nextSlicePlease()));
1094 QButtonGroup &
scaleGroup = *
new QButtonGroup(p);
1095 QButtonGroup &animateGroup = *
new QButtonGroup(p);
1097 scaleGroup.addButton(currentPixelScale);
1098 scaleGroup.addButton(entireCameraScale);
1100 animateGroup.addButton(playEventsRadio);
1101 animateGroup.addButton(playSlicesRadio);
1102 animateGroup.addButton(playPixelsRadio);
1104 entireCameraScale->setChecked(
true);
1106 RMS_window->enableText(
false);
1107 Mean_window->enableText(
false);
1108 PosOfMax_window->enableText(
false);
1109 Max_window->enableText(
false);
1114 this, SLOT(on_autoScaleColor_clicked()));
1116 this, SLOT(currentSliceHasChanged(
int)));
1118 this, SLOT(currentEventHasChanged(
int)));
1120 this, SLOT(pixelChanged(
int)));
1145 boardsTimeHistoItem.detach();
1146 startCellHistoItem.detach();
1147 startTimeMarkHistoItem.detach();
1148 pixelValueCurveItem.detach();
1149 pixelAverageCurveItem.detach();
1150 aMeanCurveItem.detach();
1151 vCorrCurveItem.detach();
1152 meanCurveItem.detach();
1156 GLWindow->nextSlice();
1160 GLWindow->previousSlice();
1164 GLWindow->fIsDrsCalibration = state;
1165 GLWindow->ApplyCalibration();
1166 threeD_Window->setData(GLWindow->eventData);
1168 on_autoScaleColor_clicked();
1169 pixelChanged(GLWindow->selectedPixel);
1177 GLWindow->drawPatch = state;
1178 GLWindow->updateGL();
1179 RMS_window->fDrawPatch = state;
1180 RMS_window->updateGL();
1181 Mean_window->fDrawPatch = state;
1182 Mean_window->updateGL();
1183 Max_window->fDrawPatch = state;
1184 Max_window->updateGL();
1185 PosOfMax_window->fDrawPatch = state;
1186 PosOfMax_window->updateGL();
1193 GLWindow->drawImpulse = state;
1194 TriggerOffset_window->drawImpulse = state;
1195 Gain_window->drawImpulse = state;
1196 Baseline_window->drawImpulse = state;
1197 GLWindow->updateGL();
1198 TriggerOffset_window->updateGL();
1199 Gain_window->updateGL();
1200 Baseline_window->updateGL();
1207 GLWindow->drawBlur = state;
1208 GLWindow->updateGL();
1212 GLWindow->loopCurrentEvent = state;
1220 if (playEventsRadio->isChecked ())
1221 GLWindow->eventStepping(
true);
1223 if (playPixelsRadio->isChecked())
1224 GLWindow->setCurrentPixel((GLWindow->getCurrentPixel()+1)%1440);
1226 GLWindow->nextSlice();
1241 timer.setInterval(1000.0/value);
1274 dialog.setFileMode(QFileDialog::ExistingFile);
1275 dialog.open(
this, SLOT(fileSelected(QString)));
1276 dialog.setVisible(
true);
1282 dialog.setFileMode(QFileDialog::ExistingFile);
1283 dialog.open(
this, SLOT(calibFileSelected(QString)));
1284 dialog.setVisible(
true);
1292 currentFile = file.toStdString();
1293 if (currentFile !=
"")
1294 GLWindow->openFile(currentFile);
1298 currentCalibFile = file.toStdString();
1299 if (currentCalibFile !=
"")
1300 GLWindow->openCalibFile(currentCalibFile);
1301 if (GLWindow->fDrsCalib.fRoi != 0)
1304 GLWindow->fDrsCalib.fOffset,
1305 GLWindow->fDrsCalib.fRoi,
1306 GLWindow->fDrsCalib.fNumTm);
1309 GLWindow->fDrsCalib.fGain,
1310 GLWindow->fDrsCalib.fRoi,
1311 GLWindow->fDrsCalib.fNumTm);
1314 GLWindow->fDrsCalib.fTrgOff,
1315 GLWindow->fDrsCalib.fRoi,
1316 GLWindow->fDrsCalib.fNumTm);
1329 if (currentFile.size() > 2)
1330 str << currentFile.substr(currentFile.find_last_of(
"//")+1, currentFile.size()) <<
"\n";
1333 str <<
"Calibration: ";
1334 if (currentCalibFile.size() > 2)
1335 str << currentCalibFile.substr(currentCalibFile.find_last_of(
"//")+1, currentCalibFile.size()) <<
"\n";
1340 str <<
"Run number: " << GLWindow->runNumber <<
"\n";
1343 str <<
"Number of Events: " << GLWindow->nRows <<
"\n";
1345 displayingEventBox->setMaximum(GLWindow->nRows-1);
1347 str <<
"Number of Slices: " << GLWindow->nRoi <<
"\n";
1350 str <<
"Number of Time Marks: " << GLWindow->nTM <<
"\n";
1354 str <<
"Run Type: " << GLWindow->runType <<
"\n";
1357 str <<
"Time of 1st data: " << GLWindow->firstDataTime <<
"\n";
1360 str <<
"Time of last data: " << GLWindow->lastDataTime <<
"\n";
1363 str <<
"SVN revision: " << GLWindow->revision <<
'\n';
1364 str <<
"Number of boards: " << GLWindow->nBoards <<
'\n';
1365 str <<
"Number of pixels: " << GLWindow->nPixels <<
'\n';
1366 str <<
"Number of Slices TM: " << GLWindow->nRoiTM <<
'\n';
1367 str <<
"Time system: " << GLWindow->timeSystem <<
'\n';
1368 str <<
"Date: " << GLWindow->creationDate <<
'\n';
1369 str <<
"Night: " << GLWindow->nightInt <<
'\n';
1370 str <<
"Camera: " << GLWindow->camera <<
'\n';
1371 str <<
"DAQ: " << GLWindow->daq <<
'\n';
1372 str <<
"ADC Count: " << GLWindow->adcCount <<
'\n';
1373 str <<
"NB Evts OK:" << GLWindow->nbOk <<
'\n';
1374 str <<
"NB Evts Rejected: " << GLWindow->nbRej <<
'\n';
1375 str <<
"NB Evts Bad: " << GLWindow->nbBad <<
'\n';
1376 extraInfoLabel->setText(QString(str.str().c_str()));
1391 if (timer.isActive())
1399 if (!GLWindow->nRoi)
1401 if (GLWindow->selectedPixel == -1)
1404 str <<
" Current Pixel val.: --";
1405 currentPixelValue->setText(QString(str.str().c_str()));
1409 int mapping = GLWindow->hardwareMapping[GLWindow->selectedPixel];
1410 const int idx = GLWindow->nRoi*mapping + GLWindow->whichSlice;
1413 str <<
"Current Pixel val.: " << GLWindow->eventData[idx];
1414 currentPixelValue->setText(QString(str.str().c_str()));
1422 if (!GLWindow->nRoi)
1425 if (updateSpinnerDisplay)
1426 displayingSliceBox->setValue(slice);
1428 displaySliceValue();
1441 if (!updateSpinnerDisplay)
1443 updateSpinnerDisplay =
false;
1445 GLWindow->rowNum = cEvent - GLWindow->eventStep;
1446 GLWindow->eventStepping(
true);
1447 updateSpinnerDisplay =
true;
1453 timer.setInterval(1000.0/value);
1457 updateSpinnerDisplay =
false;
1458 currentSliceHasChanged(cSlice);
1459 updateSpinnerDisplay =
true;
1460 GLWindow->whichSlice = cSlice;
1461 GLWindow->updateGL();
1466 RMS_window->SetData(GLWindow->RMSvalues);
1467 Mean_window->SetData(GLWindow->Meanvalues);
1468 PosOfMax_window->SetData(GLWindow->PosOfMaxvalues);
1469 Max_window->SetData(GLWindow->Maxvalues);
1470 threeD_Window->setData(GLWindow->eventData);
1472 if (RMS_window->isVisible())
1473 RMS_window->updateGL();
1474 if (Mean_window->isVisible())
1475 Mean_window->updateGL();
1476 if (PosOfMax_window->isVisible())
1477 PosOfMax_window->updateGL();
1478 if (Max_window->isVisible())
1479 Max_window->updateGL();
1484 if (updateSpinnerDisplay)
1486 updateSpinnerDisplay =
false;
1487 displayingEventBox->setValue(GLWindow->rowNum);
1488 updateSpinnerDisplay =
true;
1494 boost::posix_time::ptime hrTime( boost::gregorian::date(1970, boost::gregorian::Jan, 1),
1495 boost::posix_time::seconds(GLWindow->pcTime[0]) + boost::posix_time::microsec(GLWindow->pcTime[1]));
1498 str <<
"PC Time: " << boost::posix_time::to_iso_extended_string(hrTime);
1499 PCTimeLabel->setText(QString(str.str().c_str()));
1502 str <<
"Software Trigger: " << GLWindow->softTrig;
1503 softwareTriggerLabel->setText(QString(str.str().c_str()));
1506 str <<
"Trigger Type: " << GLWindow->triggerType;
1507 triggerTypeLabel->setText(QString(str.str().c_str()));
1509 displaySliceValue();
1511 if (autoScaleColor->isChecked())
1512 emit GLWindow->colorPaletteHasChanged();
1514 boardsTimeList->clear();
1515 startPixelsList->clear();
1516 startTimeMarksList->clear();
1517 triggerDelayList->clear();
1518 std::map<int, int> boardsHistoMap;
1523 if (i<10) str <<
" ";
1524 if (i<100) str <<
" ";
1525 if (i<1000) str <<
" ";
1526 str <<
": " << GLWindow->boardTime[
i];
1527 boardsTimeList->addItem(QString(str.str().c_str()));
1528 if (boardsHistoMap.find(GLWindow->boardTime[i]) != boardsHistoMap.end())
1529 boardsHistoMap[GLWindow->boardTime[i]]++;
1531 boardsHistoMap[GLWindow->boardTime[i]] = 1;
1533 std::map<int, int> pixelHistoMap;
1538 if (i<10) str <<
" ";
1539 if (i<100) str <<
" ";
1540 if (i<1000) str <<
" ";
1541 str <<
": " << GLWindow->startPix[
i];
1542 startPixelsList->addItem(QString(str.str().c_str()));
1543 if (pixelHistoMap.find(GLWindow->startPix[i]) != pixelHistoMap.end())
1544 pixelHistoMap[GLWindow->startPix[i]]++;
1546 pixelHistoMap[GLWindow->startPix[i]] = 1;
1549 std::map<int, int> timeMarksMap;
1554 if (i<10) str <<
" ";
1555 if (i<100) str <<
" ";
1556 if (i<1000) str <<
" ";
1557 str <<
": " << GLWindow->startTM[
i];
1558 startTimeMarksList->addItem(QString(str.str().c_str()));
1559 if (timeMarksMap.find(GLWindow->startTM[i]) != timeMarksMap.end())
1560 timeMarksMap[GLWindow->startTM[i]]++;
1562 timeMarksMap[GLWindow->startTM[i]] = 1;
1564 std::map<int,int> delayMap;
1565 triggerDelayList->addItem(QString(
"Patch | Slice:Delay Slice:Delay..."));
1570 for (
int j=0;j<GLWindow->nRoi;j++)
1572 int value = GLWindow->eventData[1440*GLWindow->nRoi + i*GLWindow->nRoi + j];
1573 if (delayMap.find(value) != delayMap.end())
1576 delayMap[value] = 1;
1577 str << j <<
":" << value <<
" ";
1579 triggerDelayList->addItem(QString(str.str().c_str()));
1582 std::map<int,int>::iterator it = boardsHistoMap.begin();
1584 int previousValue = it->first-10;
1585 for (
unsigned int i=0;
i<boardsHistoMap.size();
i++)
1587 if (previousValue != it->first-1)
1589 xval[nsamples] = previousValue+1;
1592 xval[nsamples] = it->first-1;
1596 xval[nsamples] = it->first;
1597 yval[nsamples] = it->second;
1598 previousValue = it->first;
1601 xval[nsamples] = previousValue;
1604 if (nsamples > 4090)
1606 cout <<
"Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl;
1610 xval[nsamples] = it==boardsHistoMap.begin() ? 0 : (--it)->
first+1;
1614 #if QWT_VERSION < 0x060000 1615 boardsTimeHistoItem.setData(
xval,
yval, nsamples);
1617 boardsTimeHistoItem.setSamples(
xval,
yval, nsamples);
1620 it = pixelHistoMap.begin();
1622 previousValue = it->first-10;
1623 for (
unsigned int i=0;
i<pixelHistoMap.size();
i++)
1625 if (previousValue != it->first-1)
1627 xval[nsamples] = previousValue+1;
1630 xval[nsamples] = it->first-1;
1634 xval[nsamples] = it->first;
1635 yval[nsamples] = it->second;
1636 previousValue = it->first;
1639 xval[nsamples] = previousValue;
1642 if (nsamples > 4090)
1644 cout <<
"Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl;
1648 xval[nsamples] = it==pixelHistoMap.begin() ? 0 : (--it)->
first+1;
1652 #if QWT_VERSION < 0x060000 1653 startCellHistoItem.setData(
xval,
yval, nsamples);
1655 startCellHistoItem.setSamples(
xval,
yval, nsamples);
1658 it = timeMarksMap.begin();
1660 previousValue = it->first-10;
1661 for (
unsigned int i=0;
i<timeMarksMap.size();
i++)
1663 if (previousValue != it->first-1)
1665 xval[nsamples] = previousValue+1;
1668 xval[nsamples] = it->first-1;
1672 xval[nsamples] = it->first;
1673 yval[nsamples] = it->second;
1674 previousValue = it->first;
1677 xval[nsamples] = previousValue;
1680 if (nsamples > 4090)
1682 cout <<
"Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl;
1686 xval[nsamples] = it==timeMarksMap.begin() ? 0 : (--it)->
first+1;
1690 #if QWT_VERSION < 0x060000 1691 startTimeMarkHistoItem.setData(
xval,
yval, nsamples);
1693 startTimeMarkHistoItem.setSamples(
xval,
yval, nsamples);
1696 it = delayMap.begin();
1698 previousValue = it->first-10;
1699 for (
unsigned int i=0;
i<delayMap.size();
i++)
1701 if (previousValue != it->first-1)
1703 xval[nsamples] = previousValue+1;
1706 xval[nsamples] = it->first-1;
1710 xval[nsamples] = it->first;
1711 yval[nsamples] = it->second;
1712 previousValue = it->first;
1715 xval[nsamples] = previousValue;
1718 if (nsamples > 4090)
1720 cout <<
"Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl;
1724 xval[nsamples] = it==delayMap.begin() ? 0 : (--it)->
first+1;
1728 #if QWT_VERSION < 0x060000 1729 triggerDelayHistoItem.setData(
xval,
yval, nsamples);
1731 triggerDelayHistoItem.setSamples(
xval,
yval, nsamples);
1828 QStack< QRectF > stack;
1830 stack.push(scaleBoundingRectangle(boardsTimeHistoItem.boundingRect(), 1.05f));
1831 boardsTimeHistoZoom->setZoomStack(stack);
1833 stack.push(scaleBoundingRectangle(startCellHistoItem.boundingRect(), 1.05f));
1834 startCellHistoZoom->setZoomStack(stack);
1836 stack.push(scaleBoundingRectangle(startTimeMarkHistoItem.boundingRect(), 1.05f));
1837 startTimeMarkHistoZoom->setZoomStack(stack);
1839 stack.push(scaleBoundingRectangle(triggerDelayHistoItem.boundingRect(), 1.05f));
1840 triggerDelayHistoZoom->setZoomStack(stack);
1843 pixelChanged(GLWindow->selectedPixel);
1848 QPointF bottomRight = rectangle.bottomRight();
1849 QPointF topLeft = rectangle.topLeft();
1850 QPointF center = rectangle.center();
1851 return QRectF(topLeft + (topLeft-center)*(scale-1.0f),
1852 bottomRight + (bottomRight-center)*(scale-1.0f));
1858 grid1 =
new QwtPlotGrid;
1859 grid1->enableX(
false);
1860 grid1->enableY(
true);
1861 grid1->enableXMin(
false);
1862 grid1->enableYMin(
false);
1863 grid1->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
1864 grid1->attach(boardsTimeHisto);
1866 grid2 =
new QwtPlotGrid;
1867 grid2->enableX(
false);
1868 grid2->enableY(
true);
1869 grid2->enableXMin(
false);
1870 grid2->enableYMin(
false);
1871 grid2->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
1872 grid2->attach(startCellsHisto);
1874 grid3 =
new QwtPlotGrid;
1875 grid3->enableX(
false);
1876 grid3->enableY(
true);
1877 grid3->enableXMin(
false);
1878 grid3->enableYMin(
false);
1879 grid3->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
1880 grid3->attach(startTimeMarkHisto);
1882 grid4 =
new QwtPlotGrid;
1883 grid4->enableX(
false);
1884 grid4->enableY(
true);
1885 grid4->enableXMin(
false);
1886 grid4->enableYMin(
false);
1887 grid4->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
1888 grid4->attach(pixelValueCurve);
1890 grid6 =
new QwtPlotGrid;
1891 grid6->enableX(
false);
1892 grid6->enableY(
true);
1893 grid6->enableXMin(
false);
1894 grid6->enableYMin(
false);
1895 grid6->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
1896 grid6->attach(pixelAverageCurve);
1898 grid5 =
new QwtPlotGrid;
1899 grid5->enableX(
false);
1900 grid5->enableY(
true);
1901 grid5->enableXMin(
false);
1902 grid5->enableYMin(
false);
1903 grid5->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
1904 grid5->attach(triggerDelayHisto);
1906 boardsTimeHisto->setAutoReplot(
true);
1907 startCellsHisto->setAutoReplot(
true);
1908 startTimeMarkHisto->setAutoReplot(
true);
1909 pixelValueCurve->setAutoReplot(
true);
1910 pixelAverageCurve->setAutoReplot(
true);
1911 triggerDelayHisto->setAutoReplot(
true);
1912 boardsTimeHisto->setTitle(
"Boards time values");
1913 startCellsHisto->setTitle(
"Start Cell values");
1914 startTimeMarkHisto->setTitle(
"Start Time Marks values");
1915 pixelValueCurve->setTitle(
"Current pixel values");
1916 pixelAverageCurve->setTitle(
"Average pixels values");
1917 triggerDelayHisto->setTitle(
"Trigger Delays");
1925 boardsTimeHistoItem.setPen(QColor(Qt::darkGreen));
1926 boardsTimeHistoItem.setStyle(QwtPlotCurve::Steps);
1927 startCellHistoItem.setPen(QColor(Qt::darkGreen));
1928 startCellHistoItem.setStyle(QwtPlotCurve::Steps);
1929 startTimeMarkHistoItem.setPen(QColor(Qt::darkGreen));
1930 startTimeMarkHistoItem.setStyle(QwtPlotCurve::Steps);
1931 triggerDelayHistoItem.setPen(QColor(Qt::darkGreen));
1932 triggerDelayHistoItem.setStyle(QwtPlotCurve::Steps);
1934 boardsTimeHistoItem.attach(boardsTimeHisto);
1935 startCellHistoItem.attach(startCellsHisto);
1936 startTimeMarkHistoItem.attach(startTimeMarkHisto);
1937 triggerDelayHistoItem.attach(triggerDelayHisto);
1941 pixelValueCurveItem.setPen(QColor(Qt::black));
1942 pixelAverageCurveItem.setPen(QColor(Qt::black));
1943 aMeanCurveItem.setPen(QColor(Qt::darkGreen));
1944 vCorrCurveItem.setPen(QColor(Qt::red));
1945 meanCurveItem.setPen(QColor(Qt::blue));
1946 pixelValueCurveItem.setStyle(QwtPlotCurve::Lines);
1947 pixelAverageCurveItem.setStyle(QwtPlotCurve::Lines);
1948 aMeanCurveItem.setStyle(QwtPlotCurve::Lines);
1949 vCorrCurveItem.setStyle(QwtPlotCurve::Lines);
1950 meanCurveItem.setStyle(QwtPlotCurve::Lines);
1953 pixelValueCurveItem.attach(pixelValueCurve);
1954 pixelAverageCurveItem.attach(pixelAverageCurve);
1960 curveZoom =
new QwtPlotZoomer(pixelValueCurve->canvas());
1961 curveZoom->setRubberBandPen(QPen(
Qt::gray, 2, Qt::DotLine));
1962 curveZoom->setTrackerPen(QPen(
Qt::gray));
1963 averageCurveZoom =
new QwtPlotZoomer(pixelAverageCurve->canvas());
1964 averageCurveZoom->setRubberBandPen(QPen(
Qt::gray, 2, Qt::DotLine));
1965 averageCurveZoom->setTrackerPen(QPen(
Qt::gray));
1967 boardsTimeHistoZoom =
new QwtPlotZoomer(boardsTimeHisto->canvas());
1968 boardsTimeHistoZoom->setRubberBandPen(QPen(
Qt::gray, 2, Qt::DotLine));
1969 boardsTimeHistoZoom->setTrackerPen(QPen(
Qt::gray));
1971 startCellHistoZoom =
new QwtPlotZoomer(startCellsHisto->canvas());
1972 startCellHistoZoom->setRubberBandPen(QPen(
Qt::gray, 2, Qt::DotLine));
1973 startCellHistoZoom->setTrackerPen(QPen(
Qt::gray));
1975 startTimeMarkHistoZoom =
new QwtPlotZoomer(startTimeMarkHisto->canvas());
1976 startTimeMarkHistoZoom->setRubberBandPen(QPen(
Qt::gray, 2, Qt::DotLine));
1977 startTimeMarkHistoZoom->setTrackerPen(QPen(
Qt::gray));
1979 triggerDelayHistoZoom =
new QwtPlotZoomer(triggerDelayHisto->canvas());
1980 triggerDelayHistoZoom->setRubberBandPen(QPen(
Qt::gray, 2, Qt::DotLine));
1981 triggerDelayHistoZoom->setTrackerPen(QPen(
Qt::gray));
1988 RMS_window->fWhite = pixel;
1989 Mean_window->fWhite = pixel;
1990 Max_window->fWhite = pixel;
1991 PosOfMax_window->fWhite = pixel;
1994 RMS_window->fWhitePatch = RMS_window->pixelsPatch[pixel];
1995 Mean_window->fWhitePatch = Mean_window->pixelsPatch[pixel];
1996 Max_window->fWhitePatch = Max_window->pixelsPatch[pixel];
1997 PosOfMax_window->fWhitePatch = PosOfMax_window->pixelsPatch[pixel];
2001 RMS_window->fWhitePatch = -1;
2002 Mean_window->fWhitePatch = -1;
2003 Max_window->fWhitePatch = -1;
2004 PosOfMax_window->fWhitePatch = -1;
2008 int softwarePix = pixel;
2010 pixel = GLWindow->hardwareMapping[pixel];
2012 HwIDBox->setValue(pixel);
2014 if (!GLWindow->nRoi)
2017 int currentPixel = pixel;
2019 for (
int i=0;
i<GLWindow->nRoi;
i++)
2022 yval[
i] = GLWindow->eventData[GLWindow->nRoi*currentPixel +
i];
2026 int realNumSamples = GLWindow->nRoi;
2027 if (GLWindow->nRoiTM != 0)
2030 const int pixelIdInPatch = mapEntry.
pixel();
2031 const int patchId = mapEntry.
patch();
2032 const int boardId = mapEntry.
board();
2033 const int crateId = mapEntry.
crate();
2034 if (pixelIdInPatch == 8)
2037 int xIndex = GLWindow->nRoi;
2038 int arrayIndex = GLWindow->nRoi;
2039 if (GLWindow->offSetRoi < 0)
2040 TMIndex -= GLWindow->offSetRoi;
2041 if (GLWindow->offSetRoi > 0)
2042 xIndex += GLWindow->offSetRoi;
2043 for (
int i=TMIndex;
i<GLWindow->nRoiTM;
i++, xIndex++, arrayIndex++)
2045 xval[arrayIndex] = xIndex;
2046 yval[arrayIndex] = GLWindow->eventData[GLWindow->nRoi*1440 + GLWindow->nRoiTM*(40*crateId + 4*boardId + patchId) +
i];
2048 realNumSamples += GLWindow->nRoiTM - TMIndex;
2053 #if QWT_VERSION < 0x060000 2054 pixelValueCurveItem.setData(
xval,
yval, realNumSamples);
2056 pixelValueCurveItem.setSamples(
xval,
yval, realNumSamples);
2061 for (
int i=0;
i<GLWindow->nRoi;
i++)
2063 for (
int j=0;j<1440;j++) {
2065 for (
int i=0;
i<GLWindow->nRoi;
i++)
2068 yval[
i] += GLWindow->eventData[GLWindow->nRoi*currentPixel +
i];
2071 for (
int i=0;
i<GLWindow->nRoi;
i++)
2073 #if QWT_VERSION < 0x060000 2074 pixelAverageCurveItem.setData(
xval,
yval, GLWindow->nRoi);
2076 pixelAverageCurveItem.setSamples(
xval,
yval, realNumSamples);
2079 QStack< QRectF > stack;
2080 stack.push(scaleBoundingRectangle(pixelValueCurveItem.boundingRect(), 1.5f));
2081 curveZoom->setZoomBase(scaleBoundingRectangle(pixelValueCurveItem.boundingRect(), 1.5f));
2082 curveZoom->setZoomStack(stack);
2084 stack.push(scaleBoundingRectangle(pixelAverageCurveItem.boundingRect(), 1.5f));
2085 averageCurveZoom->setZoomBase(scaleBoundingRectangle(pixelAverageCurveItem.boundingRect(), 1.5f));
2086 averageCurveZoom->setZoomStack(stack);
2089 displaySliceValue();
2090 on_autoScaleColor_clicked();
2097 const int hwID = HwIDBox->value();
2099 const int crateID = hwID/360;
2100 const int boardID = (hwID%360)/36;
2101 const int patchID = (hwID%36 )/9;
2102 const int pixelID = hwID%9;
2104 SwIDBox->setValue(GLWindow->softwareMapping[hwID]);
2106 crateIDBox->setValue(crateID);
2107 boardIDBox->setValue(boardID);
2108 patchIDBox->setValue(patchID);
2109 pixelIDBox->setValue(pixelID);
2113 GLWindow->selectedPixel = GLWindow->softwareMapping[hwID];
2114 GLWindow->updateGL();
2116 pixelChanged(GLWindow->selectedPixel);
2124 const int hwid = crateIDBox->value()*360 + boardIDBox->value()*36 + patchIDBox->value()*9 + pixelIDBox->value();
2125 HwIDBox->setValue(hwid);
2136 HwIDBox->setValue(GLWindow->hardwareMapping[swid]);
2141 if (!autoScaleColor->isChecked())
2143 GLWindow->ss[0] = 0.496;
2144 GLWindow->ss[1] = 0.507;
2145 GLWindow->ss[2] = 0.518;
2146 GLWindow->ss[3] = 0.529;
2147 GLWindow->ss[4] = 0.540;;
2148 colorRange0->setValue(GLWindow->ss[0]);
2149 colorRange1->setValue(GLWindow->ss[1]);
2150 colorRange2->setValue(GLWindow->ss[2]);
2151 colorRange3->setValue(GLWindow->ss[3]);
2152 colorRange4->setValue(GLWindow->ss[4]);
2155 if (!GLWindow->nRoi)
2161 if (!entireCameraScale->isChecked())
2163 start = GLWindow->selectedPixel;
2164 end = GLWindow->selectedPixel+1;
2176 long numSamples = 0;
2177 int errorDetected = -1;
2179 for (
int i=start;
i<
end;
i++)
2183 for (
int j=10;j<GLWindow->nRoi-50;j++)
2185 int cValue = GLWindow->eventData[
i*GLWindow->nRoi+j];
2186 if (cValue > max && cValue < 32767)
2188 if (cValue < min && cValue > -32768)
2190 if (cValue < 32767 && cValue > -32768)
2202 average /= numSamples;
2203 if (errorDetected != -1)
2205 cout <<
"Overflow detected at pixel " << errorDetected <<
" (at least)" << endl;
2208 float minRange = (float)(min+(GLWindow->VALUES_SPAN/2))/(
float)(GLWindow->VALUES_SPAN-1);
2209 float maxRange = (float)(max+(GLWindow->VALUES_SPAN/2))/(
float)(GLWindow->VALUES_SPAN-1);
2210 float midRange = (float)(average+(GLWindow->VALUES_SPAN/2))/(
float)(GLWindow->VALUES_SPAN-1);
2211 if (GLWindow->logScale)
2219 minRange = log10(minRange);
2220 maxRange = log10(maxRange);
2222 midRange = log10(midRange);
2225 GLWindow->ss[0] = minRange;
2226 colorRange0->setValue(GLWindow->ss[0]);
2227 GLWindow->ss[4] = maxRange;
2228 colorRange4->setValue(GLWindow->ss[4]);
2236 GLWindow->ss[2] = (maxRange+minRange)/2;
2237 colorRange2->setValue(GLWindow->ss[2]);
2239 GLWindow->ss[1] = minRange+(maxRange-minRange)/4;
2240 colorRange1->setValue(GLWindow->ss[1]);
2242 GLWindow->ss[3] = minRange+3*(maxRange-minRange)/4;
2243 colorRange3->setValue(GLWindow->ss[3]);
2249 "The FACT++ raw data viewer.\n" 2251 "Usage: viewer [OPTIONS] [datafile.fits[.gz|.fz] [calibration.drs.fits[.gz]]]\n" 2252 " or: viewer [OPTIONS]\n";
2268 if (conf.
Has(
"mappingFile"))
2275 if (conf.
Has(
"color.range"))
2277 vector<double> value = conf.
Vec<
double>(
"color.range");
2278 if (value.size() != 5)
2280 cout <<
"Error, colorRange option should have exactly 5 double values" << endl;
2283 for (
int i=0;
i<5;
i++)
2284 canvas->
ss[
i] = value[
i];
2287 if (conf.
Has(
"color.red"))
2289 vector<double> value = conf.
Vec<
double>(
"color.red");
2290 if (value.size() != 5)
2292 cout <<
"Error, colorRed option should have exactly 5 double values" << endl;
2295 for (
int i=0;
i<5;
i++)
2296 canvas->
rr[
i] = value[
i];
2299 if (conf.
Has(
"color.green"))
2301 vector<double> value = conf.
Vec<
double>(
"color.green");
2302 if (value.size() != 5)
2304 cout <<
"Error, colorGreen option should have exactly 5 double values" << endl;
2307 for (
int i=0;
i<5;
i++)
2308 canvas->
gg[
i] = value[
i];
2311 if (conf.
Has(
"color.blue"))
2313 vector<double> value = conf.
Vec<
double>(
"color.blue");
2314 if (value.size() != 5)
2316 cout <<
"Error, colorBlue option should have exactly 5 double values" << endl;
2319 for (
int i=0;
i<5;
i++)
2320 canvas->
bb[
i] = value[
i];
2323 colorRange0->setValue(canvas->
ss[0]);
2324 colorRange1->setValue(canvas->
ss[1]);
2325 colorRange2->setValue(canvas->
ss[2]);
2326 colorRange3->setValue(canvas->
ss[3]);
2327 colorRange4->setValue(canvas->
ss[4]);
2328 redValue0->setValue(canvas->
rr[0]);
2329 redValue1->setValue(canvas->
rr[1]);
2330 redValue2->setValue(canvas->
rr[2]);
2331 redValue3->setValue(canvas->
rr[3]);
2332 redValue4->setValue(canvas->
rr[4]);
2333 greenValue0->setValue(canvas->
gg[0]);
2334 greenValue1->setValue(canvas->
gg[1]);
2335 greenValue2->setValue(canvas->
gg[2]);
2336 greenValue3->setValue(canvas->
gg[3]);
2337 greenValue4->setValue(canvas->
gg[4]);
2338 blueValue0->setValue(canvas->
bb[0]);
2339 blueValue1->setValue(canvas->
bb[1]);
2340 blueValue2->setValue(canvas->
bb[2]);
2341 blueValue3->setValue(canvas->
bb[3]);
2342 blueValue4->setValue(canvas->
bb[4]);
2344 if (conf.
Has(
"drs"))
2346 const QString qstr(conf.
Get<
string>(
"drs").c_str());
2347 calibFileSelected(qstr);
2350 if (conf.
Has(
"file"))
2352 const QString qstr(conf.
Get<
string>(
"file").c_str());
2362 po::options_description configs(
"Raw Events Viewer Options");
2363 configs.add_options()
2364 (
"color.range", vars<double>(),
"Range of the display colours")
2365 (
"color.red", vars<double>(),
"Range of red values")
2366 (
"color.green", vars<double>(),
"Range of green values")
2367 (
"color.blue", vars<double>(),
"Range of blue values")
2368 (
"file,f", var<string>(),
"File to be loaded")
2369 (
"drs,d", var<string>(),
"DRS calibration file to be loaded")
2370 (
"mappingFile", var<string>(),
"Which pixels mapping file to use")
2374 po::positional_options_description p;
2384 int main(
int argc,
const char *argv[])
2386 QApplication app(argc, const_cast<char**>(argv));
2388 if (!QGLFormat::hasOpenGL()) {
2389 std::cerr <<
"This system has no OpenGL support" << std::endl;
void on_playPauseButton_clicked()
void toggleInterfaceDisplay()
void assignPixelMapFile(const string &map="")
void on_displayingEventBox_valueChanged(int)
void signalCurrentSlice(int slice)
void on_autoScaleColor_clicked()
bool HasKey(const std::string &key) const
std::string GetStr(const std::string &key) const
void signalCurrentPixel(int pixel)
void * SetPtrAddress(const std::string &name)
int crate() const
Bias supply channel.
bool setCorrectSlice(QMouseEvent *event)
void on_blueValue4_valueChanged(double)
valarray< double > RMSvalues
bool IsCompressedFITS() const
#define ACTUAL_NUM_PIXELS
std::map< std::string, Column > Columns
void fileSelected(QString file)
valarray< double > Maxvalues
void on_HwIDBox_valueChanged(int=0)
void on_greenValue1_valueChanged(double)
void calcBlurColor(int pixel, int vertex)
valarray< double > PosOfMaxvalues
virtual void drawPatches()
int64_t second
offset of this column in the tile, from the start of the heap area
void getCalibrationDataForDisplay(const CalibDataTypes calibTypes, const vector< T > &inputData, const int roi, const int roiTM)
bool Apply(float *vec, const int16_t *val, const int16_t *start, uint32_t roi)
void on_greenValue2_valueChanged(double)
void SetPrintUsage(const std::function< void(void)> &func)
T Get(const std::string &var)
uint32_t boardTime[NBOARDS]
void openFile(std::string &file)
void slicesPerSecondChanged(double value)
void drawCamera(bool alsoWire)
void mousePressEvent(QMouseEvent *event)
void on_loadDRSCalibButton_clicked()
std::string ReadFitsImp(const std::string &str, std::vector< float > &vec)
std::vector< T > Vec(const std::string &var)
void on_blueValue1_valueChanged(double)
void on_blueValue2_valueChanged(double)
void signalCurrentEvent(int event)
void on_redValue3_valueChanged(double)
void openCalibFile(std::string &file)
void currentSliceHasChanged(int slice)
void SetArgumentPositions(const po::positional_options_description &desc)
int64_t first
Size of this column in the tile.
void mouseMoveEvent(QMouseEvent *event)
static void RemoveSpikes(float *p, uint32_t roi)
void calcMidBlurColor(int pixel, int vertex)
void currentEventHasChanged(int event)
void drawBlurryHexagon(int index)
void SetupConfiguration(Configuration &conf)
void on_drawBlurCheckBox_stateChanged(int)
void SetAutoRefresh(bool on)
void on_blueValue0_valueChanged(double)
void allocateZeroArray()
Used to load zero data in case of missing fits columns.
void mouseDoubleClickEvent(QMouseEvent *event)
void calibFileSelected(QString file)
bool Has(const std::string &var)
void on_redValue2_valueChanged(double)
void AddOptions(const po::options_description &opt, bool visible=true)
UIConnector(QWidget *parent=0)
double GetFloat(const std::string &key) const
int SetupConfiguration(Configuration &conf)
void on_displayingSliceBox_valueChanged(int)
void on_colorRange4_valueChanged(double)
void on_SwIDBox_valueChanged(int)
void eventStepping(bool plus)
const PixelMapEntry & index(int idx) const
int64_t GetInt(const std::string &key) const
void on_redValue4_valueChanged(double)
void on_greenValue3_valueChanged(double)
void setCurrentPixel(int)
QButtonGroup * scaleGroup
void on_colorRange1_valueChanged(double)
void on_colorRange3_valueChanged(double)
void assignPixelMap(const PixelMap &)
Commandline parsing, resource file parsing and database access.
void drawHexagon(int index, bool solid)
virtual int PixelAtPosition(const QPoint &pos)
void on_greenValue0_valueChanged(double)
void on_redValue1_valueChanged(double)
void on_blueValue3_valueChanged(double)
void on_loadNewFileButton_clicked()
bool HasColumn(const std::string &col) const
void on_slicesPerSecValue_valueChanged(double)
void on_drawPatchCheckBox_stateChanged(int)
void on_redValue0_valueChanged(double)
RawDataViewer(QWidget *parent=0)
void colorPaletteHasChanged()
static PixelMap fPixelMap
valarray< double > Meanvalues
void on_greenValue4_valueChanged(double)
int main(int argc, const char *argv[])
QRectF scaleBoundingRectangle(QRectF rectangle, float scale)
void on_calibratedCheckBox_stateChanged(int state)
void on_drawImpulseCheckBox_stateChanged(int)
static double GetPixelStats(float *ptr, const float *data, uint16_t roi, uint16_t begskip=0, uint16_t endskip=0)
const Table::Columns & GetColumns() const
void on_loopOverCurrentEventBox_stateChanged(int)
GLfloat patchesColor[160][3]
bool Read(const std::string &fname)
bool DoParse(int argc, const char **argv, const std::function< void()> &func=std::function< void()>())
static int softwareMapping[NPIX]
T Get(const std::string &key) const
void computePulsesStatistics()
void setEventStep(int step)
void on_colorRange0_valueChanged(double)
virtual bool GetRow(size_t row, bool check=true)
void on_colorRange2_valueChanged(double)