source: trunk/src/param.hh @ 730

Last change on this file since 730 was 730, checked in by MatthewWhiting, 14 years ago

Making the read-parameter functions more widely visible.

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