CFEL - ASG Software Suite
2.5.0
CASS
|
Creates a gain calibration. More...
#include <gaincalibration.h>
Public Member Functions | |
void | operator() (const Frame &frame) |
generate gain map from frame More... | |
void | loadSettings (CASSSettings &s) |
load the settings of this creator More... | |
void | controlCalibration (const std::string &unused) |
start the gain calibration More... | |
![]() | |
virtual | ~MapCreatorBase () |
virtual destructor More... | |
Private Types | |
typedef std::pair< int, double > | statistics_t |
define a conatiner for a statistics of a pixel More... | |
Private Member Functions | |
void | doNothing (const Frame &) |
a function that just returns and does nothing More... | |
void | generateCalibration (const Frame &frame) |
generate gain calibration data More... | |
Private Attributes | |
std::tr1::shared_ptr< CommonData > | _commondata |
the container with all the maps More... | |
std::tr1::function< void(const Frame &)> | _createMap |
the function object that will be called by the operator More... | |
Detector::frame_t::value_type | _constGain |
the value that will be set when not enough statistics is present More... | |
std::vector< statistics_t > | _statistics |
container for the statistics for each pixel More... | |
std::pair< Detector::frame_t::value_type, Detector::frame_t::value_type > | _range |
range of ADU values that are of interest More... | |
statistics_t::first_type | _minMedianCounts |
the minimum nbr of photons that the median needs before the gain will calculated More... | |
statistics_t::first_type | _minPhotonCount |
minimum nbr of photon seen by a pixel before the average will used More... | |
bool | _writeFile |
flag whether to write the gain calibration to file More... | |
commonmode::CalculatorBase::shared_pointer | _commonModeCalculator |
functor for calculating the common mode level More... | |
int64_t | _counter |
counter to see how many frames have been processed More... | |
int64_t | _nFrames |
how many frames should be processed More... | |
Additional Inherited Members | |
![]() | |
typedef std::tr1::shared_ptr< MapCreatorBase > | shared_pointer |
typedef the shared pointer of this More... | |
typedef std::vector< Detector::frame_t > | storage_t |
the type of storage used More... | |
![]() | |
static shared_pointer | instance (const std::string &type) |
create an instance of the requested functor More... | |
Creates a gain calibration.
Generates the gain map.
PixelDetectors/%name%/CorrectionMaps/GainFixedADURange/{StartInstantly}
Flag to tell whether the calculator should start instantly after loading the seetings. If false it will wait until told by the program through the available GUI's. Default is false.
PixelDetectors/%name%/CorrectionMaps/GainFixedADURange/{NbrFrames}
The number of frames that should be processed before the gain map is calculated. Default is -1, which means that the only criteria is that the MinimumMedianCounts have to be reached before calulating the gain map.
PixelDetectors/%name%/CorrectionMaps/GainFixedADURange/{MinimumPhotonCount}
How many times the adu value of the pixel was in the user defined ADURange, before the gain for this pixel will be calculated. Default is 50
PixelDetectors/%name%/CorrectionMaps/GainFixedADURange/{MinimumMedianCounts}
The gain values are only calculates when median counts per pixel exeed this value. Default is 50.
PixelDetectors/%name%/CorrectionMaps/GainFixedADURange/{MinADURange|MaxADURange}
The range in ADU in which the pixelvalue has to lie before it is taken into the statistics. Default is 0|1000.
PixelDetectors/%name%/CorrectionMaps/GainFixedADURange/{SaveCalibration}
If true writes the gain calibration to file. For further information on how the files are written, see cass::pixeldetector::CommonData. Default is true.
PixelDetectors/%name%/CorrectionMaps/GainFixedADURange/{CommonModeCalculationType}
defines what kind of common mode correction should be done with the frames. There are settings that are used fo all calculation types. see cass::pixeldetector::commonmode::CalculatorBase. Default type is "none". Possible values are:
Definition at line 77 of file gaincalibration.h.
|
private |
define a conatiner for a statistics of a pixel
Definition at line 125 of file gaincalibration.h.
|
virtual |
start the gain calibration
unused | unused parameter |
Reimplemented from cass::pixeldetector::MapCreatorBase.
Definition at line 134 of file gaincalibration.cpp.
References cass::Log::add(), generateCalibration(), and cass::Log::INFO.
|
inlineprivate |
a function that just returns and does nothing
unused | not used |
Definition at line 113 of file gaincalibration.h.
Referenced by generateCalibration(), and loadSettings().
|
private |
generate gain calibration data
frame | the frames that will be added to the calibration |
average the common mode and offset corrected pixelvalues per pixel that lie within the given adu range
check the median nbr of photons per pixel. Use this or the number of frames processed so far as criteria whether to generate the gain map.
calculate the average of the average pixelvalues, disregarding pixels that have not seen enough photons in the right ADU range.
assing 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
if requested write the gain map to file, reset the calibration
Definition at line 29 of file gaincalibration.cpp.
References cass::pixeldetector::Frame::data, doNothing(), and offset.
Referenced by controlCalibration(), and loadSettings().
|
virtual |
load the settings of this creator
See class description for a detailed list.
s | the CASSSettings object to read the information from |
Reimplemented from cass::pixeldetector::MapCreatorBase.
Definition at line 111 of file gaincalibration.cpp.
References QSettings::beginGroup(), doNothing(), QSettings::endGroup(), cass::pixeldetector::DetectorName::fromSettings(), generateCalibration(), cass::pixeldetector::commonmode::CalculatorBase::instance(), cass::pixeldetector::CommonData::instance(), and QSettings::value().
|
inlinevirtual |
generate gain map from frame
use the _createMap functor that either does nothing or generates the gain
frame | the frame containing the data to build the maps from |
Reimplemented from cass::pixeldetector::MapCreatorBase.
Definition at line 86 of file gaincalibration.h.
References _createMap.
|
private |
the container with all the maps
Definition at line 104 of file gaincalibration.h.
|
private |
functor for calculating the common mode level
Definition at line 143 of file gaincalibration.h.
|
private |
the value that will be set when not enough statistics is present
Definition at line 122 of file gaincalibration.h.
|
private |
counter to see how many frames have been processed
Definition at line 146 of file gaincalibration.h.
|
private |
the function object that will be called by the operator
Definition at line 107 of file gaincalibration.h.
Referenced by operator()().
|
private |
the minimum nbr of photons that the median needs before the gain will calculated
Definition at line 134 of file gaincalibration.h.
|
private |
minimum nbr of photon seen by a pixel before the average will used
Definition at line 137 of file gaincalibration.h.
|
private |
how many frames should be processed
Definition at line 149 of file gaincalibration.h.
|
private |
range of ADU values that are of interest
Definition at line 131 of file gaincalibration.h.
|
private |
container for the statistics for each pixel
Definition at line 128 of file gaincalibration.h.
|
private |
flag whether to write the gain calibration to file
Definition at line 140 of file gaincalibration.h.