source: trunk/param.hh @ 67

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

Added functionality to search for negative features, by adding a flagNegative
in the parameter set. Individual files affected:

Cubes/invertCube.cc -- new file with two functions, to invert the cube and to

re-invert it after searching.

Cubes/plotting.cc -- improved momentMap so that it plots the negative flux

of detections.

Cubes/cubes.hh -- added prototypes for invertCube functions
param.cc -- accessor functionality for flagNegative
docs/Guide.tex -- Describe the new parameter and its use
mainDuchamp.cc -- Added in use of invertCube and reInvertCube functions
param.hh -- added definition of flagNegative
Detection/detection.cc -- added a call to calcParams() at start of

calcWCSparams(), so that all object params are up to date

File size: 10.6 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   getFlagKarma(){return flagKarma;};
50  void   setFlagKarma(bool flag){flagKarma=flag;};
51  string getKarmaFile(){return karmaFile;};
52  void   setKarmaFile(string fname){karmaFile = fname;};
53  bool   getFlagMaps(){return flagMaps;};
54  void   setFlagMaps(bool flag){flagMaps=flag;};
55  string getDetectionMap(){return detectionMap;};
56  void   setDetectionMap(string fname){detectionMap = fname;};
57  string getMomentMap(){return momentMap;};
58  void   setMomentMap(string fname){momentMap = fname;};
59  //
60  bool   getFlagNegative(){return flagNegative;};
61  void   setFlagNegative(bool flag){flagNegative=flag;};
62  bool   getFlagBlankPix(){return flagBlankPix;};
63  void   setFlagBlankPix(bool flag){flagBlankPix=flag;};
64  bool   getNanFlag(){return nanAsBlank;};
65  void   setNanFlag(bool flag){nanAsBlank = flag;};
66  float  getBlankPixVal(){return blankPixValue;};
67  void   setBlankPixVal(float v){blankPixValue=v;};
68  int    getBlankKeyword(){return blankKeyword;};
69  void   setBlankKeyword(int v){blankKeyword=v;};
70  float  getBscaleKeyword(){return bscaleKeyword;};
71  void   setBscaleKeyword(float v){bscaleKeyword=v;};
72  float  getBzeroKeyword(){return bzeroKeyword;};
73  void   setBzeroKeyword(float v){bzeroKeyword=v;};
74  bool   getFlagMW(){return flagMW;};
75  bool   setFlagMW(bool flag){flagMW=flag;};
76  int    getMaxMW(){return maxMW;};
77  void   setMaxMW(int m){maxMW=m;};
78  int    getMinMW(){return minMW;};
79  void   setMinMW(int m){minMW=m;};
80  void   setBeamSize(float s){numPixBeam = s;};
81  float  getBeamSize(){return numPixBeam;};
82  //
83  bool   getFlagCubeTrimmed(){return flagTrimmed;};
84  void   setFlagCubeTrimmed(bool flag){flagTrimmed = flag;};
85  long   getBorderLeft(){return borderLeft;};
86  void   setBorderLeft(long b){borderLeft = b;};
87  long   getBorderRight(){return borderRight;};
88  void   setBorderRight(long b){borderRight = b;};
89  long   getBorderBottom(){return borderBottom;};
90  void   setBorderBottom(long b){borderBottom = b;};
91  long   getBorderTop(){return borderTop;};
92  void   setBorderTop(long b){borderTop = b;};
93  //
94  long   getXOffset(){return xSubOffset;};
95  void   setXOffset(long o){xSubOffset = o;};
96  long   getYOffset(){return ySubOffset;};
97  void   setYOffset(long o){ySubOffset = o;};
98  long   getZOffset(){return zSubOffset;};
99  void   setZOffset(long o){zSubOffset = o;};
100  //
101  int    getMinPix(){return minPix;};
102  void   setMinPix(int m){minPix=m;};
103  //     
104  bool   getFlagGrowth(){return flagGrowth;};
105  void   setFlagGrowth(bool flag){flagGrowth=flag;};
106  float  getGrowthCut(){return growthCut;};
107  void   setGrowthCut(float c){growthCut=c;};
108  //     
109  bool   getFlagFDR(){return flagFDR;};
110  void   setFlagFDR(bool flag){flagFDR=flag;};
111  float  getAlpha(){return alphaFDR;};
112  void   setAlpha(float a){alphaFDR=a;};
113  //
114  bool   getFlagBaseline(){return flagBaseline;};
115  void   setFlagBaseline(bool flag){flagBaseline = flag;};
116  //
117  float  getCut(){return snrCut;};
118  void   setCut(float c){snrCut=c;};
119  //     
120  bool   getFlagATrous(){return flagATrous;};
121  void   setFlagATrous(bool flag){flagATrous=flag;};
122  int    getMinScale(){return scaleMin;};
123  void   setMinScale(int s){scaleMin=s;};
124  float  getAtrousCut(){return snrRecon;};
125  void   setAtrousCut(float c){snrRecon=c;};
126  int    getFilterCode(){return filterCode;};
127  void   setFilterCode(int c){filterCode=c;};
128  string getFilterName(){return filterName;};
129  void   setFilterName(string s){filterName=s;};
130  //     
131  bool   getFlagAdjacent(){return flagAdjacent;};
132  void   setFlagAdjacent(bool flag){flagAdjacent=flag;};
133  float  getThreshS(){return threshSpatial;};
134  void   setThreshS(float t){threshSpatial=t;};
135  float  getThreshV(){return threshVelocity;};
136  void   setThreshV(float t){threshVelocity=t;};
137  int    getMinChannels(){return minChannels;};
138  void   setMinChannels(int n){minChannels=n;};
139  //
140  string getSpectralMethod(){return spectralMethod;};
141  void   setSpectralMethod(string s){spectralMethod=s;};
142  bool   drawBorders(){return borders;};
143  void   setDrawBorders(bool f){borders=f;};
144  bool   isVerbose(){return verbose;};
145  void   setVerbosity(bool f){verbose=f;};
146 
147private:
148  // Input files
149  string imageFile;       // The image to be analysed.
150  bool   flagSubsection;  // Whether we just want a subsection of the image
151  string subsection;      // The subsection requested, of the form [x1:x2,y1:y2,z1:z2]
152                          //   If you want the full range of one index, use *
153  // Output files
154  bool   flagLog;         // Should we do the intermediate logging?
155  string logFile;         // Where the intermediate logging goes.
156  string outFile;         // Where the final results get put.
157  string spectraFile;     // Where the spectra are displayed
158  bool   flagOutputRecon; // Should the reconstructed cube be written?
159  bool   flagOutputResid; // Should the reconstructed cube be written?
160  bool   flagVOT;         // Should we save results in VOTable format?
161  string votFile;         // Where the VOTable goes.
162  bool   flagKarma;       // Should we save results in Karma annotation format?
163  string karmaFile;       // Where the Karma annotation file goes.
164  bool   flagMaps;        // Should we produce detection and moment maps in postscript form?
165  string detectionMap;    // The name of the detection map (ps file).
166  string momentMap;       // The name of the 0th moment map (ps file).
167
168  // Cube related parameters
169  bool   flagNegative;    // Are we going to search for negative features? (Need to invert the cube.)
170  bool   flagBlankPix;    // A flag that indicates whether there are pixels defined as BLANK,
171                          //   with the value given by the next parameter.
172  float  blankPixValue;   // Pixel value that is considered BLANK.
173  int    blankKeyword;    // The FITS header keyword BLANK.
174  float  bscaleKeyword;   // The FITS header keyword BSCALE.
175  float  bzeroKeyword;    // The FITS header keyword BZERO.
176  bool   nanAsBlank;      // Are the BLANK pixels defined by NaNs?
177  bool   flagMW;          // A flag that indicates whether to excise the Milky Way.
178  int    maxMW;           // Last  Galactic velocity plane for HIPASS cubes
179  int    minMW;           // First Galactic velocity plane for HIPASS cubes
180  float  numPixBeam;      // Size (area) of the beam in pixels.
181  // Trim-related         
182  bool   flagTrimmed;     // Has the cube been trimmed of excess BLANKs around the edge?
183  long   borderLeft;      // The number of BLANK pixels trimmed from the Left of the cube;
184  long   borderRight;     // The number of BLANK pixels trimmed from the Right of the cube;
185  long   borderBottom;    // The number of BLANK pixels trimmed from the Bottom of the cube;
186  long   borderTop;       // The number of BLANK pixels trimmed from the Top of the cube;
187  // Subsection offsets
188  long   xSubOffset;      // The offset in the x-direction from the subsection
189  long   ySubOffset;      // The offset in the y-direction from the subsection
190  long   zSubOffset;      // The offset in the z-direction from the subsection
191  // Baseline related;
192  bool   flagBaseline;    // Whether to do baseline subtraction before reconstruction and/or searching.
193  // Detection-related   
194  int    minPix;          // Minimum number of pixels for a detected object to be counted
195  // Object growth       
196  bool   flagGrowth;      // Are we growing objects once they are found?
197  float  growthCut;       // The SNR that we are growing objects down to.
198  // FDR analysis         
199  bool   flagFDR;         // Should the FDR method be used?
200  float  alphaFDR;        // Alpha value for FDR detection algorithm
201  // Other detection     
202  float  snrCut;          // How many sigma above mean is a detection when sigma-clipping
203  // A trous reconstruction parameters
204  bool   flagATrous;      // Are we using the a trous reconstruction?
205  int    scaleMin;        // Min scale used in a trous reconstruction
206  float  snrRecon;        // SNR cutoff used in a trous reconstruction
207                          //   (only wavelet coefficients that survive
208                          //    this threshold are kept)
209  int    filterCode;      // The code number for the filter to be used (saves having to parse names)
210  string filterName;      // The code number converted into a name, for outputting purposes.
211
212  // Volume-merging parameters
213  bool   flagAdjacent;    // Whether to use the adjacent criterion for
214                          //    judging if objects are to be merged.
215  float  threshSpatial;   // Maximum spatial separation between objects
216  float  threshVelocity;  // Maximum channels separation between objects
217  int    minChannels;     // Minimum no. of channels to make an object
218  // Input-Output related
219  string spectralMethod;  // A string indicating choice of spectral plotting method:
220                          //   choices are "peak" or "sum" (peak is the default).
221  bool   borders;         // Whether to draw a border around the individual
222                          //   pixels of a detection in the spectral display
223  bool   verbose;         // Whether to use maximum verbosity -- progress indicators in the
224                          //   reconstruction & merging functions.
225
226};
227
228
229#endif
Note: See TracBrowser for help on using the repository browser.