Luiza
v03-01
|
Class for calculating map of median values for any variable on the image. More...
#include <GloriaMedianMap.h>
Public Member Functions | |
GloriaMedianMap () | |
Dummy constructor - does nothing (!) | |
GloriaMedianMap (int Nbx, int Nby, int Nvar=1) | |
Constructor for median map. More... | |
GloriaMedianMap (const GloriaFitsImage *fitsImage, int Nbx, int Nby, int Nvar=1) | |
Constructor for median map corresponding to given image file. More... | |
GloriaMedianMap (GloriaFitsTable *mapTable) | |
Constructor. Allocates map by importing it from fits table. More... | |
void | AddMedian () |
Add another variable to median map set. More... | |
void | AddMedian (string name) |
Add another variable to median map set and give it a name. More... | |
void | SetMedianName (int ivar, string name) |
Set name to the considered variable. | |
string | GetMedianName (int ivar) |
Return image filled with parameter values. | |
long | CalculateMap (int iVar, int nVal, double *Xpos, double *Ypos, double *Val) |
Calculate median and spread maps for given variable. More... | |
long | CalculateMap (int iVar, vector< double > *Xpos, vector< double > *Ypos, vector< double > *Val) |
Calculate median and spread maps for given variable. More... | |
void | CalculateBgMap (const GloriaFitsImage *fitsImage, int Nbx, int Nby, int sampling=1) |
Calculate background and noise map for given image. More... | |
void | CalculateBgMap (const GloriaFitsImage *fitsImage, int sampling=1) |
Calculate map for given image (without changing map binning) | |
double | GetMedian (int ivar, int ix, int iy, int ipol=1) |
Get expected median for pixel (ix,iy) using calculated map. More... | |
double | GetMedian (int ivar, double x, double y, int ipol=1) |
Get expected median level at position (x,y) using calculated map. | |
double | GetMedian (int ivar, long ipix, int ipol=1) |
Get expected median 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 | GetBgLevel (int ix, int iy, int ipol=1) |
Get background level for pixel (ix,iy) using calculated map. More... | |
double | GetBgLevel (double x, double y, int ipol=1) |
Get background level at position (x,y) using calculated map. | |
double | GetBgLevel (long ipix, int ipol=1) |
Get background level for pixel ipix using calculated map. | |
double | GetNoise (int ix, int iy, int ipol=1) |
Get noise level for pixel (ix,iy) using calculated map. | |
double | GetNoise (double x, double y, int ipol=1) |
Get noise level at position (x,y) using calculated map. | |
double | GetNoise (long ipix, int ipol=1) |
Get noise level for pixel ipix using calculated map. | |
double * | GetGloriaMedianMap (int ivar=0) |
Returns pointer to the median map array. | |
double * | GetSpreadMap (int ivar=0) |
Returns pointer to the spread map array. | |
double * | GetBgMap () |
Returns pointer to the background map array. | |
double * | GetNoiseMap () |
Returns pointer to the noise map array. | |
double | GetMedianMean (int ivar=0) |
Returns mean of median map. | |
double | GetSpreadMean (int ivar=0) |
Returns mean of spread map. | |
double | GetBgMean () |
Returns mean of background map. | |
double | GetNoiseMean () |
Returns mean of noise map. | |
GloriaFitsImage * | GetMedianImage (int ivar=0, int ipol=1) |
Return image filled with median values. | |
GloriaFitsImage * | GetSpreadImage (int ivar=0, int ipol=1) |
Return image filled with spread values. | |
GloriaFitsImage * | GetBgImage (int ipol=1) |
Return image filled with background values. | |
GloriaFitsImage * | GetNoiseImage (int ipol=1) |
Return image filled with noise 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. | |
GloriaFitsImage * | GetMapImage (int imap, int ipol=1) |
Return image filled with parameter values. | |
GloriaFitsTable * | GetTable () |
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) |
Class for calculating map of median values for any variable on the image.
This class can be use to calculate median value map over the image. For each considered variable/parameter two maps are allocated: one for storing median of the parameter value and the second one for storing the estimated parameter spread. Image area is divided into Nbx x Nby sectors, median and spread is calculated for each sector separately. Spread is calculated from the ordered value array, as half of the distance between 17% and 83% of entries. Single GloriaMedianMap instance can store median+spread map pairs for arbitrary number of variables (default is one variable). However, all maps need to have same binning.
gloria::GloriaMedianMap::GloriaMedianMap | ( | int | Nbx, |
int | Nby, | ||
int | Nvar = 1 |
||
) |
Constructor for median map.
Two tables are allocated, for storing median 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::GloriaMedianMap::GloriaMedianMap | ( | const GloriaFitsImage * | fitsImage, |
int | Nbx, | ||
int | Nby, | ||
int | Nvar = 1 |
||
) |
Constructor for median map corresponding to given image file.
Two tables are allocated, for storing median and value spread estimate, for any parameter corresponding to the image given. Tables should be then filled with a call to CalculateMap
|
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.
void gloria::GloriaMedianMap::AddMedian | ( | ) |
Add another variable to median map set.
Can be used to add maps (one for median, one for spread) for another parameter to the existing set of maps. Existing maps are not affected.
void gloria::GloriaMedianMap::AddMedian | ( | string | name | ) |
Add another variable to median map set and give it a name.
Can be used to add maps (one for median, one for spread) for another parameter to the existing set of maps. Existing maps are not affected.
void gloria::GloriaMedianMap::CalculateBgMap | ( | const GloriaFitsImage * | fitsImage, |
int | Nbx, | ||
int | Nby, | ||
int | sampling = 1 |
||
) |
Calculate background and noise map for given image.
This method allocates map tables with Nbx x Nby bins and calculates background and noise levels in each bin. If number of bins is small (number of pixels in each bin very large) sampling factor can be used to speed the calculation up. Sampling N > 1 means than not all pixels are taken for calculation but only every N-th pixel. For each bin median of the pixel value distribution and noise as half of the distance between 17% and 83% of stars.
Referenced by luiza::PiHalvesEqualizer::processData(), luiza::BackgroundImage::processData(), luiza::CalculateGausPSF::processData(), luiza::FastAperturePhotometry::processData(), luiza::ApplyGausKernel::processData(), luiza::PixelClusterFinder::processData(), and luiza::WeightedAperturePhotometry::processData().
long gloria::GloriaMedianMap::CalculateMap | ( | int | iVar, |
int | nVal, | ||
double * | Xpos, | ||
double * | Ypos, | ||
double * | Val | ||
) |
Calculate median and spread maps for given variable.
This method can be used for calculating median 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 GloriaMedianMap 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::CalculateGausPSF::processData(), and luiza::CalibrateFrameObjects::processData().
long gloria::GloriaMedianMap::CalculateMap | ( | int | iVar, |
vector< double > * | Xpos, | ||
vector< double > * | Ypos, | ||
vector< double > * | Val | ||
) |
Calculate median and spread maps for given variable.
This method can be used for calculating median 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 GloriaMedianMap 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.
|
inline |
Get background level for pixel (ix,iy) using calculated map.
Calculates background level in given pixel on the input frame by interpolating between map points. ipol parameter 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::FastAperturePhotometry::processData(), and luiza::WeightedAperturePhotometry::processData().
|
inline |
Get expected median for pixel (ix,iy) using calculated map.
Calculates expected median 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().