source: tags/release-0.9.2/param.hh @ 1323

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

A swag of changes, centred around the addition of functionality to read
in an already saved FITS file containing the reconstructed array.

duchamp.hh -- const strings containing new keywords for saved FITS files.
Cubes/saveImage.cc -- improved methods for saving the FITS files, including

header keywords indicating origin.

Cubes/readRecon.cc -- new function to read in reconstructed array from FITS file.
Cubes/cubes.cc -- recon array now declared if recon file exists.
Cubes/cubes.hh -- prototype for readReconCube
Cubes/trimImage.cc -- allow for case of recon file existing.
Cubes/getImage.cc -- improved error/warning reporting to match new function.
param.hh -- new parameters to deal with reconFile
param.cc -- IO and default values for new parameters.
docs/Guide.tex -- Describing new option. Also added instal guide.
InputComplete? -- Added new parameters, and set values shown to be default values.
mainDuchamp.cc -- code related to new function.
ATrous/ReconSearch.cc -- will now not do reconstruction if recon array exists.

Fixed bug in output.

ATrous/baselineSubtract.cc -- Subtract baseline from recon array if it exists.
Utils/wcsFunctions.cc -- Fixed error/warning reporting in line with new standards.

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