source: tags/release-1.2.2/src/param.hh

Last change on this file was 1077, checked in by MatthewWhiting, 12 years ago

Enabling the output of DS9 region files in addition to the Karma annotation files. Also adding this to the verification script. Still to do documentation.

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