Luiza  v03-01
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
luiza::ImageNormalizationProcessor Class Reference

Simple processor to apply dark subtraction and flat correction. More...

#include <ImageNormalizationProcessor.h>

Inheritance diagram for luiza::ImageNormalizationProcessor:
luiza::Processor

Public Member Functions

virtual ProcessornewProcessor ()
 Return a new instance of the processor. More...
 
virtual void init ()
 
virtual void processData (GloriaDataContainer *data)
 
virtual void check (GloriaDataContainer *data)
 Called for every loop - right after processData() call. More...
 
virtual void end ()
 
- Public Member Functions inherited from luiza::Processor
 Processor (const std::string &typeName)
 Default constructor. More...
 
virtual ~Processor ()
 Destructor.
 
virtual void startAnalysis (GloriaDataContainer *)
 Called before first data processing loop. More...
 
virtual void concludeAnalysis (GloriaDataContainer *)
 Called after all data processing loops. More...
 
virtual const std::string & type () const
 Return type name for the processor (as set in constructor).
 
virtual const std::string & name () const
 Return name of this processor.
 
virtual const std::string & logLevelName () const
 Return name of the local verbosity level of this processor - "" if not set.
 
virtual StringParameters * parameters ()
 Return parameters defined for this Processor.
 
virtual void printDescription ()
 Print information about this processor in ASCII steering file format.
 
virtual void printDescriptionXML (std::ostream &stream=std::cout)
 Print information about this processor in XML steering file format.
 
template<class T >
void printParameters ()
 Print the parameters and their values depending on the given verbosity level.
 
void printParameters ()
 Print the parameters and their values with verbosity level MESSAGE.
 
const std::string & description ()
 Description of processor.
 
bool isFirstEvent ()
 True if first event in processEvent(evt) - use this e.g. to initialize histograms etc.
 
GloriaCollectionType getGloriaInType (const std::string &colName)
 Return the input type for the collection colName. More...
 
GloriaCollectionType getGloriaOutType (const std::string &colName)
 Return the output type for the collection colName. More...
 
bool isInputCollectionName (const std::string &parameterName)
 Check if parameter defines collection. More...
 
bool isOutputCollectionName (const std::string &parameterName)
 True if the given parameter defines an LCIO output collection */.
 

Protected Member Functions

void printEndMessage () const
 
- Protected Member Functions inherited from luiza::Processor
void setReturnValue (bool val)
 Set the return value for this processor - typically at end of processEvent(). More...
 
void setReturnValue (const std::string &name, bool val)
 Set a named return value for this processor - typically at end of processEvent() More...
 
template<class T >
void registerProcessorParameter (const std::string &name, const std::string &description, T &parameter, const T &defaultVal, int setSize=0)
 Register a steering variable for this processor - call in constructor of processor. More...
 
void registerInputCollection (const GloriaCollectionType &type, const std::string &name, const std::string &description, std::string &parameter, const std::string &defaultVal, int setSize=0)
 Register parameter describing input collection. More...
 
void registerOutputCollection (const GloriaCollectionType &type, const std::string &name, const std::string &description, std::string &parameter, const std::string &defaultVal, int setSize=0)
 Register parameter describing output collection. More...
 
void registerInputCollections (const GloriaCollectionType &type, const std::string &name, const std::string &description, StringVec &parameter, const StringVec &defaultVal, int setSize=0)
 Register parameter describing input collections. More...
 
template<class T >
void registerOptionalParameter (const std::string &name, const std::string &description, T &parameter, const T &defaultVal, int setSize=0)
 Same as registerProcessorParameter except that the parameter is optional. More...
 
bool parameterSet (const std::string &name)
 Tests whether the parameter has been set in the steering file.
 
template<class T >
void message (const std::string &message) const
 Print message according to verbosity level. More...
 
template<class T >
void message (const std::basic_ostream< char, std::char_traits< char > > &m) const
 Similar to message(const std::string& message) More...
 
std::stringstream & log () const
 Returns an empty stringstream that is used by the message method.
 
virtual void setProcessorParameters (StringParameters *parameters)
 Allow friend class CCProcessor to change/reset processor parameters.
 
virtual void updateParameters ()
 Allow friend class CCProcessor to update processor parameters.
 
virtual void updateTelescopeParameters (std::string name)
 Allow to update processor parameters for given telescope name. More...
 
virtual void updateTelescopeParameters (GloriaFitsHeader *header)
 Update processor parameters based on FITS header. More...
 

Protected Attributes

