Luiza  v03-01
GloriaAverageMap.h
1 // -*- mode: c++; mode: auto-fill; mode: flyspell-prog; -*-
2 
3 
4 #ifndef GloriaAverageMap_h
5 #define GloriaAverageMap_h 1
6 
7 #include "GloriaValueMap.h"
8 #include "gloria/GloriaFitsImage.h"
9 
10 /*
11  * This source code is part of the LUIZA software package for GLORIA.
12  * You are free to use this source files for your own development as
13  * long as it stays in a public research context. You are not
14  * allowed to use it for commercial purpose. You must put this
15  * header with author names in all development based on this file.
16  *
17  */
18 
19 namespace gloria {
20 
22 
43 
44  public:
45 
48 
50 
55  GloriaAverageMap(int Nbx, int Nby, int Nvar = 1);
56 
57 
59 
63  GloriaAverageMap(const GloriaFitsImage* fitsImage, int Nbx, int Nby, int Nvar=1);
64 
66 
71  GloriaAverageMap(GloriaFitsTable* mapTable) : GloriaValueMap(mapTable) { };
72 
74 
78  void AddAverage();
79 
81 
85  void AddAverage(string name);
86 
87 
89  void SetAverageName(int ivar, string name);
90 
91 
93  inline string GetAverageName(int ivar) {return _valueNames.at(2*ivar); } ;
94 
95 
97 
107  long CalculateMap(int iVar, int nVal, double* Xpos, double* Ypos, double* Val);
108 
110 
120  long CalculateMap(int iVar, vector<double>* Xpos, vector<double>* Ypos, vector<double>* Val);
121 
122 
124 
137  long CalculateFitMap(int iVar, int nVal, double* Xpos, double* Ypos, double* Val, int Npol);
138 
140 
153  long CalculateFitMap(int iVar, vector<double>* Xpos, vector<double>* Ypos, vector<double>* Val, int Npol);
154 
156 
164  inline double GetAverage(int ivar, int ix, int iy, int ipol=1)
165  { return GetMapValue(2*ivar,ix,iy,ipol); } ;
166 
168  inline double GetAverage(int ivar, double x, double y, int ipol=1)
169  { return GetMapValue(2*ivar,x,y,ipol); } ;
170 
172  inline double GetAverage(int ivar, long ipix, int ipol=1)
173  { return GetMapValue(2*ivar,ipix,ipol); } ;
174 
176  inline double GetSpread(int ivar, int ix, int iy, int ipol=1)
177  { return GetMapValue(2*ivar+1,ix,iy,ipol); } ;
178 
180  inline double GetSpread(int ivar, double x, double y, int ipol=1)
181  { return GetMapValue(2*ivar+1,x,y,ipol); } ;
182 
184  inline double GetSpread(int ivar, long ipix, int ipol=1)
185  { return GetMapValue(2*ivar+1,ipix,ipol); } ;
186 
187 
188 
189 
191  inline double* GetGloriaAverageMap(int ivar=0) {return _valueMaps.at(2*ivar); };
192 
194  inline double* GetSpreadMap(int ivar=0) {return _valueMaps.at(2*ivar+1); };
195 
196 
198  inline double GetAverageMean(int ivar=0){ return GetMapMean(2*ivar);} ;
199 
201  inline double GetSpreadMean(int ivar=0){ return GetMapMean(2*ivar+1);} ;
202 
203 
205  inline GloriaFitsImage* GetAverageImage(int ivar=0, int ipol=1)
206  { return GetMapImage(2*ivar, ipol);} ;
207 
209  inline GloriaFitsImage* GetSpreadImage(int ivar=0, int ipol=1)
210  { return GetMapImage(2*ivar+1, ipol);} ;
211 
213  void InitializeMaps(int Nbx, int Nby, int Nvar);
214 
215  private:
216 
217  int GaussjSolve(double *alfa,double *beta,int n);
218 
219  } ;
220 
221 
222 }
223 
224 #endif
225 
226 
227 
string GetAverageName(int ivar)
Return image filled with parameter values.
Definition: GloriaAverageMap.h:93
GloriaFitsImage * GetAverageImage(int ivar=0, int ipol=1)
Return image filled with average value estimates.
Definition: GloriaAverageMap.h:205
namespace for data storing and exchange formats
Definition: GloriaAstrometry.h:15
double GetAverage(int ivar, int ix, int iy, int ipol=1)
Get expected average value for pixel (ix,iy) using calculated map.
Definition: GloriaAverageMap.h:164
double GetSpreadMean(int ivar=0)
Returns mean of noise map.
Definition: GloriaAverageMap.h:201
GloriaAverageMap()
Dummy constructor - does nothing (!)
Definition: GloriaAverageMap.h:47
double GetSpread(int ivar, double x, double y, int ipol=1)
Get spread of variable at position (x,y) using calculated map.
Definition: GloriaAverageMap.h:180
double GetSpread(int ivar, long ipix, int ipol=1)
Get spread for pixel ipix using calculated map.
Definition: GloriaAverageMap.h:184
double GetSpread(int ivar, int ix, int iy, int ipol=1)
Get spread of the variable for pixel (ix,iy) using calculated map.
Definition: GloriaAverageMap.h:176
double GetAverage(int ivar, double x, double y, int ipol=1)
Get expected average value level at position (x,y) using calculated map.
Definition: GloriaAverageMap.h:168
GloriaFitsImage * GetMapImage(int imap, int ipol=1)
Return image filled with parameter values.
Definition: GloriaValueMap.cc:457
void InitializeMaps(int Nbx, int Nby, int Nvar)
Allocate new map sets with given binning. All data and image size information are lost...
Definition: GloriaAverageMap.cc:41
double * GetGloriaAverageMap(int ivar=0)
Returns pointer to the average value map array.
Definition: GloriaAverageMap.h:191
double GetAverage(int ivar, long ipix, int ipol=1)
Get expected average value level for pixel ipix using calculated map.
Definition: GloriaAverageMap.h:172
double * GetSpreadMap(int ivar=0)
Returns pointer to the spread map array.
Definition: GloriaAverageMap.h:194
GloriaFitsImage * GetSpreadImage(int ivar=0, int ipol=1)
Return image filled with spread values.
Definition: GloriaAverageMap.h:209
double GetMapValue(int imap, int ix, int iy, int ipol=1)
Get value from map imap for pixel (ix,iy)
Definition: GloriaValueMap.cc:278
Class for constructing parameter/value maps for an image.
Definition: GloriaValueMap.h:33
Class for reading and processing fits tables in Luiza.
Definition: GloriaFitsTable.h:109
void AddAverage()
Add another variable to average value map set.
Definition: GloriaAverageMap.cc:77
double GetAverageMean(int ivar=0)
Returns mean of background map.
Definition: GloriaAverageMap.h:198
Class for reading and processing fits images in Luiza.
Definition: GloriaFitsImage.h:43
long CalculateMap(int iVar, int nVal, double *Xpos, double *Ypos, double *Val)
Calculate average value and spread maps for given variable.
Definition: GloriaAverageMap.cc:105
Class for calculating map of average values for any variable on the image.
Definition: GloriaAverageMap.h:42
long CalculateFitMap(int iVar, int nVal, double *Xpos, double *Ypos, double *Val, int Npol)
Calculate average value and spread maps using polynomial fit.
Definition: GloriaAverageMap.cc:128
double GetMapMean(int imap)
Returns mean value of map entries.
Definition: GloriaValueMap.cc:256
GloriaAverageMap(GloriaFitsTable *mapTable)
Constructor. Allocates map by importing it from fits table.
Definition: GloriaAverageMap.h:71
void SetAverageName(int ivar, string name)
Set name to the considered variable.
Definition: GloriaAverageMap.cc:97