Luiza  v03-01
GloriaValueMap.h
1 // -*- mode: c++; mode: auto-fill; mode: flyspell-prog; -*-
2 
3 
4 #ifndef GloriaValueMap_h
5 #define GloriaValueMap_h 1
6 
7 #include "gloria/GloriaFitsTable.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 
34 
35  public:
36 
37 
40 
42 
47  GloriaValueMap(int Nbx, int Nby, int Nmap=1);
48 
49 
51 
54  GloriaValueMap(const GloriaFitsImage* fitsImage, int Nbx, int Nby, int Nmap=1);
55 
56 
58 
64 
65 
67  virtual ~GloriaValueMap();
68 
70  void SetImageSize(const GloriaFitsImage* fitsImage);
71 
73  void SetImageSize(int SizeX, int SizeY);
74 
75 
77 
80  void AddMap();
81 
83 
86  void AddMap(string name);
87 
89 
90  inline void SetMapName(int imap, string name)
91  { _valueNames.at(imap) = name ; } ;
92 
94 
100  double GetMapValue(int imap, int ix, int iy, int ipol=1);
101 
103  double GetMapValue(int imap, long ipix, int ipol=1);
104 
106  double GetMapValue(int imap, double x, double y, int ipol=1);
107 
109  inline int Nmap() { return _valueMaps.size(); };
110 
112  inline int NMapX() { return _nMapX; };
113 
115  inline int NMapY() { return _nMapY; };
116 
118  inline int ImgSizeX() { return _sizeX; };
119 
121  inline int ImgSizeY() { return _sizeY; };
122 
124  inline double* GetMap(int imap) {return _valueMaps.at(imap); };
125 
127  inline string GetMapName(int imap) {return _valueNames.at(imap); } ;
128 
130  double GetMapMean(int imap);
131 
133  GloriaFitsImage* GetMapImage(int imap, int ipol=1);
134 
137 
139  bool LoadFromTable(GloriaFitsTable* mapTable);
140 
142  void ClearMaps();
143 
145  void InitializeMaps(int Nbx, int Nby, int Nmap);
146 
147 protected:
148 
149  // Different interpolation orders
150  void FillMapImage0(double* map, GloriaFitsImage* mapImage);
151  void FillMapImage1(double* map, GloriaFitsImage* mapImage);
152  void FillMapImage2(double* map, GloriaFitsImage* mapImage);
153 
154  // Number of map bins in X,Y
155  int _nMapX, _nMapY, _nMapXY;
156 
157  // Number of bins in the input image
158  int _sizeX, _sizeY;
159  long _sizeXY;
160 
161  // Size of map bin
162  int _binX, _binY, _binXY;
163 
164  // vector of map arrays
165  std::vector<double*> _valueMaps;
166 
167  // vector of map names
168  std::vector<string> _valueNames;
169 
170  } ;
171 
172 
173 }
174 
175 #endif
176 
177 
178 
int ImgSizeY()
Get image pixels in Y.
Definition: GloriaValueMap.h:121
double * GetMap(int imap)
Returns pointer to the map array.
Definition: GloriaValueMap.h:124
virtual ~GloriaValueMap()
Destructor.
Definition: GloriaValueMap.cc:140
namespace for data storing and exchange formats
Definition: GloriaAstrometry.h:15
void SetMapName(int imap, string name)
Set name for existing map.
Definition: GloriaValueMap.h:90
int Nmap()
Get number of maps.
Definition: GloriaValueMap.h:109
int NMapX()
Get map binning in X.
Definition: GloriaValueMap.h:112
bool LoadFromTable(GloriaFitsTable *mapTable)
Initialize value map structures from the table.
Definition: GloriaValueMap.cc:182
void ClearMaps()
Clear all defined maps. Clears also map binning and image size information.
Definition: GloriaValueMap.cc:29
string GetMapName(int imap)
Return image filled with parameter values.
Definition: GloriaValueMap.h:127
void AddMap()
Add another map to current map set.
Definition: GloriaValueMap.cc:105
GloriaFitsImage * GetMapImage(int imap, int ipol=1)
Return image filled with parameter values.
Definition: GloriaValueMap.cc:457
double GetMapValue(int imap, int ix, int iy, int ipol=1)
Get value from map imap for pixel (ix,iy)
Definition: GloriaValueMap.cc:278
GloriaFitsTable * GetTable()
Return table containing all defined maps as columns.
Definition: GloriaValueMap.cc:148
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
int ImgSizeX()
Get image pixels in X.
Definition: GloriaValueMap.h:118
void SetImageSize(const GloriaFitsImage *fitsImage)
Set size of image.
Definition: GloriaValueMap.cc:127
int NMapY()
Get map binning in Y.
Definition: GloriaValueMap.h:115
Class for reading and processing fits images in Luiza.
Definition: GloriaFitsImage.h:43
void FillMapImage1(double *map, GloriaFitsImage *mapImage)
Definition: GloriaValueMap.cc:495
GloriaValueMap()
Dummy constructor - does nothing (!)
Definition: GloriaValueMap.cc:23
double GetMapMean(int imap)
Returns mean value of map entries.
Definition: GloriaValueMap.cc:256
void InitializeMaps(int Nbx, int Nby, int Nmap)
Allocate new, empty maps with given binning. All data and image size information are lost...
Definition: GloriaValueMap.cc:69