string _inputCollectionName
 Name of the image collection containing images to be corrected.
 
string _darkCollectionName
 Name of the image collection containing dark images.
 
string _flatCollectionName
 Name of the image collection containing flat images.
 
string _biasCollectionName
 Name of the image collection containing bias images.
 
string _outputCollectionName
 Name of the output image collection.
 
bool _permanentCollection
 Flag the output collection to be permanent.
 
bool _AutoNormalization
 Flag for automatic calculation of correction factors.
 
bool _FlatNormalization
 Flag for subtracting dark/bias from flat frame.
 
double _imageScale
 Factor used to scale input image.
 
double _darkScale
 Factor used to scale dark image.
 
double _flatScale
 Factor used to scale flat frame.
 
double _biasScale
 Factor used to scale bias image.
 
std::vector< std::string > _matchKeywords
 Keywords which should match for selected dark/bias/flat frame.
 
std::vector< std::string > _matchValues
 Values of keywords being matched for considered image.
 
bool _matchExpTime
 Flag for using dark frame selection based on exposure time.
 
- Protected Attributes inherited from luiza::Processor
std::string _description
 Describes what the processor does. Set in constructor.
 

Detailed Description

Simple processor to apply dark subtraction and flat correction.

Processor to normalize raw images ie. subtract dark and bias images, and divide by flat frame. For each pixel the formula is:

\[ I_{out} = i \cdot \frac{ I_{in} - d \cdot D - b \cdot B }{f \cdot F} \]

where $I, D, B, F $ are the pixel values in image, dark, bias and flat frames, and $i, d, b, f $ are the corresponding scale factors.

Input
Processor takes images from Gloria data collection. If sizes of collections agree, subsequent darks, flats or biases are used for each image. Otherwise first dark, flat and/or bias is used.
Parameters
InputCollectionName- Name of the collection containing images to be corrected
DarkCollectionName- Name of the collection containing darks - frames which should be subtracted from data images.
FlatCollectionName- Name of the collection containing flats - data images are divided by this image.
BiasCollectionName- Name of the collection containing bias images - used to correct for readout noise.
Output
Corrected frames can be stored in the output collection, if specified
Parameters
OutputCollectionName- Name of the collection where corrected images will be stored. If name is omitted, images in the input collection will be modified.
PermanentCollection- Flag output collection, as permanent, not deleted after loop is finished (default is false)
Options
Allow for more automatic correction calculation
Parameters
AutoNormalization- if true: use exposure time information (as extracted from fits header) to calculated correction factors (for darks and biases)
FlatNormalization- apply dark/bias subtraction procedure to the flat frame as well (before applying flat to the actual image). If set to true, the flat frame is also normalized to the average value of 1).
MatchKeywords- Names for header keywords which should match for selected dark/bias/flat frames. If no frame with matching keywords is found, first frame in corresponding collection is used.
MatchExpTime- Flag for using exposure time information (EXPTIME keyword) to find the best dark frame for the considered image.
Correction parameters
Optional parameters allow to scale considered images (used only if AutoNormalization flag is set to false)
Parameters
ImageScale- Factor used to scale input image pixels (default = 1.)
DarkScale- Factor used to scale dark image (default = 1.)
BiasScale- Factor used to scale bias image (default = 0.)
FlatScale- Factor used to scale flat frame (default = 1.)

Member Function Documentation

void luiza::ImageNormalizationProcessor::check ( GloriaDataContainer )
virtual

Called for every loop - right after processData() call.

Can be used to check processing and/or produce check plots.

Reimplemented from luiza::Processor.

void luiza::ImageNormalizationProcessor::end ( )
virtual

Called after data processing for clean up.

Reimplemented from luiza::Processor.

References printEndMessage().

void luiza::ImageNormalizationProcessor::init ( )
virtual

Called at the begin of the job before anything is read. Use to initialize the processor, e.g. book histograms.

Reimplemented from luiza::Processor.

References _inputCollectionName, _matchKeywords, _matchValues, _outputCollectionName, luiza::Processor::name(), and luiza::Processor::parameters().

virtual Processor* luiza::ImageNormalizationProcessor::newProcessor ( )
inlinevirtual

Return a new instance of the processor.

Has to be implemented by subclasses.

Implements luiza::Processor.

void luiza::ImageNormalizationProcessor::printEndMessage ( ) const
protected

Test method for const.

Referenced by end().

void luiza::ImageNormalizationProcessor::processData ( GloriaDataContainer data)
virtual

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