source: trunk/src/param.hh @ 1133

Last change on this file since 1133 was 1126, checked in by MatthewWhiting, 12 years ago

Enabling the output of CASA region files. These include a box (acting as a region), plus annotation lines and text in the same manner as the other annotation files. Annotations are currently not supported by casaviewer (even the new v4.0.0!!!), but the region boxes will get picked up.

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