source: trunk/param.hh @ 9

Last change on this file since 9 was 3, checked in by Matthew Whiting, 18 years ago

This is the first full import of all working code to
the Duchamp repository.
Made three directories at top level:

branches/ tags/ trunk/

and trunk/ has the full set of code:
ATrous/ Cubes/ Detection/ InputComplete? InputExample? README Utils/ docs/ mainDuchamp.cc param.cc param.hh

File size: 9.8 KB
Line 
1#ifndef PARAM_H
2#define PARAM_H
3
4#include <iostream>
5#include <string>
6#include <vector>
7
8using std::string;
9using std::vector;
10
11/**
12 * Param class.
13 *   Used for storing parameters used by all functions.
14 */
15class Param
16{
17public:
18  Param();
19  virtual ~Param(){};
20  void parseSubsection();                           // in param.cc
21  void readParams(string &paramfile);               // in param.cc
22  bool isBlank(float &value);                       // in param.cc
23  friend std::ostream& operator<< ( std::ostream& theStream, Param& par);
24  friend class Image;
25 
26  //
27  string getImageFile(){return imageFile;};
28  void   setImageFile(string fname){imageFile = fname;};
29  bool   getFlagSubsection(){return flagSubsection;};
30  void   setFlagSubsection(bool flag){flagSubsection=flag;};
31  string getSubsection(){return subsection;};
32  void   setSubsection(string range){subsection = range;};
33  bool   getFlagLog(){return flagLog;};
34  void   setFlagLog(bool flag){flagLog=flag;};
35  string getLogFile(){return logFile;};
36  void   setLogFile(string fname){logFile = fname;};
37  string getOutFile(){return outFile;};
38  void   setOutFile(string fname){outFile = fname;};
39  string getSpectraFile(){return spectraFile;};
40  void   setSpectraFile(string fname){spectraFile = fname;};
41  bool   getFlagOutputRecon(){return flagOutputRecon;};
42  void   setFlagOutputRecon(bool flag){flagOutputRecon=flag;};
43  bool   getFlagOutputResid(){return flagOutputResid;};
44  void   setFlagOutputResid(bool flag){flagOutputResid=flag;};
45  bool   getFlagVOT(){return flagVOT;};
46  void   setFlagVOT(bool flag){flagVOT=flag;};
47  string getVOTFile(){return votFile;};
48  void   setVOTFile(string fname){votFile = fname;};
49  bool   getFlagMaps(){return flagMaps;};
50  void   setFlagMaps(bool flag){flagMaps=flag;};
51  string getDetectionMap(){return detectionMap;};
52  void   setDetectionMap(string fname){detectionMap = fname;};
53  string getMomentMap(){return momentMap;};
54  void   setMomentMap(string fname){momentMap = fname;};
55  //
56  bool   getFlagBlankPix(){return flagBlankPix;};
57  void   setFlagBlankPix(bool flag){flagBlankPix=flag;};
58  bool   getNanFlag(){return nanAsBlank;};
59  void   setNanFlag(bool flag){nanAsBlank = flag;};
60  float  getBlankPixVal(){return blankPixValue;};
61  void   setBlankPixVal(float v){blankPixValue=v;};
62  int    getBlankKeyword(){return blankKeyword;};
63  void   setBlankKeyword(int v){blankKeyword=v;};
64  float  getBscaleKeyword(){return bscaleKeyword;};
65  void   setBscaleKeyword(float v){bscaleKeyword=v;};
66  float  getBzeroKeyword(){return bzeroKeyword;};
67  void   setBzeroKeyword(float v){bzeroKeyword=v;};
68  bool   getFlagMW(){return flagMW;};
69  bool   setFlagMW(bool flag){flagMW=flag;};
70  int    getMaxMW(){return maxMW;};
71  void   setMaxMW(int m){maxMW=m;};
72  int    getMinMW(){return minMW;};
73  void   setMinMW(int m){minMW=m;};
74  void   setBeamSize(float s){numPixBeam = s;};
75  float  getBeamSize(){return numPixBeam;};
76  //
77  bool   getFlagCubeTrimmed(){return flagTrimmed;};
78  void   setFlagCubeTrimmed(bool flag){flagTrimmed = flag;};
79  long   getBorderLeft(){return borderLeft;};
80  void   setBorderLeft(long b){borderLeft = b;};
81  long   getBorderRight(){return borderRight;};
82  void   setBorderRight(long b){borderRight = b;};
83  long   getBorderBottom(){return borderBottom;};
84  void   setBorderBottom(long b){borderBottom = b;};
85  long   getBorderTop(){return borderTop;};
86  void   setBorderTop(long b){borderTop = b;};
87  //
88  long   getXOffset(){return xSubOffset;};
89  void   setXOffset(long o){xSubOffset = o;};
90  long   getYOffset(){return ySubOffset;};
91  void   setYOffset(long o){ySubOffset = o;};
92  long   getZOffset(){return zSubOffset;};
93  void   setZOffset(long o){zSubOffset = o;};
94  //
95  int    getMinPix(){return minPix;};
96  void   setMinPix(int m){minPix=m;};
97  //     
98  bool   getFlagGrowth(){return flagGrowth;};
99  void   setFlagGrowth(bool flag){flagGrowth=flag;};
100  float  getGrowthCut(){return growthCut;};
101  void   setGrowthCut(float c){growthCut=c;};
102  //     
103  bool   getFlagFDR(){return flagFDR;};
104  void   setFlagFDR(bool flag){flagFDR=flag;};
105  float  getAlpha(){return alphaFDR;};
106  void   setAlpha(float a){alphaFDR=a;};
107  //
108  bool   getFlagBaseline(){return flagBaseline;};
109  void   setFlagBaseline(bool flag){flagBaseline = flag;};
110  //
111  float  getCut(){return snrCut;};
112  void   setCut(float c){snrCut=c;};
113  //     
114  bool   getFlagATrous(){return flagATrous;};
115  void   setFlagATrous(bool flag){flagATrous=flag;};
116  int    getMinScale(){return scaleMin;};
117  void   setMinScale(int s){scaleMin=s;};
118  float  getAtrousCut(){return snrRecon;};
119  void   setAtrousCut(float c){snrRecon=c;};
120  int    getFilterCode(){return filterCode;};
121  void   setFilterCode(int c){filterCode=c;};
122  string getFilterName(){return filterName;};
123  void   setFilterName(string s){filterName=s;};
124  //     
125  bool   getFlagAdjacent(){return flagAdjacent;};
126  void   setFlagAdjacent(bool flag){flagAdjacent=flag;};
127  float  getThreshS(){return threshSpatial;};
128  void   setThreshS(float t){threshSpatial=t;};
129  float  getThreshV(){return threshVelocity;};
130  void   setThreshV(float t){threshVelocity=t;};
131  int    getMinChannels(){return minChannels;};
132  void   setMinChannels(int n){minChannels=n;};
133  //
134  bool   drawBorders(){return borders;};
135  void   setDrawBorders(bool f){borders=f;};
136  bool   isVerbose(){return verbose;};
137  void   setVerbosity(bool f){verbose=f;};
138 
139private:
140  // Input files
141  string imageFile;       // The image to be analysed.
142  bool   flagSubsection;  // Whether we just want a subsection of the image
143  string subsection;      // The subsection requested, of the form [x1:x2,y1:y2,z1:z2]
144                          //   If you want the full range of one index, use *
145  // Output files
146  bool   flagLog;         // Should we do the intermediate logging?
147  string logFile;         // Where the intermediate logging goes.
148  string outFile;         // Where the final results get put.
149  string spectraFile;     // Where the spectra are displayed
150  bool   flagOutputRecon; // Should the reconstructed cube be written?
151  bool   flagOutputResid; // Should the reconstructed cube be written?
152  bool   flagVOT;         // Should we save results in VOTable format?
153  string votFile;         // Where the VOTable goes.
154  bool   flagMaps;        // Should we produce detection and moment maps in postscript form?
155  string detectionMap;    // The name of the detection map (ps file).
156  string momentMap;       // The name of the 1st moment map (ps file).
157
158  // Cube related parameters
159  bool   flagBlankPix;    // A flag that indicates whether there are pixels defined as BLANK,
160                          //   with the value given by the next parameter.
161  float  blankPixValue;   // Pixel value that is considered BLANK.
162  int    blankKeyword;    // The FITS header keyword BLANK.
163  float  bscaleKeyword;   // The FITS header keyword BSCALE.
164  float  bzeroKeyword;    // The FITS header keyword BZERO.
165  bool   nanAsBlank;      // Are the BLANK pixels defined by NaNs?
166  bool   flagMW;          // A flag that indicates whether to excise the Milky Way.
167  int    maxMW;           // Last  Galactic velocity plane for HIPASS cubes
168  int    minMW;           // First Galactic velocity plane for HIPASS cubes
169  float  numPixBeam;      // Size (area) of the beam in pixels.
170  // Trim-related         
171  bool   flagTrimmed;     // Has the cube been trimmed of excess BLANKs around the edge?
172  long   borderLeft;      // The number of BLANK pixels trimmed from the Left of the cube;
173  long   borderRight;     // The number of BLANK pixels trimmed from the Right of the cube;
174  long   borderBottom;    // The number of BLANK pixels trimmed from the Bottom of the cube;
175  long   borderTop;       // The number of BLANK pixels trimmed from the Top of the cube;
176  // Subsection offsets
177  long   xSubOffset;      // The offset in the x-direction from the subsection
178  long   ySubOffset;      // The offset in the y-direction from the subsection
179  long   zSubOffset;      // The offset in the z-direction from the subsection
180  // Baseline related;
181  bool   flagBaseline;    // Whether to do baseline subtraction before reconstruction and/or searching.
182  // Detection-related   
183  int    minPix;          // Minimum number of pixels for a detected object to be counted
184  // Object growth       
185  bool   flagGrowth;      // Are we growing objects once they are found?
186  float  growthCut;       // The SNR that we are growing objects down to.
187  // FDR analysis         
188  bool   flagFDR;         // Should the FDR method be used?
189  float  alphaFDR;        // Alpha value for FDR detection algorithm
190  // Other detection     
191  float  snrCut;          // How many sigma above mean is a detection when sigma-clipping
192  // A trous reconstruction parameters
193  bool   flagATrous;      // Are we using the a trous reconstruction?
194  int    scaleMin;        // Min scale used in a trous reconstruction
195  float  snrRecon;        // SNR cutoff used in a trous reconstruction
196                          //   (only wavelet coefficients that survive
197                          //    this threshold are kept)
198  int    filterCode;      // The code number for the filter to be used (saves having to parse names)
199  string filterName;      // The code number converted into a name, for outputting purposes.
200
201  // Volume-merging parameters
202  bool   flagAdjacent;    // Whether to use the adjacent criterion for
203                          //    judging if objects are to be merged.
204  float  threshSpatial;   // Maximum spatial separation between objects
205  float  threshVelocity;  // Maximum channels separation between objects
206  int    minChannels;     // Minimum no. of channels to make an object
207  // Input-Output related
208  bool   borders;         // Whether to draw a border around the individual
209                          //   pixels of a detection in the spectral display
210  bool   verbose;         // Whether to use maximum verbosity -- progress indicators in the
211                          //   reconstruction & merging functions.
212
213};
214
215
216#endif
Note: See TracBrowser for help on using the repository browser.