Luiza  v03-01
GloriaMedianMap.h
1 // -*- mode: c++; mode: auto-fill; mode: flyspell-prog; -*-
2 
3 
4 #ifndef GloriaMedianMap_h
5 #define GloriaMedianMap_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 
53 
54  public:
55 
58 
60 
65  GloriaMedianMap(int Nbx, int Nby, int Nvar = 1);
66 
67 
69 
73  GloriaMedianMap(const GloriaFitsImage* fitsImage, int Nbx, int Nby, int Nvar=1);
74 
76 
81  GloriaMedianMap(GloriaFitsTable* mapTable) : GloriaValueMap(mapTable) { };
82 
84 
88  void AddMedian();
89 
91 
95  void AddMedian(string name);
96 
97 
99  void SetMedianName(int ivar, string name);
100 
101 
103  inline string GetMedianName(int ivar) {return _valueNames.at(2*ivar); } ;
104 
105 
107 
117  long CalculateMap(int iVar, int nVal, double* Xpos, double* Ypos, double* Val);
118 
120 
130  long CalculateMap(int iVar, vector<double>* Xpos, vector<double>* Ypos, vector<double>* Val);
131 
132 
133 
135 
144  void CalculateBgMap(const GloriaFitsImage* fitsImage, int Nbx, int Nby, int sampling=1);
145 
147  void CalculateBgMap(const GloriaFitsImage* fitsImage, int sampling=1);
148 
149 
151 
159  inline double GetMedian(int ivar, int ix, int iy, int ipol=1)
160  { return GetMapValue(2*ivar,ix,iy,ipol); } ;
161 
163  inline double GetMedian(int ivar, double x, double y, int ipol=1)
164  { return GetMapValue(2*ivar,x,y,ipol); } ;
165 
167  inline double GetMedian(int ivar, long ipix, int ipol=1)
168  { return GetMapValue(2*ivar,ipix,ipol); } ;
169 
171  inline double GetSpread(int ivar, int ix, int iy, int ipol=1)
172  { return GetMapValue(2*ivar+1,ix,iy,ipol); } ;
173 
175  inline double GetSpread(int ivar, double x, double y, int ipol=1)
176  { return GetMapValue(2*ivar+1,x,y,ipol); } ;
177 
179  inline double GetSpread(int ivar, long ipix, int ipol=1)
180  { return GetMapValue(2*ivar+1,ipix,ipol); } ;
181 
182 
184 
191  inline double GetBgLevel(int ix, int iy, int ipol=1)
192  { return GetMapValue(0,ix,iy,ipol); } ;
193 
195  inline double GetBgLevel(double x, double y, int ipol=1)
196  { return GetMapValue(0,x,y,ipol); } ;
197 
199  inline double GetBgLevel(long ipix, int ipol=1)
200  { return GetMapValue(0,ipix,ipol); } ;
201 
203  inline double GetNoise(int ix, int iy, int ipol=1)
204  { return GetMapValue(1,ix,iy,ipol); } ;
205 
207  inline double GetNoise(double x, double y, int ipol=1)
208  { return GetMapValue(1,x,y,ipol); } ;
209 
211  inline double GetNoise(long ipix, int ipol=1)
212  { return GetMapValue(1,ipix,ipol); } ;
213 
214 
215 
217  inline double* GetGloriaMedianMap(int ivar=0) {return _valueMaps.at(2*ivar); };
218 
220  inline double* GetSpreadMap(int ivar=0) {return _valueMaps.at(2*ivar+1); };
221 
223  inline double* GetBgMap() {return _valueMaps.at(0); };
224 
226  inline double* GetNoiseMap() {return _valueMaps.at(1); };
227 
228 
229 
231  inline double GetMedianMean(int ivar=0){ return GetMapMean(2*ivar);} ;
232 
234  inline double GetSpreadMean(int ivar=0){ return GetMapMean(2*ivar+1);} ;
235 
237  inline double GetBgMean() { return GetMapMean(0); };
238 
240  inline double GetNoiseMean() { return GetMapMean(1); } ;
241 
242 
243 
245  inline GloriaFitsImage* GetMedianImage(int ivar=0, int ipol=1)
246  { return GetMapImage(2*ivar, ipol);} ;
247 
249  inline GloriaFitsImage* GetSpreadImage(int ivar=0, int ipol=1)
250  { return GetMapImage(2*ivar+1, ipol);} ;
251 
252 
254  inline GloriaFitsImage* GetBgImage(int ipol=1)
255  { return GetMapImage(0, ipol);} ;
256 
258  inline GloriaFitsImage* GetNoiseImage(int ipol=1)
259  { return GetMapImage(1, ipol);} ;
260 
262  void InitializeMaps(int Nbx, int Nby, int Nvar);
263 
264  } ;
265 
266 
267 }
268 
269 #endif
270 
271 
272 
GloriaFitsImage * GetSpreadImage(int ivar=0, int ipol=1)
Return image filled with spread values.
Definition: GloriaMedianMap.h:249
double GetBgLevel(double x, double y, int ipol=1)
Get background level at position (x,y) using calculated map.
Definition: GloriaMedianMap.h:195
double GetMedianMean(int ivar=0)
Returns mean of median map.
Definition: GloriaMedianMap.h:231
double GetNoise(double x, double y, int ipol=1)
Get noise level at position (x,y) using calculated map.
Definition: GloriaMedianMap.h:207
namespace for data storing and exchange formats
Definition: GloriaAstrometry.h:15
GloriaFitsImage * GetNoiseImage(int ipol=1)
Return image filled with noise values.
Definition: GloriaMedianMap.h:258
double * GetBgMap()
Returns pointer to the background map array.
Definition: GloriaMedianMap.h:223
void AddMedian()
Add another variable to median map set.
Definition: GloriaMedianMap.cc:76
void CalculateBgMap(const GloriaFitsImage *fitsImage, int Nbx, int Nby, int sampling=1)
Calculate background and noise map for given image.
Definition: GloriaMedianMap.cc:193
GloriaFitsImage * GetMapImage(int imap, int ipol=1)
Return image filled with parameter values.
Definition: GloriaValueMap.cc:457
double GetBgLevel(int ix, int iy, int ipol=1)
Get background level for pixel (ix,iy) using calculated map.
Definition: GloriaMedianMap.h:191
GloriaFitsImage * GetMedianImage(int ivar=0, int ipol=1)
Return image filled with median values.
Definition: GloriaMedianMap.h:245
void InitializeMaps(int Nbx, int Nby, int Nvar)
Allocate new map sets with given binning. All data and image size information are lost...
Definition: GloriaMedianMap.cc:40
double GetMedian(int ivar, long ipix, int ipol=1)
Get expected median level for pixel ipix using calculated map.
Definition: GloriaMedianMap.h:167
long CalculateMap(int iVar, int nVal, double *Xpos, double *Ypos, double *Val)
Calculate median and spread maps for given variable.
Definition: GloriaMedianMap.cc:104
double GetBgLevel(long ipix, int ipol=1)
Get background level for pixel ipix using calculated map.
Definition: GloriaMedianMap.h:199
double GetMedian(int ivar, double x, double y, int ipol=1)
Get expected median level at position (x,y) using calculated map.
Definition: GloriaMedianMap.h:163
double GetSpread(int ivar, double x, double y, int ipol=1)
Get spread of variable at position (x,y) using calculated map.
Definition: GloriaMedianMap.h:175
double GetBgMean()
Returns mean of background map.
Definition: GloriaMedianMap.h:237
double GetSpread(int ivar, int ix, int iy, int ipol=1)
Get spread of the variable for pixel (ix,iy) using calculated map.
Definition: GloriaMedianMap.h:171
double GetSpread(int ivar, long ipix, int ipol=1)
Get spread for pixel ipix using calculated map.
Definition: GloriaMedianMap.h:179
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
GloriaMedianMap(GloriaFitsTable *mapTable)
Constructor. Allocates map by importing it from fits table.
Definition: GloriaMedianMap.h:81
double * GetSpreadMap(int ivar=0)
Returns pointer to the spread map array.
Definition: GloriaMedianMap.h:220
double GetNoise(int ix, int iy, int ipol=1)
Get noise level for pixel (ix,iy) using calculated map.
Definition: GloriaMedianMap.h:203
double GetMedian(int ivar, int ix, int iy, int ipol=1)
Get expected median for pixel (ix,iy) using calculated map.
Definition: GloriaMedianMap.h:159
string GetMedianName(int ivar)
Return image filled with parameter values.
Definition: GloriaMedianMap.h:103
double GetSpreadMean(int ivar=0)
Returns mean of spread map.
Definition: GloriaMedianMap.h:234
Class for reading and processing fits images in Luiza.
Definition: GloriaFitsImage.h:43
double * GetGloriaMedianMap(int ivar=0)
Returns pointer to the median map array.
Definition: GloriaMedianMap.h:217
double GetNoiseMean()
Returns mean of noise map.
Definition: GloriaMedianMap.h:240
double * GetNoiseMap()
Returns pointer to the noise map array.
Definition: GloriaMedianMap.h:226
double GetNoise(long ipix, int ipol=1)
Get noise level for pixel ipix using calculated map.
Definition: GloriaMedianMap.h:211
void SetMedianName(int ivar, string name)
Set name to the considered variable.
Definition: GloriaMedianMap.cc:96
GloriaFitsImage * GetBgImage(int ipol=1)
Return image filled with background values.
Definition: GloriaMedianMap.h:254
double GetMapMean(int imap)
Returns mean value of map entries.
Definition: GloriaValueMap.cc:256
Class for calculating map of median values for any variable on the image.
Definition: GloriaMedianMap.h:52
GloriaMedianMap()
Dummy constructor - does nothing (!)
Definition: GloriaMedianMap.h:57