source: trunk/src/param.hh @ 913

Last change on this file since 913 was 910, checked in by MatthewWhiting, 12 years ago

A new Param function checkImageExists, to do the checking properly and raise an exception if it doesn't. (Previously all we got was a warning!)

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