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

Creates maps from the last number of maps. More...

#include <mapcreators.h>

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

Public Member Functions

void operator() (const Frame &frame)
 build map from frame More...
 
void loadSettings (CASSSettings &s)
 load the settings of this creator More...
 
void controlCalibration (const std::string &unused)
 start the training More...
 
- Public Member Functions inherited from cass::pixeldetector::MapCreatorBase
virtual ~MapCreatorBase ()
 virtual destructor More...
 

Private Member Functions

void train (const Frame &frame)
 train the maps More...
 
void updateMaps (const Frame &frame)
 update the existing map with the incomming frame inforamtion 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...
 
storage_t _storage
 the storage with all the frames from which the maps are calculated More...
 
size_t _framecounter
 counter to keep track how many frames are collected More...
 
size_t _frameSave
 after wich number of frames should the maps be written to file More...
 
size_t _trainingsize
 how much frames should the training include More...
 
float _alpha
 how many frames should the memory go back More...
 
float _multiplier
 how much noise is allowed before disregarding pixel from list 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 maps from the last number of maps.

The algorithm that calculates the running average (offset) and standard deviation is taken from here (last checked 30.01.2012): http://www-uxsup.csx.cam.ac.uk/~fanf2/hermes/doc/antiforgery/stats.pdf

User definable Map Creator List:
"moving": The maps will be created from the last few frames.
User definable Parameters:

PixelDetectors/%name%/CorrectionMaps/ChangingCreator/{NbrTrainingFrames}
The number of frames that should be collected for calculating the initial maps. Default is 50.

PixelDetectors/%name%/CorrectionMaps/ChangingCreator/{DoTraining}
Before updating collect a set of "training" frames from which the initial maps are created. This is recommended if one does not have or has an outdated noise and offset map. Default is false.

PixelDetectors/%name%/CorrectionMaps/ChangingCreator/{NbrOfAverages}
The number of past frames that should be taken into account when calculating the noise and offset map. Default is 50.

PixelDetectors/%name%/CorrectionMaps/ChangingCreator/{Multiplier}
How much bigger does the pixel value have to be than the noise before The pixel is not taken into account when calculating the offset and noise of that pixel. Default is 4.

PixelDetectors/%name%/CorrectionMaps/ChangingCreator/{AutoSaveSize}
Tells to save the noise and offset map and recalculate the correction map after this many frames. Default is 1e6.

Author
Lutz Foucar

Definition at line 149 of file mapcreators.h.

Member Function Documentation

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

start the training

Parameters
unused(not used)

Reimplemented from cass::pixeldetector::MapCreatorBase.

Definition at line 189 of file mapcreators.cpp.

References cass::Log::add(), cass::Log::INFO, cass::toString(), and train().

void MovingMaps::loadSettings ( CASSSettings s)
virtual
void cass::pixeldetector::MovingMaps::operator() ( const Frame frame)
inlinevirtual

build map from frame

The map resources are locked since the function calling this operator will lock the resources.

take the input frame and use its data to build up the correction maps.

Parameters
framethe frame containing the data to build the maps from

Reimplemented from cass::pixeldetector::MapCreatorBase.

Definition at line 161 of file mapcreators.h.

References _createMap.

void MovingMaps::train ( const Frame frame)
private

train the maps

collect user settable amount of frames and create intial maps from it these maps will then be updated with each new frame

Parameters
framethe frame to build up the storage and to calc the maps from

Definition at line 197 of file mapcreators.cpp.

References cass::Log::add(), cass::pixeldetector::Frame::data, cass::Log::INFO, noise, offset, cass::toString(), and updateMaps().

Referenced by controlCalibration(), and loadSettings().

void MovingMaps::updateMaps ( const Frame frame)
private

update the existing map with the incomming frame inforamtion

will update the maps with the information of the frame

Parameters
framethe frame to update the maps from

Definition at line 255 of file mapcreators.cpp.

References cass::pixeldetector::Frame::data, noise, offset, and cass::square().

Referenced by loadSettings(), and train().

Member Data Documentation

float cass::pixeldetector::MovingMaps::_alpha
private

how many frames should the memory go back

Definition at line 213 of file mapcreators.h.

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

the container with all the maps

Definition at line 195 of file mapcreators.h.

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

the function object that will be called by the operator

Definition at line 198 of file mapcreators.h.

Referenced by operator()().

size_t cass::pixeldetector::MovingMaps::_framecounter
private

counter to keep track how many frames are collected

Definition at line 204 of file mapcreators.h.

size_t cass::pixeldetector::MovingMaps::_frameSave
private

after wich number of frames should the maps be written to file

Definition at line 207 of file mapcreators.h.

float cass::pixeldetector::MovingMaps::_multiplier
private

how much noise is allowed before disregarding pixel from list

Definition at line 216 of file mapcreators.h.

storage_t cass::pixeldetector::MovingMaps::_storage
private

the storage with all the frames from which the maps are calculated

Definition at line 201 of file mapcreators.h.

size_t cass::pixeldetector::MovingMaps::_trainingsize
private

how much frames should the training include

Definition at line 210 of file mapcreators.h.


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