source: trunk/src/param.hh @ 818

Last change on this file since 818 was 818, checked in by MatthewWhiting, 13 years ago

A solution for #115. A new function is in Section that finds the intersection between two sections. This is used to update the statsec. Also found a bug in the copy constructor of Section (and fixed it!).

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