1 | // ----------------------------------------------------------------------- |
---|
2 | // param.hh: Definition of the parameter set. |
---|
3 | // ----------------------------------------------------------------------- |
---|
4 | // Copyright (C) 2006, Matthew Whiting, ATNF |
---|
5 | // |
---|
6 | // This program is free software; you can redistribute it and/or modify it |
---|
7 | // under the terms of the GNU General Public License as published by the |
---|
8 | // Free Software Foundation; either version 2 of the License, or (at your |
---|
9 | // option) any later version. |
---|
10 | // |
---|
11 | // Duchamp is distributed in the hope that it will be useful, but WITHOUT |
---|
12 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
13 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
---|
14 | // for more details. |
---|
15 | // |
---|
16 | // You should have received a copy of the GNU General Public License |
---|
17 | // along with Duchamp; if not, write to the Free Software Foundation, |
---|
18 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA |
---|
19 | // |
---|
20 | // Correspondence concerning Duchamp may be directed to: |
---|
21 | // Internet email: Matthew.Whiting [at] atnf.csiro.au |
---|
22 | // Postal address: Dr. Matthew Whiting |
---|
23 | // Australia Telescope National Facility, CSIRO |
---|
24 | // PO Box 76 |
---|
25 | // Epping NSW 1710 |
---|
26 | // AUSTRALIA |
---|
27 | // ----------------------------------------------------------------------- |
---|
28 | #ifndef PARAM_H |
---|
29 | #define PARAM_H |
---|
30 | |
---|
31 | #include <iostream> |
---|
32 | #include <string> |
---|
33 | #include <vector> |
---|
34 | #include <math.h> |
---|
35 | #include <wcslib/wcs.h> |
---|
36 | #include <wcslib/wcshdr.h> |
---|
37 | #include <duchamp/Utils/Section.hh> |
---|
38 | #include <duchamp/ATrous/filter.hh> |
---|
39 | |
---|
40 | namespace duchamp |
---|
41 | { |
---|
42 | |
---|
43 | |
---|
44 | class FitsHeader; // foreshadow this so that Param knows it exists |
---|
45 | |
---|
46 | const int numSortingParamOptions = 10; |
---|
47 | const std::string sortingParamOptions[numSortingParamOptions]={"xvalue","yvalue","zvalue","ra","dec","vel","w50","iflux","pflux","snr"}; |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | /// @brief Class to store general parameters. |
---|
52 | /// |
---|
53 | /// @details This is a general repository for parameters that are used by all |
---|
54 | /// functions. This is how the user interacts with the program, as |
---|
55 | /// parameters are read in from disk files through functions in this |
---|
56 | /// class. |
---|
57 | |
---|
58 | class Param |
---|
59 | { |
---|
60 | public: |
---|
61 | /// @brief Default constructor. |
---|
62 | Param(); |
---|
63 | |
---|
64 | /// @brief Copy constructor for Param. |
---|
65 | Param(const Param& p); |
---|
66 | |
---|
67 | /// @brief Assignment operator for Param. |
---|
68 | Param& operator= (const Param& p); |
---|
69 | |
---|
70 | /// @brief Destructor function. |
---|
71 | virtual ~Param(); |
---|
72 | |
---|
73 | /// @brief Define the default values of each parameter. |
---|
74 | void defaultValues(); |
---|
75 | |
---|
76 | //----------------- |
---|
77 | // Functions in param.cc |
---|
78 | // |
---|
79 | /// @brief Parse the command line parameters correctly. |
---|
80 | int getopts(int argc, char ** argv, std::string progname="Duchamp"); |
---|
81 | |
---|
82 | /// @brief Read in parameters from a disk file. |
---|
83 | int readParams(std::string paramfile); |
---|
84 | |
---|
85 | /// @brief Check the parameter list for inconsistencies |
---|
86 | void checkPars(); |
---|
87 | |
---|
88 | /// @brief Copy certain necessary FITS header parameters from a FitsHeader object |
---|
89 | void copyHeaderInfo(FitsHeader &head); |
---|
90 | |
---|
91 | /// @brief Determine filename in which to save the mask array. |
---|
92 | std::string outputMaskFile(); |
---|
93 | |
---|
94 | /// @brief Determine filename in which to save the smoothed array. |
---|
95 | std::string outputSmoothFile(); |
---|
96 | |
---|
97 | /// @brief Determine filename in which to save the reconstructed array. |
---|
98 | std::string outputReconFile(); |
---|
99 | |
---|
100 | /// @brief Determine filename in which to save the residual array from the atrous reconstruction. |
---|
101 | std::string outputResidFile(); |
---|
102 | |
---|
103 | /// @brief Print the parameter set in a readable fashion. |
---|
104 | friend std::ostream& operator<< ( std::ostream& theStream, Param& par); |
---|
105 | friend class Image; |
---|
106 | |
---|
107 | //------------------ |
---|
108 | // Functions in FitsIO/subsection.cc |
---|
109 | // |
---|
110 | /// @brief Make sure the subsection strings are OK. |
---|
111 | int verifySubsection(); |
---|
112 | |
---|
113 | /// @brief Set the correct offset values for each axis |
---|
114 | void setOffsets(struct wcsprm *wcs); |
---|
115 | |
---|
116 | /// @brief Set the correct offset values for each axis |
---|
117 | void setOffsets(struct wcsprm &wcs); |
---|
118 | |
---|
119 | //------------------ |
---|
120 | // These are in param.cc |
---|
121 | /// @brief Is a pixel value a BLANK? |
---|
122 | bool isBlank(float &value); |
---|
123 | |
---|
124 | /// @brief Is a given channel flagged as being in the Milky Way? |
---|
125 | bool isInMW(int z); |
---|
126 | |
---|
127 | /// @brief Is a given pixel position OK for use with stats calculations? |
---|
128 | bool isStatOK(int x, int y, int z); |
---|
129 | |
---|
130 | /// @brief Make a mask array -- an array saying whether each pixel is BLANK or not |
---|
131 | bool *makeBlankMask(float *array, int size); |
---|
132 | |
---|
133 | /// @brief Make a mask array -- an array saying whether each pixel is able to be used for statistics calculations |
---|
134 | bool *makeStatMask(float *array, long *dim); |
---|
135 | |
---|
136 | //-------------------- |
---|
137 | // Basic inline accessor functions |
---|
138 | // |
---|
139 | std::string getImageFile(){return imageFile;}; |
---|
140 | void setImageFile(std::string fname){imageFile = fname;}; |
---|
141 | std::string getFullImageFile(){ |
---|
142 | if(flagSubsection) return imageFile+pixelSec.getSection(); |
---|
143 | else return imageFile; |
---|
144 | }; |
---|
145 | bool getFlagSubsection(){return flagSubsection;}; |
---|
146 | void setFlagSubsection(bool flag){flagSubsection=flag;}; |
---|
147 | std::string getSubsection(){return pixelSec.getSection();}; |
---|
148 | void setSubsection(std::string range){pixelSec.setSection(range);}; |
---|
149 | Section §ion(){Section &rsection = pixelSec; return rsection;}; |
---|
150 | bool getFlagReconExists(){return flagReconExists;}; |
---|
151 | void setFlagReconExists(bool flag){flagReconExists=flag;}; |
---|
152 | std::string getReconFile(){return reconFile;}; |
---|
153 | void setReconFile(std::string file){reconFile = file;}; |
---|
154 | bool getFlagSmoothExists(){return flagSmoothExists;}; |
---|
155 | void setFlagSmoothExists(bool flag){flagSmoothExists=flag;}; |
---|
156 | std::string getSmoothFile(){return smoothFile;}; |
---|
157 | void setSmoothFile(std::string file){smoothFile = file;}; |
---|
158 | // |
---|
159 | bool getFlagUsePrevious(){return usePrevious;}; |
---|
160 | void setFlagUsePrevious(bool flag){usePrevious=flag;}; |
---|
161 | std::string getObjectList(){return objectList;}; |
---|
162 | void setObjectList(std::string s){objectList = s;}; |
---|
163 | std::vector<int> getObjectRequest(); |
---|
164 | std::vector<bool> getObjectChoices(); |
---|
165 | std::vector<bool> getObjectChoices(int numObjects); |
---|
166 | // |
---|
167 | bool getFlagLog(){return flagLog;}; |
---|
168 | void setFlagLog(bool flag){flagLog=flag;}; |
---|
169 | std::string getLogFile(){return logFile;}; |
---|
170 | void setLogFile(std::string fname){logFile = fname;}; |
---|
171 | std::string getOutFile(){return outFile;}; |
---|
172 | void setOutFile(std::string fname){outFile = fname;}; |
---|
173 | bool getFlagSeparateHeader(){return flagSeparateHeader;}; |
---|
174 | void setFlagSeparateHeader(bool b){flagSeparateHeader=b;}; |
---|
175 | std::string getHeaderFile(){return headerFile;}; |
---|
176 | void setHeaderFile(std::string s){headerFile=s;}; |
---|
177 | std::string getSpectraFile(){return spectraFile;}; |
---|
178 | void setSpectraFile(std::string fname){spectraFile = fname;}; |
---|
179 | bool getFlagTextSpectra(){return flagTextSpectra;}; |
---|
180 | void setFlagTextSpectra(bool b){flagTextSpectra = b;}; |
---|
181 | std::string getSpectraTextFile(){return spectraTextFile;}; |
---|
182 | void setSpectraTextFile(std::string fname){spectraTextFile = fname;}; |
---|
183 | bool getFlagOutputMask(){return flagOutputMask;}; |
---|
184 | void setFlagOutputMask(bool flag){flagOutputMask=flag;}; |
---|
185 | std::string getFileOutputMask(){return fileOutputMask;}; |
---|
186 | void setFileOutputMask(std::string s){fileOutputMask=s;}; |
---|
187 | bool getFlagMaskWithObjectNum(){return flagMaskWithObjectNum;}; |
---|
188 | void setFlagMaskWithObjectNum(bool flag){flagMaskWithObjectNum=flag;}; |
---|
189 | bool getFlagOutputSmooth(){return flagOutputSmooth;}; |
---|
190 | void setFlagOutputSmooth(bool flag){flagOutputSmooth=flag;}; |
---|
191 | std::string getFileOutputSmooth(){return fileOutputSmooth;}; |
---|
192 | void setFileOutputSmooth(std::string s){fileOutputSmooth=s;}; |
---|
193 | bool getFlagOutputRecon(){return flagOutputRecon;}; |
---|
194 | void setFlagOutputRecon(bool flag){flagOutputRecon=flag;}; |
---|
195 | std::string getFileOutputRecon(){return fileOutputRecon;}; |
---|
196 | void setFileOutputRecon(std::string s){fileOutputRecon=s;}; |
---|
197 | bool getFlagOutputResid(){return flagOutputResid;}; |
---|
198 | void setFlagOutputResid(bool flag){flagOutputResid=flag;}; |
---|
199 | std::string getFileOutputResid(){return fileOutputResid;}; |
---|
200 | void setFileOutputResid(std::string s){fileOutputResid=s;}; |
---|
201 | bool getFlagVOT(){return flagVOT;}; |
---|
202 | void setFlagVOT(bool flag){flagVOT=flag;}; |
---|
203 | std::string getVOTFile(){return votFile;}; |
---|
204 | void setVOTFile(std::string fname){votFile = fname;}; |
---|
205 | bool getFlagKarma(){return flagKarma;}; |
---|
206 | void setFlagKarma(bool flag){flagKarma=flag;}; |
---|
207 | std::string getAnnotationType(){return annotationType;}; |
---|
208 | void setAnnotationType(std::string s){annotationType=s;}; |
---|
209 | std::string getKarmaFile(){return karmaFile;}; |
---|
210 | void setKarmaFile(std::string fname){karmaFile = fname;}; |
---|
211 | bool getFlagMaps(){return flagMaps;}; |
---|
212 | void setFlagMaps(bool flag){flagMaps=flag;}; |
---|
213 | std::string getDetectionMap(){return detectionMap;}; |
---|
214 | void setDetectionMap(std::string fname){detectionMap = fname;}; |
---|
215 | std::string getMomentMap(){return momentMap;}; |
---|
216 | void setMomentMap(std::string fname){momentMap = fname;}; |
---|
217 | bool getFlagXOutput(){return flagXOutput;}; |
---|
218 | void setFlagXOutput(bool b){flagXOutput=b;}; |
---|
219 | int getPrecFlux(){return precFlux;}; |
---|
220 | void setPrecFlux(int i){precFlux=i;}; |
---|
221 | int getPrecVel(){return precVel;}; |
---|
222 | void setPrecVel(int i){precVel=i;}; |
---|
223 | int getPrecSNR(){return precSNR;}; |
---|
224 | void setPrecSNR(int i){precSNR=i;}; |
---|
225 | // |
---|
226 | bool getFlagNegative(){return flagNegative;}; |
---|
227 | void setFlagNegative(bool flag){flagNegative=flag;}; |
---|
228 | bool getFlagBlankPix(){return flagBlankPix;}; |
---|
229 | void setFlagBlankPix(bool flag){flagBlankPix=flag;}; |
---|
230 | float getBlankPixVal(){return blankPixValue;}; |
---|
231 | void setBlankPixVal(float v){blankPixValue=v;}; |
---|
232 | int getBlankKeyword(){return blankKeyword;}; |
---|
233 | void setBlankKeyword(int v){blankKeyword=v;}; |
---|
234 | float getBscaleKeyword(){return bscaleKeyword;}; |
---|
235 | void setBscaleKeyword(float v){bscaleKeyword=v;}; |
---|
236 | float getBzeroKeyword(){return bzeroKeyword;}; |
---|
237 | void setBzeroKeyword(float v){bzeroKeyword=v;}; |
---|
238 | bool getFlagMW(){return flagMW;}; |
---|
239 | void setFlagMW(bool flag){flagMW=flag;}; |
---|
240 | int getMaxMW(){return maxMW;}; |
---|
241 | void setMaxMW(int m){maxMW=m;}; |
---|
242 | int getMinMW(){return minMW;}; |
---|
243 | void setMinMW(int m){minMW=m;}; |
---|
244 | void setBeamSize(float s){numPixBeam = s;}; |
---|
245 | float getBeamSize(){return numPixBeam;}; |
---|
246 | bool getFlagUsingBeam(){return flagUsingBeam;}; |
---|
247 | void setFlagUsingBeam(bool b){flagUsingBeam=b;}; |
---|
248 | std::string getNewFluxUnits(){return newFluxUnits;}; |
---|
249 | void setNewFluxUnits(std::string s){newFluxUnits=s;}; |
---|
250 | // |
---|
251 | bool getFlagTrim(){return flagTrim;}; |
---|
252 | void setFlagTrim(bool b){flagTrim=b;}; |
---|
253 | bool getFlagCubeTrimmed(){return hasBeenTrimmed;}; |
---|
254 | void setFlagCubeTrimmed(bool flag){hasBeenTrimmed = flag;}; |
---|
255 | long getBorderLeft(){return borderLeft;}; |
---|
256 | void setBorderLeft(long b){borderLeft = b;}; |
---|
257 | long getBorderRight(){return borderRight;}; |
---|
258 | void setBorderRight(long b){borderRight = b;}; |
---|
259 | long getBorderBottom(){return borderBottom;}; |
---|
260 | void setBorderBottom(long b){borderBottom = b;}; |
---|
261 | long getBorderTop(){return borderTop;}; |
---|
262 | void setBorderTop(long b){borderTop = b;}; |
---|
263 | // |
---|
264 | long getXOffset(){return xSubOffset;}; |
---|
265 | void setXOffset(long o){xSubOffset = o;}; |
---|
266 | long getYOffset(){return ySubOffset;}; |
---|
267 | void setYOffset(long o){ySubOffset = o;}; |
---|
268 | long getZOffset(){return zSubOffset;}; |
---|
269 | void setZOffset(long o){zSubOffset = o;}; |
---|
270 | // |
---|
271 | unsigned int getMinPix(){return minPix;}; |
---|
272 | void setMinPix(int m){minPix=m;}; |
---|
273 | // |
---|
274 | bool getFlagGrowth(){return flagGrowth;}; |
---|
275 | void setFlagGrowth(bool flag){flagGrowth=flag;}; |
---|
276 | float getGrowthCut(){return growthCut;}; |
---|
277 | void setGrowthCut(float c){growthCut=c;}; |
---|
278 | float getGrowthThreshold(){return growthThreshold;}; |
---|
279 | void setGrowthThreshold(float f){growthThreshold=f;}; |
---|
280 | bool getFlagUserGrowthThreshold(){return flagUserGrowthThreshold;}; |
---|
281 | void setFlagUserGrowthThreshold(bool b){flagUserGrowthThreshold=b;}; |
---|
282 | // |
---|
283 | bool getFlagFDR(){return flagFDR;}; |
---|
284 | void setFlagFDR(bool flag){flagFDR=flag;}; |
---|
285 | float getAlpha(){return alphaFDR;}; |
---|
286 | void setAlpha(float a){alphaFDR=a;}; |
---|
287 | int getFDRnumCorChan(){return FDRnumCorChan;}; |
---|
288 | void setFDRnumCorChan(int i){FDRnumCorChan=i;}; |
---|
289 | // |
---|
290 | bool getFlagBaseline(){return flagBaseline;}; |
---|
291 | void setFlagBaseline(bool flag){flagBaseline = flag;}; |
---|
292 | // |
---|
293 | bool getFlagStatSec(){return flagStatSec;}; |
---|
294 | void setFlagStatSec(bool flag){flagStatSec=flag;}; |
---|
295 | std::string getStatSec(){return statSec.getSection();}; |
---|
296 | void setStatSec(std::string range){statSec.setSection(range);}; |
---|
297 | bool getFlagRobustStats(){return flagRobustStats;}; |
---|
298 | void setFlagRobustStats(bool flag){flagRobustStats=flag;}; |
---|
299 | float getCut(){return snrCut;}; |
---|
300 | void setCut(float c){snrCut=c;}; |
---|
301 | float getThreshold(){return threshold;}; |
---|
302 | void setThreshold(float f){threshold=f;}; |
---|
303 | bool getFlagUserThreshold(){return flagUserThreshold;}; |
---|
304 | void setFlagUserThreshold(bool b){flagUserThreshold=b;}; |
---|
305 | // |
---|
306 | bool getFlagSmooth(){return flagSmooth;}; |
---|
307 | void setFlagSmooth(bool b){flagSmooth=b;}; |
---|
308 | std::string getSmoothType(){return smoothType;}; |
---|
309 | void setSmoothType(std::string s){smoothType=s;}; |
---|
310 | int getHanningWidth(){return hanningWidth;}; |
---|
311 | void setHanningWidth(int f){hanningWidth=f;}; |
---|
312 | void setKernMaj(float f){kernMaj=f;}; |
---|
313 | float getKernMaj(){return kernMaj;}; |
---|
314 | void setKernMin(float f){kernMin=f;}; |
---|
315 | float getKernMin(){return kernMin;}; |
---|
316 | void setKernPA(float f){kernPA=f;}; |
---|
317 | float getKernPA(){return kernPA;}; |
---|
318 | // |
---|
319 | bool getFlagATrous(){return flagATrous;}; |
---|
320 | void setFlagATrous(bool flag){flagATrous=flag;}; |
---|
321 | int getReconDim(){return reconDim;}; |
---|
322 | void setReconDim(int i){reconDim=i;}; |
---|
323 | int getMinScale(){return scaleMin;}; |
---|
324 | void setMinScale(int s){scaleMin=s;}; |
---|
325 | int getMaxScale(){return scaleMax;}; |
---|
326 | void setMaxScale(int s){scaleMax=s;}; |
---|
327 | float getAtrousCut(){return snrRecon;}; |
---|
328 | void setAtrousCut(float c){snrRecon=c;}; |
---|
329 | int getFilterCode(){return filterCode;}; |
---|
330 | void setFilterCode(int c){filterCode=c;}; |
---|
331 | std::string getFilterName(){return reconFilter.getName();}; |
---|
332 | Filter& filter(){ Filter &rfilter = reconFilter; return rfilter; }; |
---|
333 | // |
---|
334 | bool getFlagAdjacent(){return flagAdjacent;}; |
---|
335 | void setFlagAdjacent(bool flag){flagAdjacent=flag;}; |
---|
336 | float getThreshS(){return threshSpatial;}; |
---|
337 | void setThreshS(float t){threshSpatial=t;}; |
---|
338 | float getThreshV(){return threshVelocity;}; |
---|
339 | void setThreshV(float t){threshVelocity=t;}; |
---|
340 | int getMinChannels(){return minChannels;}; |
---|
341 | void setMinChannels(int n){minChannels=n;}; |
---|
342 | // |
---|
343 | std::string getSpectralMethod(){return spectralMethod;}; |
---|
344 | void setSpectralMethod(std::string s){spectralMethod=s;}; |
---|
345 | std::string getSpectralUnits(){return spectralUnits;}; |
---|
346 | void setSpectralUnits(std::string s){spectralUnits=s;}; |
---|
347 | std::string getPixelCentre(){return pixelCentre;}; |
---|
348 | void setPixelCentre(std::string s){pixelCentre=s;}; |
---|
349 | std::string getSortingParam(){return sortingParam;}; |
---|
350 | void setSortingParam(std::string s){sortingParam=s;}; |
---|
351 | bool drawBorders(){return borders;}; |
---|
352 | void setDrawBorders(bool f){borders=f;}; |
---|
353 | bool drawBlankEdge(){return blankEdge;}; |
---|
354 | void setDrawBlankEdge(bool f){blankEdge=f;}; |
---|
355 | |
---|
356 | /// @brief Are we in verbose mode? |
---|
357 | bool isVerbose(){return verbose;}; |
---|
358 | void setVerbosity(bool f){verbose=f;}; |
---|
359 | |
---|
360 | private: |
---|
361 | // Input files |
---|
362 | std::string imageFile; ///< The image to be analysed. |
---|
363 | bool flagSubsection; ///< Whether we just want a subsection of the image |
---|
364 | Section pixelSec; ///< The Section object storing the pixel subsection information. |
---|
365 | bool flagReconExists; ///< The reconstructed array is in a FITS file on disk. |
---|
366 | std::string reconFile; ///< The FITS file containing the reconstructed array. |
---|
367 | bool flagSmoothExists;///< The smoothed array is in a FITS file. |
---|
368 | std::string smoothFile; ///< The FITS file containing the smoothed array. |
---|
369 | |
---|
370 | bool usePrevious; ///< Whether to read the detections from a previously-created log file |
---|
371 | std::string objectList; ///< List of objects to re-plot |
---|
372 | |
---|
373 | // Output files |
---|
374 | bool flagLog; ///< Should we do the intermediate logging? |
---|
375 | std::string logFile; ///< Where the intermediate logging goes. |
---|
376 | std::string outFile; ///< Where the final results get put. |
---|
377 | bool flagSeparateHeader;///< Should the header information(parameters & statistics) be written to a separate file to the table ofresults? |
---|
378 | std::string headerFile; ///< Where the header information to go with the results table should be written. |
---|
379 | std::string spectraFile; ///< Where the spectra are displayed |
---|
380 | bool flagTextSpectra; ///< Should a text file with all spectra be written? |
---|
381 | std::string spectraTextFile; ///< Where the text spectra are written. |
---|
382 | bool flagOutputMask; ///< Should the mask image be written? |
---|
383 | std::string fileOutputMask; ///< The name of the mask image. |
---|
384 | bool flagMaskWithObjectNum;///< Should the mask values be labeled with the object ID (or just 1)? |
---|
385 | bool flagOutputSmooth;///< Should the smoothed cube be written? |
---|
386 | std::string fileOutputSmooth;///< The name of the smoothed cube file |
---|
387 | bool flagOutputRecon; ///< Should the reconstructed cube be written to a FITS file? |
---|
388 | std::string fileOutputRecon; ///< The name of the reconstructed cube file |
---|
389 | bool flagOutputResid; ///< Should the residuals from the reconstruction be written to a FITS file? |
---|
390 | std::string fileOutputResid; ///< The name of the residual cube file |
---|
391 | bool flagVOT; ///< Should we save results in VOTable format? |
---|
392 | std::string votFile; ///< Where the VOTable goes. |
---|
393 | bool flagKarma; ///< Should we save results in Karma annotation format? |
---|
394 | std::string karmaFile; ///< Where the Karma annotation file goes. |
---|
395 | std::string annotationType; ///< Should the annoations be circles or borders? |
---|
396 | bool flagMaps; ///< Should we produce detection and moment maps in postscript form? |
---|
397 | std::string detectionMap; ///< The name of the detection map (postscript file). |
---|
398 | std::string momentMap; ///< The name of the 0th moment map (ps file). |
---|
399 | bool flagXOutput; ///< Should there be an xwindows output of the detection map? |
---|
400 | int precFlux; ///< The desired precision for flux values. |
---|
401 | int precVel; ///< The desired precision for velocity/frequency values. |
---|
402 | int precSNR; ///< The desired precision for the SNR values. |
---|
403 | |
---|
404 | // Cube related parameters |
---|
405 | bool flagNegative; ///< Are we going to search for negative features? |
---|
406 | bool flagBlankPix; ///< A flag that indicates whether there are pixels defined as BLANK and whether we need to remove & ignore them in processing. |
---|
407 | float blankPixValue; ///< Pixel value that is considered BLANK. |
---|
408 | int blankKeyword; ///< The FITS header keyword BLANK. |
---|
409 | float bscaleKeyword; ///< The FITS header keyword BSCALE. |
---|
410 | float bzeroKeyword; ///< The FITS header keyword BZERO. |
---|
411 | std::string newFluxUnits; ///< The user-requested flux units, to replace BUNIT. |
---|
412 | |
---|
413 | // Milky-Way parameters |
---|
414 | bool flagMW; ///< A flag that indicates whether to ignore the Milky Way channels. |
---|
415 | int maxMW; ///< Last Milky Way channel |
---|
416 | int minMW; ///< First Milky Way channel |
---|
417 | |
---|
418 | // Trim-related |
---|
419 | bool flagTrim; ///< Does the user want the cube trimmed? |
---|
420 | bool hasBeenTrimmed; ///< Has the cube been trimmed of excess BLANKs around the edge? |
---|
421 | long borderLeft; ///< The number of BLANK pixels trimmed from the left of the cube; |
---|
422 | long borderRight; ///< The number trimmed from the Right of the cube; |
---|
423 | long borderBottom; ///< The number trimmed from the Bottom of the cube; |
---|
424 | long borderTop; ///< The number trimmed from the Top of the cube; |
---|
425 | |
---|
426 | // Subsection offsets |
---|
427 | long *offsets; ///< The array of offsets for each FITS axis. |
---|
428 | long sizeOffsets; ///< The size of the offsets array. |
---|
429 | long xSubOffset; ///< The subsection's x-axis offset |
---|
430 | long ySubOffset; ///< The subsection's y-axis offset |
---|
431 | long zSubOffset; ///< The subsection's z-axis offset |
---|
432 | |
---|
433 | // Baseline related |
---|
434 | bool flagBaseline; ///< Whether to do baseline subtraction before reconstruction and/or searching. |
---|
435 | |
---|
436 | // Detection-related |
---|
437 | int minPix; ///< Minimum number of pixels for a detected object to be counted |
---|
438 | float numPixBeam; ///< Size (area) of the beam in pixels. |
---|
439 | bool flagUsingBeam; ///< If true, we are using the numPixBeam parameter, otherwise we use the value in the FITS header. |
---|
440 | |
---|
441 | // Object growth |
---|
442 | bool flagGrowth; ///< Are we growing objects once they are found? |
---|
443 | float growthCut; ///< The SNR that we are growing objects down to. |
---|
444 | bool flagUserGrowthThreshold; ///< Whether the user has manually defined a growth threshold |
---|
445 | float growthThreshold; ///< The threshold for growing objects down to |
---|
446 | |
---|
447 | // FDR analysis |
---|
448 | bool flagFDR; ///< Should the FDR method be used? |
---|
449 | float alphaFDR; ///< Alpha value for FDR detection algorithm |
---|
450 | int FDRnumCorChan; ///< Number of correlated channels, used in the FDR algorithm |
---|
451 | |
---|
452 | // Basic detection |
---|
453 | bool flagStatSec; ///< Whether we just want to use a subsection of the image to calculate the statistics. |
---|
454 | Section statSec; ///< The Section object storing the statistics subsection information. |
---|
455 | bool flagRobustStats; ///< Whether to use robust statistics. |
---|
456 | float snrCut; ///< How many sigma above mean is a detection when sigma-clipping |
---|
457 | float threshold; ///< What the threshold is (when sigma-clipping). |
---|
458 | bool flagUserThreshold;///< Whether the user has defined a threshold of their own. |
---|
459 | |
---|
460 | // Smoothing of the cube |
---|
461 | bool flagSmooth; ///< Should the cube be smoothed before searching? |
---|
462 | std::string smoothType; ///< The type of smoothing to be done. |
---|
463 | int hanningWidth; ///< Width for hanning smoothing. |
---|
464 | float kernMaj; ///< Semi-Major axis of gaussian smoothing kernel |
---|
465 | float kernMin; ///< Semi-Minor axis of gaussian smoothing kernel |
---|
466 | float kernPA; ///< Position angle of gaussian smoothing kernel, in degrees east of north (i.e. anticlockwise). |
---|
467 | |
---|
468 | // A trous reconstruction parameters |
---|
469 | bool flagATrous; ///< Are we using the a trous reconstruction? |
---|
470 | int reconDim; ///< How many dimensions to use for the reconstruction? |
---|
471 | int scaleMin; ///< Min scale used in a trous reconstruction |
---|
472 | int scaleMax; ///< Max scale used in a trous reconstruction |
---|
473 | float snrRecon; ///< SNR cutoff used in a trous reconstruction (only wavelet coefficients that survive this threshold are kept) |
---|
474 | Filter reconFilter; ///< The filter used for reconstructions. |
---|
475 | int filterCode; ///< The code number for the filter to be used (saves having to parse names) |
---|
476 | std::string filterName; ///< The code number converted into a name, for outputting purposes. |
---|
477 | |
---|
478 | // Volume-merging parameters |
---|
479 | bool flagAdjacent; ///< Whether to use the adjacent criterion for judging if objects are to be merged. |
---|
480 | float threshSpatial; ///< Maximum spatial separation between objects |
---|
481 | float threshVelocity; ///< Maximum channels separation between objects |
---|
482 | int minChannels; ///< Minimum no. of channels to make an object |
---|
483 | |
---|
484 | // Input-Output related |
---|
485 | std::string spectralMethod; ///< A string indicating choice of spectral plotting method: choices are "peak" (default) or "sum" |
---|
486 | std::string spectralUnits; ///< A string indicating what units the spectral axis should be quoted in. |
---|
487 | std::string pixelCentre;///< A string indicating which type of centre to give the results in: "average", "centroid", or "peak"(flux). |
---|
488 | std::string sortingParam; ///< A string indicating the parameter to sort the detection list on. |
---|
489 | bool borders; ///< Whether to draw a border around the individual pixels of a detection in the spectral display |
---|
490 | bool blankEdge; ///< Whether to draw a border around the BLANK pixel region in the moment maps and cutout images |
---|
491 | bool verbose; ///< Whether to use maximum verbosity -- use progress indicators in the reconstruction & merging steps. |
---|
492 | |
---|
493 | }; |
---|
494 | |
---|
495 | //=========================================================================== |
---|
496 | |
---|
497 | |
---|
498 | /// @brief Convert a string to lowercase. |
---|
499 | std::string makelower( std::string s ); |
---|
500 | |
---|
501 | } |
---|
502 | #endif |
---|