CFEL - ASG Software Suite  2.5.0
CASS
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
cass::pixeldetector::GainCalibration Class Reference

Creates a gain calibration. More...

#include <gaincalibration.h>

+ Inheritance diagram for cass::pixeldetector::GainCalibration:
+ Collaboration diagram for cass::pixeldetector::GainCalibration:

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...
 
- Public Member Functions inherited from cass::pixeldetector::MapCreatorBase
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

- Public Types inherited from cass::pixeldetector::MapCreatorBase
typedef std::tr1::shared_ptr< MapCreatorBaseshared_pointer
 typedef the shared pointer of this More...
 
typedef std::vector< Detector::frame_tstorage_t
 the type of storage used More...
 
- Static Public Member Functions inherited from cass::pixeldetector::MapCreatorBase
static shared_pointer instance (const std::string &type)
 create an instance of the requested functor More...
 

Detailed Description

Creates a gain calibration.

Generates the gain map.

User definable Gain-map Creator List:
"GainFixedADURange": gain value from the average pixelvalue within a given ADU range
User definable Parameters:

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:

Author
Lutz Foucar

Definition at line 77 of file gaincalibration.h.

Member Typedef Documentation

typedef std::pair<int,double> cass::pixeldetector::GainCalibration::statistics_t
private

define a conatiner for a statistics of a pixel

Definition at line 125 of file gaincalibration.h.

Member Function Documentation

void GainCalibration::controlCalibration ( const std::string &  unused)
virtual

start the gain calibration

Parameters
unusedunused parameter

Reimplemented from cass::pixeldetector::MapCreatorBase.

Definition at line 134 of file gaincalibration.cpp.

References cass::Log::add(), generateCalibration(), and cass::Log::INFO.

void cass::pixeldetector::GainCalibration::doNothing ( const Frame )
inlineprivate

a function that just returns and does nothing

Parameters
unusednot used

Definition at line 113 of file gaincalibration.h.

Referenced by generateCalibration(), and loadSettings().

void GainCalibration::generateCalibration ( const Frame frame)
private

generate gain calibration data

Parameters
framethe 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 $ gain = frac{average_average_pixelvalue}{average_pixelvalue} $ 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().

void GainCalibration::loadSettings ( CASSSettings s)
virtual

load the settings of this creator

See class description for a detailed list.

Parameters
sthe 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().

void cass::pixeldetector::GainCalibration::operator() ( const Frame frame)
inlinevirtual

generate gain map from frame

use the _createMap functor that either does nothing or generates the gain

Parameters
framethe frame containing the data to build the maps from

Reimplemented from cass::pixeldetector::MapCreatorBase.

Definition at line 86 of file gaincalibration.h.

References _createMap.

Member Data Documentation

std::tr1::shared_ptr<CommonData> cass::pixeldetector::GainCalibration::_commondata
private

the container with all the maps

Definition at line 104 of file gaincalibration.h.

commonmode::CalculatorBase::shared_pointer cass::pixeldetector::GainCalibration::_commonModeCalculator
private

functor for calculating the common mode level

Definition at line 143 of file gaincalibration.h.

Detector::frame_t::value_type cass::pixeldetector::GainCalibration::_constGain
private

the value that will be set when not enough statistics is present

Definition at line 122 of file gaincalibration.h.

int64_t cass::pixeldetector::GainCalibration::_counter
private

counter to see how many frames have been processed

Definition at line 146 of file gaincalibration.h.

std::tr1::function<void(const Frame&)> cass::pixeldetector::GainCalibration::_createMap
private

the function object that will be called by the operator

Definition at line 107 of file gaincalibration.h.

Referenced by operator()().

statistics_t::first_type cass::pixeldetector::GainCalibration::_minMedianCounts
private

the minimum nbr of photons that the median needs before the gain will calculated

Definition at line 134 of file gaincalibration.h.

statistics_t::first_type cass::pixeldetector::GainCalibration::_minPhotonCount
private

minimum nbr of photon seen by a pixel before the average will used

Definition at line 137 of file gaincalibration.h.

int64_t cass::pixeldetector::GainCalibration::_nFrames
private

how many frames should be processed

Definition at line 149 of file gaincalibration.h.

std::pair<Detector::frame_t::value_type,Detector::frame_t::value_type> cass::pixeldetector::GainCalibration::_range
private

range of ADU values that are of interest

Definition at line 131 of file gaincalibration.h.

std::vector<statistics_t> cass::pixeldetector::GainCalibration::_statistics
private

container for the statistics for each pixel

Definition at line 128 of file gaincalibration.h.

bool cass::pixeldetector::GainCalibration::_writeFile
private

flag whether to write the gain calibration to file

Definition at line 140 of file gaincalibration.h.


The documentation for this class was generated from the following files: