Luiza  v03-01
Public Member Functions | List of all members
gloria::GloriaAverageMap Class Reference

Class for calculating map of average values for any variable on the image. More...

#include <GloriaAverageMap.h>

Inheritance diagram for gloria::GloriaAverageMap:
gloria::GloriaValueMap

Public Member Functions

 GloriaAverageMap ()
 Dummy constructor - does nothing (!)
 
 GloriaAverageMap (int Nbx, int Nby, int Nvar=1)
 Constructor for average value map. More...
 
 GloriaAverageMap (const GloriaFitsImage *fitsImage, int Nbx, int Nby, int Nvar=1)
 Constructor for average value map corresponding to given image file. More...
 
 GloriaAverageMap (GloriaFitsTable *mapTable)
 Constructor. Allocates map by importing it from fits table. More...
 
void AddAverage ()
 Add another variable to average value map set. More...
 
void AddAverage (string name)
 Add another variable to average value map set and give it a name. More...
 
void SetAverageName (int ivar, string name)
 Set name to the considered variable.
 
string GetAverageName (int ivar)
 Return image filled with parameter values.
 
long CalculateMap (int iVar, int nVal, double *Xpos, double *Ypos, double *Val)
 Calculate average value and spread maps for given variable. More...
 
long CalculateMap (int iVar, vector< double > *Xpos, vector< double > *Ypos, vector< double > *Val)
 Calculate average value and spread maps for given variable. More...
 
long CalculateFitMap (int iVar, int nVal, double *Xpos, double *Ypos, double *Val, int Npol)
 Calculate average value and spread maps using polynomial fit. More...
 
long CalculateFitMap (int iVar, vector< double > *Xpos, vector< double > *Ypos, vector< double > *Val, int Npol)
 Calculate average value and spread maps using polynomial fit. More...
 
double GetAverage (int ivar, int ix, int iy, int ipol=1)
 Get expected average value for pixel (ix,iy) using calculated map. More...
 
double GetAverage (int ivar, double x, double y, int ipol=1)
 Get expected average value level at position (x,y) using calculated map.
 
double GetAverage (int ivar, long ipix, int ipol=1)
 Get expected average value level for pixel ipix using calculated map.
 
double GetSpread (int ivar, int ix, int iy, int ipol=1)
 Get spread of the variable for pixel (ix,iy) using calculated map.
 
double GetSpread (int ivar, double x, double y, int ipol=1)
 Get spread of variable at position (x,y) using calculated map.
 
double GetSpread (int ivar, long ipix, int ipol=1)
 Get spread for pixel ipix using calculated map.
 
double * GetGloriaAverageMap (int ivar=0)
 Returns pointer to the average value map array.
 
double * GetSpreadMap (int ivar=0)
 Returns pointer to the spread map array.
 
double GetAverageMean (int ivar=0)
 Returns mean of background map.
 
double GetSpreadMean (int ivar=0)
 Returns mean of noise map.
 
GloriaFitsImageGetAverageImage (int ivar=0, int ipol=1)
 Return image filled with average value estimates.
 
GloriaFitsImageGetSpreadImage (int ivar=0, int ipol=1)
 Return image filled with spread values.
 
void InitializeMaps (int Nbx, int Nby, int Nvar)
 Allocate new map sets with given binning. All data and image size information are lost.
 
- Public Member Functions inherited from gloria::GloriaValueMap
 GloriaValueMap ()
 Dummy constructor - does nothing (!)
 
 GloriaValueMap (int Nbx, int Nby, int Nmap=1)
 Constructor. Allocates map tables for given map size. More...
 
 GloriaValueMap (const GloriaFitsImage *fitsImage, int Nbx, int Nby, int Nmap=1)
 Constructor. Allocates map tables for given image and map size. More...
 
 GloriaValueMap (GloriaFitsTable *mapTable)
 Constructor. Allocates map by importing it from fits table. More...
 
virtual ~GloriaValueMap ()
 Destructor.
 
void SetImageSize (const GloriaFitsImage *fitsImage)
 Set size of image.
 
void SetImageSize (int SizeX, int SizeY)
 Set size of image.
 
void AddMap ()
 Add another map to current map set. More...
 
void AddMap (string name)
 Add another map to current map set, giving it a name. More...
 
void SetMapName (int imap, string name)
 Set name for existing map.
 
double GetMapValue (int imap, int ix, int iy, int ipol=1)
 Get value from map imap for pixel (ix,iy) More...
 
double GetMapValue (int imap, long ipix, int ipol=1)
 Get value from map imap for pixel ipix.
 
double GetMapValue (int imap, double x, double y, int ipol=1)
 Get map value for arbitrary position on the image.
 
int Nmap ()
 Get number of maps.
 
int NMapX ()
 Get map binning in X.
 
int NMapY ()
 Get map binning in Y.
 
int ImgSizeX ()
 Get image pixels in X.
 
int ImgSizeY ()
 Get image pixels in Y.
 
double * GetMap (int imap)
 Returns pointer to the map array.
 
string GetMapName (int imap)
 Return image filled with parameter values.
 
double GetMapMean (int imap)
 Returns mean value of map entries.
 
GloriaFitsImageGetMapImage (int imap, int ipol=1)
 Return image filled with parameter values.
 
GloriaFitsTableGetTable ()
 Return table containing all defined maps as columns.
 
bool LoadFromTable (GloriaFitsTable *mapTable)
 Initialize value map structures from the table.
 
void ClearMaps ()
 Clear all defined maps. Clears also map binning and image size information.
 
void InitializeMaps (int Nbx, int Nby, int Nmap)
 Allocate new, empty maps with given binning. All data and image size information are lost.
 

Additional Inherited Members

- Protected Member Functions inherited from gloria::GloriaValueMap
void FillMapImage1 (double *map, GloriaFitsImage *mapImage)
 

Detailed Description

Class for calculating map of average values for any variable on the image.

This class can be use to calculate average value map over the image. For each considered variable/parameter two maps are allocated: one for storing arithmetic mean value of the parameter and the second one for storing dispersion (RMS) of the parameter values. Image area is divided into Nbx x Nby sectors, mean and spread are calculated for each sector separately. Single GloriaAverageMap instance can store mean+RMS map pairs for arbitrary number of variables (default is one variable). However, all maps need to have same binning.

The class is inheriting from GloriaValueMap class for value calculation and creating average value or RMS images. Using the calculated average value and spread maps, user can calculate expected values for any pixel in the image frame using different interpolation methods implemented for GloriaValueMap.
Author
A.F.Zarnecki, University of Warsaw, zarne.nosp@m.cki@.nosp@m.fuw.e.nosp@m.du.p.nosp@m.l

Constructor & Destructor Documentation

gloria::GloriaAverageMap::GloriaAverageMap ( int  Nbx,
int  Nby,
int  Nvar = 1 
)

Constructor for average value map.

Two tables are allocated, for storing average value and value spread estimate, for any parameter corresponding to the image given. Tables should be then filled with a call to CalculateMap Note that image size is not defined at this moment yet!

gloria::GloriaAverageMap::GloriaAverageMap ( const GloriaFitsImage fitsImage,
int  Nbx,
int  Nby,
int  Nvar = 1 
)

Constructor for average value map corresponding to given image file.

Two tables are allocated, for storing average value and value spread estimate, for any parameter corresponding to the image given. Tables should be then filled with a call to CalculateMap

gloria::GloriaAverageMap::GloriaAverageMap ( GloriaFitsTable mapTable)
inline

Constructor. Allocates map by importing it from fits table.

Creates maps by reading them from fits table. The table has to created with GetTable() method previously, so all required parameters are stored in header keywords. Otherwise one should declare map first and read table contents with LoadFromTable.

Member Function Documentation

