CFEL - ASG Software Suite
2.5.0
CASS
|
pixel detector gain calibrations More...
#include <pixel_detector_calibration.h>
Public Member Functions | |
pp331 (const name_t &) | |
constructor. More... | |
virtual void | process (const CASSEvent &, result_t &) |
overwrite default behaviour don't do anything More... | |
virtual void | loadSettings (size_t) |
load the settings of this pp More... | |
virtual void | aboutToQuit () |
write the calibrations before quitting More... | |
virtual void | processCommand (std::string command) |
receive commands from the gui More... | |
![]() | |
AccumulatingProcessor (const name_t &name) | |
constructor More... | |
virtual | ~AccumulatingProcessor () |
virtual destructor More... | |
virtual void | processEvent (const CASSEvent &evt) |
process the event More... | |
virtual const result_t & | result (const CASSEvent::id_t) |
retrieve a result. More... | |
virtual void | releaseEvent (const CASSEvent &) |
overwrite default behaviour to do nothing More... | |
virtual void | createHistList (result_t::shared_pointer result) |
create the list of results More... | |
![]() | |
Processor (const name_t &name) | |
constructor More... | |
virtual | ~Processor () |
virtual destructor More... | |
result_t::shared_pointer | resultCopy (const uint64_t eventid) |
retrieve histogram for id More... | |
virtual void | load () |
load the general settings More... | |
const names_t & | dependencies () |
Define all processors keys a processor depends on. More... | |
void | clearDependencies () |
clear the dependenies More... | |
void | clearHistograms () |
clear the histograms More... | |
const name_t | name () const |
retrieve the name of this processor More... | |
bool | hide () const |
retrieve the hide flag of this processor More... | |
const std::string & | comment () const |
retrieve the comment of this processor More... | |
Protected Member Functions | |
void | loadCalibration () |
write the calibration data to file More... | |
void | writeCalibration () |
write the calibration data to file More... | |
void | calculateGainMap (result_t &gainmap) |
write the calibration data to file More... | |
![]() | |
virtual void | createHistList (result_t::shared_pointer result) |
create result list. More... | |
void | setupGeneral () |
general setup of the processor More... | |
bool | setupCondition (bool defaultConditionType=true) |
setup the condition. More... | |
shared_pointer | setupDependency (const std::string &depVarName, const name_t &name="") |
setup the dependecy. More... | |
Private Types | |
typedef std::pair< size_t, double > | statistic_t |
definition of the statistic More... | |
typedef std::vector< statistic_t > | statistics_t |
defintion of the statistics More... | |
typedef std::pair< float, float > | range_t |
define the range type More... | |
Private Attributes | |
shared_pointer | _image |
the raw image More... | |
statistics_t | _statistics |
the statistics for each pixel More... | |
size_t | _minPhotonCount |
the number of photons that a pixel should have seen before calculating the gain More... | |
range_t | _aduRange |
the range of adu that indicates whether a pixel contains a photon More... | |
float | _constGain |
the gain value that will be assinged to the pixel that one could not calculate the gain for More... | |
bool | _write |
flag to tell whether the calibration should be written More... | |
std::string | _filename |
the filename that is used to save the calibration More... | |
int | _nFrames |
the number of frames after which the gain map is calculted More... | |
int | _counter |
counter to count how many times this has been called More... | |
size_t | _gainOffset |
offset to the gain part More... | |
size_t | _countOffset |
offset to the counts part More... | |
size_t | _aveOffset |
offset to the average part More... | |
size_t | _sizeOfImage |
the size of the input image More... | |
bool | _isPnCCDNoCTE |
flag to tell whether its a pnCCD we are not interested in correction the cte More... | |
Additional Inherited Members | |
![]() | |
typedef std::tr1::shared_ptr< Processor > | shared_pointer |
a shared pointer of this More... | |
typedef std::string | name_t |
define the name type More... | |
typedef std::list< name_t > | names_t |
define the list of names More... | |
typedef CachedList::item_type | result_t |
define the results More... | |
typedef CachedList::item_sp | resultsp_t |
define the shared pointer to the result More... | |
![]() | |
result_t::shared_pointer | _result |
the result that accumulates the events More... | |
size_t | _nbrEventsAccumulated |
the number of events the processor has accumulated More... | |
![]() | |
const name_t | _name |
the processors name More... | |
bool | _hide |
flag to tell whether this pp should be hidden in the dropdown list More... | |
std::string | _comment |
optional comment that one can add to a processor. More... | |
CachedList | _resultList |
the list of results More... | |
names_t | _dependencies |
the list of dependencies More... | |
shared_pointer | _condition |
pointer to the processor that will contain the condition More... | |
pixel detector gain calibrations
The output of this Processor consits of 3 images stiched together along the y (slow) coordinate. The ouput has the same x width as the input, but 3 times the y width as the input.
Y from 0 * y_input .. 1 * y_input-1: The calculated Gain Map Y from 1 * y_input .. 2 * y_input-1: The photons counts map Y from 2 * y_input .. 3 * y_input-1: The Average value of the photons of interest in that pixel
Processor/%name%/{Image}
the image of the pixel detector
Processor/%name%/{Filename}
the name of the file where the calibration will be written to. Default is out.cal
Processor/%name%/{WriteCal}
Flag to tell whether the calibration should be written. Default is true.
Processor/%name%/{ADURangeLow|ADURangeHigh}
The adu range that indicates that one photon has hit the pixel. Default is 0|0
Processor/%name%/{MinimumNbrPhotons}
The minimum number of photons that a pixel should have seen before the gain is calulated for this pixel. Default is 200
Processor/%name%/{DefaultGainValue}
The gain value that will be assinged to the pixels that haven't seen enough photons. Default is 1.
Processor/%name%/{NbrOfFrames}
The number of frames after which the gain map will be calculated. Default is -1, which sais that it will never be calulated during running and only when the program ends.
Processor/%name%/{IsPnCCDNoCTE}
If the detector is a pnCCD and one doesn't want to correct for the CTE this option will calcultate the gain for a column of a quadrant of the detector. Default is false
Definition at line 359 of file pixel_detector_calibration.h.
|
private |
define the range type
Definition at line 404 of file pixel_detector_calibration.h.
|
private |
definition of the statistic
Definition at line 392 of file pixel_detector_calibration.h.
|
private |
defintion of the statistics
Definition at line 395 of file pixel_detector_calibration.h.
pp331::pp331 | ( | const name_t & | name | ) |
constructor.
Definition at line 487 of file pixel_detector_calibration.cpp.
References loadSettings().
|
virtual |
write the calibrations before quitting
Reimplemented from cass::Processor.
Definition at line 564 of file pixel_detector_calibration.cpp.
References cass::AccumulatingProcessor::_result, _write, calculateGainMap(), and writeCalibration().
|
protected |
write the calibration data to file
calculate the average of the average pixelvalues, disregarding pixels that have not seen enough photons in the right ADU range.
assining the gain value for each pixel that has seen enough statistics. gain is calculated by formula If not enough photons are in the pixel, set the predefined user value
Definition at line 571 of file pixel_detector_calibration.cpp.
References _aveOffset, _constGain, _countOffset, _gainOffset, _minPhotonCount, _sizeOfImage, average, and cass::Result< T >::begin().
Referenced by aboutToQuit(), and process().
|
protected |
write the calibration data to file
Definition at line 549 of file pixel_detector_calibration.cpp.
Referenced by loadSettings().
|
virtual |
load the settings of this pp
Reimplemented from cass::Processor.
Definition at line 493 of file pixel_detector_calibration.cpp.
References _aduRange, _aveOffset, cass::Processor::_condition, _constGain, _counter, _countOffset, _filename, _gainOffset, _image, _isPnCCDNoCTE, _minPhotonCount, _nFrames, _sizeOfImage, _write, cass::Log::add(), QSettings::beginGroup(), cass::AccumulatingProcessor::createHistList(), QString::fromStdString(), cass::Log::INFO, loadCalibration(), cass::Processor::name(), cass::Processor::setupCondition(), cass::Processor::setupDependency(), cass::Processor::setupGeneral(), cass::toString(), and QSettings::value().
Referenced by pp331().
overwrite default behaviour don't do anything
go though all pixels of image
check if pixel is within the 1 photon adu range
calculate the mean pixel value
set the same value as for the pixel for all pixels in the columns in the quadrant
find out which which column and row we're currently working on
get pointers to the corresponding starts of the maps
when the pixel is in the upper half of the detector advance the pointer to the upper half
if we have reached the requested nbr of frames calculate the gain map
Reimplemented from cass::Processor.
Definition at line 601 of file pixel_detector_calibration.cpp.
References _aduRange, _aveOffset, _counter, _countOffset, _gainOffset, _image, _isPnCCDNoCTE, _nFrames, cass::Result< T >::begin(), calculateGainMap(), cass::Result< T >::end(), cass::CASSEvent::id(), cass::Result< T >::lock, and cass::Result< T >::shape().
|
virtual |
receive commands from the gui
Reimplemented from cass::Processor.
Definition at line 541 of file pixel_detector_calibration.cpp.
|
protected |
write the calibration data to file
Definition at line 554 of file pixel_detector_calibration.cpp.
References _filename, cass::AccumulatingProcessor::_result, _sizeOfImage, and cass::Result< T >::front().
Referenced by aboutToQuit().
|
private |
the range of adu that indicates whether a pixel contains a photon
Definition at line 407 of file pixel_detector_calibration.h.
Referenced by loadSettings(), and process().
|
private |
offset to the average part
Definition at line 433 of file pixel_detector_calibration.h.
Referenced by calculateGainMap(), loadSettings(), and process().
|
private |
the gain value that will be assinged to the pixel that one could not calculate the gain for
Definition at line 412 of file pixel_detector_calibration.h.
Referenced by calculateGainMap(), and loadSettings().
|
private |
counter to count how many times this has been called
Definition at line 424 of file pixel_detector_calibration.h.
Referenced by loadSettings(), and process().
|
private |
offset to the counts part
Definition at line 430 of file pixel_detector_calibration.h.
Referenced by calculateGainMap(), loadSettings(), and process().
|
private |
the filename that is used to save the calibration
Definition at line 418 of file pixel_detector_calibration.h.
Referenced by loadSettings(), and writeCalibration().
|
private |
offset to the gain part
Definition at line 427 of file pixel_detector_calibration.h.
Referenced by calculateGainMap(), loadSettings(), and process().
|
private |
the raw image
Definition at line 389 of file pixel_detector_calibration.h.
Referenced by loadSettings(), and process().
|
private |
flag to tell whether its a pnCCD we are not interested in correction the cte
Definition at line 439 of file pixel_detector_calibration.h.
Referenced by loadSettings(), and process().
|
private |
the number of photons that a pixel should have seen before calculating the gain
Definition at line 401 of file pixel_detector_calibration.h.
Referenced by calculateGainMap(), and loadSettings().
|
private |
the number of frames after which the gain map is calculted
Definition at line 421 of file pixel_detector_calibration.h.
Referenced by loadSettings(), and process().
|
private |
the size of the input image
Definition at line 436 of file pixel_detector_calibration.h.
Referenced by calculateGainMap(), loadSettings(), and writeCalibration().
|
private |
the statistics for each pixel
Definition at line 398 of file pixel_detector_calibration.h.
|
private |
flag to tell whether the calibration should be written
Definition at line 415 of file pixel_detector_calibration.h.
Referenced by aboutToQuit(), and loadSettings().