void gloria::GloriaAverageMap::AddAverage ( )

Add another variable to average value map set.

Can be used to add maps (one for average value, one for spread) for another parameter to the existing set of maps. Existing maps are not affected.

void gloria::GloriaAverageMap::AddAverage ( string  name)

Add another variable to average value map set and give it a name.

Can be used to add maps (one for average value, one for spread) for another parameter to the existing set of maps. Existing maps are not affected.

long gloria::GloriaAverageMap::CalculateFitMap ( int  iVar,
int  nVal,
double *  Xpos,
double *  Ypos,
double *  Val,
int  Npol 
)

Calculate average value and spread maps using polynomial fit.

This method can be used for calculating more accurate average and spread maps based on the table of parameter value measurements (Val array) at different positions on the frame (specified by Xpos and Ypos arrays). Instead of calculating simple parameter average and RMS values in each map bin, polinomial dependence on the CCD position is fitted to reproduce better the parameter variation. Estimated value in the bin center is stored in the map as well as the average squared distance of the value from the fitted surface. The fitted average value is usually quite close to the arithmetic average, but the spread estimate can differ significantly and is more reliable. Npol parameter is the polynomial order used.

Referenced by luiza::CalibrateFrameObjects::processData().

long gloria::GloriaAverageMap::CalculateFitMap ( int  iVar,
vector< double > *  Xpos,
vector< double > *  Ypos,
vector< double > *  Val,
int  Npol 
)

Calculate average value and spread maps using polynomial fit.

This method can be used for calculating more accurate average and spread maps based on the vector of parameter value measurements (Val vector) at different positions on the frame (specified by Xpos and Ypos vectors). Instead of calculating simple parameter average and RMS values in each map bin, polinomial dependence on the CCD position is fitted to reproduce better the parameter variation. Estimated value in the bin center is stored in the map as well as the average squared distance of the value from the fitted surface. The fitted average value is usually quite close to the arithmetic average, but the spread estimate can differ significantly and is more reliable. Npol parameter is the polynomial order used.

long gloria::GloriaAverageMap::CalculateMap ( int  iVar,
int  nVal,
double *  Xpos,
double *  Ypos,
double *  Val 
)

Calculate average value and spread maps for given variable.

This method can be used for calculating average value and spread maps based on the table of parameter value measurements (Val array) at different positions on the frame (specified by Xpos and Ypos arrays). All arrays contain nVal entries. iVar specifies the variable number (more than one variable can be considered in one GloriaAverageMap instance). Return value corresponds to minimal number of entries found in single map bin. Negative number is returned on error. If zero value is returned one or more map bins is not set.

Referenced by luiza::CalibrateFrameObjects::processData().

long gloria::GloriaAverageMap::CalculateMap ( int  iVar,
vector< double > *  Xpos,
vector< double > *  Ypos,
vector< double > *  Val 
)

Calculate average value and spread maps for given variable.

This method can be used for calculating average value and spread maps based on the vector of parameter value measurements (Val vector) at different positions on the frame (specified by Xpos and Ypos vectors). All vectors should contain same number of entries. iVar specifies the variable number (more than one variable can be considered in one GloriaAverageMap instance). Return value corresponds to minimal number of entries found in single map bin. Negative number is returned on error. If zero value is returned one or more map bins is not set.

double gloria::GloriaAverageMap::GetAverage ( int  ivar,
int  ix,
int  iy,
int  ipol = 1 
)
inline

Get expected average value for pixel (ix,iy) using calculated map.

Calculates expected average value value in given pixel on the input frame by interpolating between map points. ivar parameter selects the variable (more than one map can be defined) and ipol defines interpolation order. Currently implemented values are: 0 - no interpolation (take value from the bin center) and 1 - linear interpolation between bin centers (default). 2 - second order approximation (simplified).

References gloria::GloriaValueMap::GetMapValue().

Referenced by luiza::CalibrateFrameObjects::processData().


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