source: trunk/src/param.hh @ 971

Last change on this file since 971 was 948, checked in by MatthewWhiting, 12 years ago

Second part of the solution for #146. The user can supply a spectral CTYPE and, optionally, a rest frequency, and the FITS file's ctype is translated accordingly. If the
user's rest frequency is used, it is written out with the parameter information (in both text and votable formats). A check is made to see whether the CTYPE provided is
valid.

File size: 28.2 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, int 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, long *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    bool   getFlagKarma(){return flagKarma;};
234    void   setFlagKarma(bool flag){flagKarma=flag;};
235    std::string getAnnotationType(){return annotationType;};
236    void   setAnnotationType(std::string s){annotationType=s;};
237    std::string getKarmaFile(){return karmaFile;};
238    void   setKarmaFile(std::string fname){karmaFile = fname;};
239    bool   getFlagMaps(){return flagMaps;};
240    void   setFlagMaps(bool flag){flagMaps=flag;};
241    std::string getDetectionMap(){return detectionMap;};
242    void   setDetectionMap(std::string fname){detectionMap = fname;};
243    std::string getMomentMap(){return momentMap;};
244    void   setMomentMap(std::string fname){momentMap = fname;};
245    bool   getFlagXOutput(){return flagXOutput;};
246    void   setFlagXOutput(bool b){flagXOutput=b;};
247    int    getPrecFlux(){return precFlux;};
248    void   setPrecFlux(int i){precFlux=i;};
249    int    getPrecVel(){return precVel;};
250    void   setPrecVel(int i){precVel=i;};
251    int    getPrecSNR(){return precSNR;};
252    void   setPrecSNR(int i){precSNR=i;};
253    //
254    bool   getFlagNegative(){return flagNegative;};
255    void   setFlagNegative(bool flag){flagNegative=flag;};
256    bool   getFlagBlankPix(){return flagBlankPix;};
257    void   setFlagBlankPix(bool flag){flagBlankPix=flag;};
258    float  getBlankPixVal(){return blankPixValue;};
259    void   setBlankPixVal(float v){blankPixValue=v;};
260    int    getBlankKeyword(){return blankKeyword;};
261    void   setBlankKeyword(int v){blankKeyword=v;};
262    float  getBscaleKeyword(){return bscaleKeyword;};
263    void   setBscaleKeyword(float v){bscaleKeyword=v;};
264    float  getBzeroKeyword(){return bzeroKeyword;};
265    void   setBzeroKeyword(float v){bzeroKeyword=v;};
266    bool   getFlagMW(){return flagMW;};
267    void   setFlagMW(bool flag){flagMW=flag;};
268    int    getMaxMW(){return maxMW - zSubOffset;};
269    void   setMaxMW(int m){maxMW=m;};
270    int    getMinMW(){return minMW - zSubOffset;};
271    void   setMinMW(int m){minMW=m;};
272    void   setBeamSize(float s){areaBeam = s;};
273    float  getBeamSize(){return areaBeam;};
274    void   setBeamFWHM(float s){fwhmBeam = s;};
275    float  getBeamFWHM(){return fwhmBeam;};
276    void   setBeamAsUsed(DuchampBeam &b){beamAsUsed = b;}; // just have the set function as we only want this for the operator<< function. Set from FitsHeader::itsBeam
277    std::string getNewFluxUnits(){return newFluxUnits;};
278    void   setNewFluxUnits(std::string s){newFluxUnits=s;};
279    std::string getSearchType(){return searchType;};
280    void   setSearchType(std::string s){searchType=s;};
281    //
282    bool   getFlagTrim(){return flagTrim;};
283    void   setFlagTrim(bool b){flagTrim=b;};
284    bool   getFlagCubeTrimmed(){return hasBeenTrimmed;};
285    void   setFlagCubeTrimmed(bool flag){hasBeenTrimmed = flag;};
286    size_t getBorderLeft(){return borderLeft;};
287    void   setBorderLeft(size_t b){borderLeft = b;};
288    size_t getBorderRight(){return borderRight;};
289    void   setBorderRight(size_t b){borderRight = b;};
290    size_t getBorderBottom(){return borderBottom;};
291    void   setBorderBottom(size_t b){borderBottom = b;};
292    size_t getBorderTop(){return borderTop;};
293    void   setBorderTop(size_t b){borderTop = b;};
294    //
295    long   getXOffset(){return xSubOffset;};
296    void   setXOffset(long o){xSubOffset = o;};
297    long   getYOffset(){return ySubOffset;};
298    void   setYOffset(long o){ySubOffset = o;};
299    long   getZOffset(){return zSubOffset;};
300    void   setZOffset(long o){zSubOffset = o;};
301    //
302    unsigned int   getMinPix(){return minPix;};
303    void   setMinPix(unsigned int m){minPix=m;};
304    //   
305    bool   getFlagGrowth(){return flagGrowth;};
306    void   setFlagGrowth(bool flag){flagGrowth=flag;};
307    float  getGrowthCut(){return growthCut;};
308    void   setGrowthCut(float c){growthCut=c;};
309    float  getGrowthThreshold(){return growthThreshold;};
310    void   setGrowthThreshold(float f){growthThreshold=f;};
311    bool   getFlagUserGrowthThreshold(){return flagUserGrowthThreshold;};
312    void   setFlagUserGrowthThreshold(bool b){flagUserGrowthThreshold=b;};
313    //   
314    bool   getFlagFDR(){return flagFDR;};
315    void   setFlagFDR(bool flag){flagFDR=flag;};
316    float  getAlpha(){return alphaFDR;};
317    void   setAlpha(float a){alphaFDR=a;};
318    int    getFDRnumCorChan(){return FDRnumCorChan;};
319    void   setFDRnumCorChan(int i){FDRnumCorChan=i;};
320    //
321    bool   getFlagBaseline(){return flagBaseline;};
322    void   setFlagBaseline(bool flag){flagBaseline = flag;};
323    //
324    bool   getFlagStatSec(){return flagStatSec;};
325    void   setFlagStatSec(bool flag){flagStatSec=flag;};
326    std::string getStatSec(){return statSec.getSection();};
327    void   setStatSec(std::string range){statSec.setSection(range);};
328    Section &statsec(){Section &rsection = statSec; return rsection;};
329    bool   getFlagRobustStats(){return flagRobustStats;};
330    void   setFlagRobustStats(bool flag){flagRobustStats=flag;};
331    float  getCut(){return snrCut;};
332    void   setCut(float c){snrCut=c;};
333    float  getThreshold(){return threshold;};
334    void   setThreshold(float f){threshold=f;};
335    bool   getFlagUserThreshold(){return flagUserThreshold;};
336    void   setFlagUserThreshold(bool b){flagUserThreshold=b;};
337    //   
338    bool   getFlagSmooth(){return flagSmooth;};
339    void   setFlagSmooth(bool b){flagSmooth=b;};
340    std::string getSmoothType(){return smoothType;};
341    void   setSmoothType(std::string s){smoothType=s;};
342    int    getHanningWidth(){return hanningWidth;};
343    void   setHanningWidth(int f){hanningWidth=f;};
344    void   setKernMaj(float f){kernMaj=f;};
345    float  getKernMaj(){return kernMaj;};
346    void   setKernMin(float f){kernMin=f;};
347    float  getKernMin(){return kernMin;};
348    void   setKernPA(float f){kernPA=f;};
349    float  getKernPA(){return kernPA;};
350    //   
351    bool   getFlagATrous(){return flagATrous;};
352    void   setFlagATrous(bool flag){flagATrous=flag;};
353    int    getReconDim(){return reconDim;};
354    void   setReconDim(int i){reconDim=i;};
355    unsigned int    getMinScale(){return scaleMin;};
356    void   setMinScale(int s){scaleMin=s;};
357    int    getMaxScale(){return scaleMax;};
358    void   setMaxScale(int s){scaleMax=s;};
359    float  getAtrousCut(){return snrRecon;};
360    void   setAtrousCut(float c){snrRecon=c;};
361    int    getFilterCode(){return filterCode;};
362    void   setFilterCode(int c){filterCode=c;};
363    std::string getFilterName(){return reconFilter.getName();};
364    Filter& filter(){ Filter &rfilter = reconFilter; return rfilter; };
365    //   
366    bool   getFlagAdjacent(){return flagAdjacent;};
367    void   setFlagAdjacent(bool flag){flagAdjacent=flag;};
368    float  getThreshS(){return threshSpatial;};
369    void   setThreshS(float t){threshSpatial=t;};
370    float  getThreshV(){return threshVelocity;};
371    void   setThreshV(float t){threshVelocity=t;};
372    unsigned int getMinChannels(){return minChannels;};
373    void   setMinChannels(unsigned int n){minChannels=n;};
374    unsigned int getMinVoxels(){return minVoxels;};
375    void   setMinVoxels(unsigned int n){minVoxels=n;};
376    bool   getFlagRejectBeforeMerge(){return flagRejectBeforeMerge;};
377    void   setFlagRejectBeforeMerge(bool flag){flagRejectBeforeMerge=flag;};
378    bool   getFlagTwoStageMerging(){return flagTwoStageMerging;};
379    void   setFlagTwoStageMerging(bool flag){flagTwoStageMerging=flag;};
380    //
381    std::string getSpectralMethod(){return spectralMethod;};
382    void   setSpectralMethod(std::string s){spectralMethod=s;};
383    std::string getSpectralType(){return spectralType;};
384    void   setSpectralType(std::string s){spectralType=s;};
385    float  getRestFrequency(){return restFrequency;};
386    void   setRestFrequency(float f){restFrequency=f;};
387    bool    getFlagRestFrequencyUsed(){return restFrequencyUsed;};
388    void    setFlagRestFrequencyUsed(bool b){restFrequencyUsed=b;};
389    std::string getSpectralUnits(){return spectralUnits;};
390    void   setSpectralUnits(std::string s){spectralUnits=s;};
391    std::string getPixelCentre(){return pixelCentre;};
392    void   setPixelCentre(std::string s){pixelCentre=s;};
393    std::string getSortingParam(){return sortingParam;};
394    void   setSortingParam(std::string s){sortingParam=s;};
395    bool   drawBorders(){return borders;};
396    void   setDrawBorders(bool f){borders=f;};
397    bool   drawBlankEdge(){return blankEdge;};
398    void   setDrawBlankEdge(bool f){blankEdge=f;};
399
400    /// @brief Are we in verbose mode?
401    bool   isVerbose(){return verbose;};
402    void   setVerbosity(bool f){verbose=f;};
403 
404  private:
405    // Input files
406    std::string imageFile;       ///< The image to be analysed.
407    bool        flagSubsection;  ///< Whether we just want a subsection of the image
408    Section pixelSec;            ///< The Section object storing the pixel subsection information.
409    bool        flagReconExists; ///< The reconstructed array is in a FITS file on disk.
410    std::string reconFile;       ///< The FITS file containing the reconstructed array.
411    bool        flagSmoothExists;///< The smoothed array is in a FITS file.
412    std::string smoothFile;      ///< The FITS file containing the smoothed array.
413
414    bool       usePrevious;      ///< Whether to read the detections from a previously-created log file
415    std::string objectList;      ///< List of objects to re-plot
416
417    // Output files
418    bool        flagLog;         ///< Should we do the intermediate logging?
419    std::string logFile;         ///< Where the intermediate logging goes.
420    std::string outFile;         ///< Where the final results get put.
421    bool        flagSeparateHeader;///< Should the header information(parameters & statistics) be written to a separate file to the table ofresults?
422    std::string headerFile;      ///< Where the header information to go with the results table should be written.
423    bool        flagPlotSpectra; ///< Should we plot the spectrum of each detection?
424    std::string spectraFile;     ///< Where the spectra are displayed
425    bool        flagTextSpectra; ///< Should a text file with all spectra be written?
426    std::string spectraTextFile; ///< Where the text spectra are written.
427    bool        flagOutputMomentMap;  ///< Should the moment map image be written to a FITS file?
428    std::string fileOutputMomentMap;  ///< The name of the moment map FITS file
429    bool        flagOutputMask;  ///< Should the mask image be written?
430    std::string fileOutputMask;  ///< The name of the mask image.
431    bool        flagMaskWithObjectNum;///< Should the mask values be labeled with the object ID (or just 1)?
432    bool        flagOutputSmooth;///< Should the smoothed cube be written?
433    std::string fileOutputSmooth;///< The name of the smoothed cube file
434    bool        flagOutputRecon; ///< Should the reconstructed cube be written to a FITS file?
435    std::string fileOutputRecon; ///< The name of the reconstructed cube file
436    bool        flagOutputResid; ///< Should the residuals from the reconstruction be written to a FITS file?
437    std::string fileOutputResid; ///< The name of the residual cube file
438    bool        flagVOT;         ///< Should we save results in VOTable format?
439    std::string votFile;         ///< Where the VOTable goes.
440    bool        flagKarma;       ///< Should we save results in Karma annotation format?
441    std::string karmaFile;       ///< Where the Karma annotation file goes.
442    std::string annotationType;  ///< Should the annoations be circles or borders?
443    bool        flagMaps;        ///< Should we produce detection and moment maps in postscript form?
444    std::string detectionMap;    ///< The name of the detection map (postscript file).
445    std::string momentMap;       ///< The name of the 0th moment map (ps file).
446    bool        flagXOutput;     ///< Should there be an xwindows output of the detection map?
447    int         precFlux;        ///< The desired precision for flux values.
448    int         precVel;         ///< The desired precision for velocity/frequency values.
449    int         precSNR;         ///< The desired precision for the SNR values.
450
451    // Cube related parameters
452    bool        flagNegative;    ///< Are we going to search for negative features?
453    bool        flagBlankPix;    ///< A flag that indicates whether there are pixels defined as BLANK and whether we need to remove & ignore them in processing.
454    float       blankPixValue;   ///< Pixel value that is considered BLANK.
455    int         blankKeyword;    ///< The FITS header keyword BLANK.
456    float       bscaleKeyword;   ///< The FITS header keyword BSCALE.
457    float       bzeroKeyword;    ///< The FITS header keyword BZERO.
458    std::string newFluxUnits;    ///< The user-requested flux units, to replace BUNIT.
459
460    // Milky-Way parameters
461    bool        flagMW;          ///< A flag that indicates whether to ignore the Milky Way channels.
462    int         maxMW;           ///< Last  Milky Way channel
463    int         minMW;           ///< First Milky Way channel
464
465    // Trim-related
466    bool        flagTrim;        ///< Does the user want the cube trimmed?
467    bool        hasBeenTrimmed;  ///< Has the cube been trimmed of excess BLANKs around the edge?
468    size_t      borderLeft;      ///< The number of BLANK pixels trimmed from the left of the cube;
469    size_t      borderRight;     ///< The number trimmed from the Right of the cube;
470    size_t      borderBottom;    ///< The number trimmed from the Bottom of the cube;
471    size_t      borderTop;       ///< The number trimmed from the Top of the cube;
472
473    // Subsection offsets
474    long       *offsets;         ///< The array of offsets for each FITS axis.
475    long        sizeOffsets;     ///< The size of the offsets array.
476    long        xSubOffset;      ///< The subsection's x-axis offset
477    long        ySubOffset;      ///< The subsection's y-axis offset
478    long        zSubOffset;      ///< The subsection's z-axis offset
479
480    // Baseline related
481    bool        flagBaseline;    ///< Whether to do baseline subtraction before reconstruction and/or searching.
482
483    // Detection-related
484    unsigned int minPix;         ///< Minimum number of pixels for a detected object to be counted
485    float       areaBeam;        ///< Size (area) of the beam in pixels.
486    float       fwhmBeam;        ///< FWHM of the beam in pixels.
487    DuchampBeam beamAsUsed;      ///< A copy of the beam as used in FitsHeader - only used here for output
488    std::string searchType;      ///< How to do the search: by channel map or by spectrum
489
490    // Object growth
491    bool        flagGrowth;      ///< Are we growing objects once they are found?
492    float       growthCut;       ///< The SNR that we are growing objects down to.
493    bool        flagUserGrowthThreshold; ///< Whether the user has manually defined a growth threshold
494    float       growthThreshold; ///< The threshold for growing objects down to
495
496    // FDR analysis
497    bool        flagFDR;         ///< Should the FDR method be used?
498    float       alphaFDR;        ///< Alpha value for FDR detection algorithm
499    int         FDRnumCorChan;   ///< Number of correlated channels, used in the FDR algorithm
500
501    // Basic detection
502    bool        flagStatSec;     ///< Whether we just want to use a subsection of the image to calculate the statistics.
503    Section     statSec;         ///< The Section object storing the statistics subsection information.
504    bool        flagRobustStats; ///< Whether to use robust statistics.
505    float       snrCut;          ///< How many sigma above mean is a detection when sigma-clipping
506    float       threshold;       ///< What the threshold is (when sigma-clipping).
507    bool        flagUserThreshold;///< Whether the user has defined a threshold of their own.
508
509    // Smoothing of the cube
510    bool        flagSmooth;      ///< Should the cube be smoothed before searching?
511    std::string smoothType;      ///< The type of smoothing to be done.
512    int         hanningWidth;    ///< Width for hanning smoothing.
513    float       kernMaj;         ///< Semi-Major axis of gaussian smoothing kernel
514    float       kernMin;         ///< Semi-Minor axis of gaussian smoothing kernel
515    float       kernPA;          ///< Position angle of gaussian smoothing kernel, in degrees east of north (i.e. anticlockwise).
516
517    // A trous reconstruction parameters
518    bool   flagATrous;      ///< Are we using the a trous reconstruction?
519    int    reconDim;        ///< How many dimensions to use for the reconstruction?
520    unsigned int    scaleMin;        ///< Min scale used in a trous reconstruction
521    int    scaleMax;        ///< Max scale used in a trous reconstruction
522    float  snrRecon;        ///< SNR cutoff used in a trous reconstruction (only wavelet coefficients that survive this threshold are kept)
523    Filter reconFilter;     ///< The filter used for reconstructions.
524    int    filterCode;      ///< The code number for the filter to be used (saves having to parse names)
525
526    // Volume-merging parameters
527    bool   flagAdjacent;    ///< Whether to use the adjacent criterion for judging if objects are to be merged.
528    float  threshSpatial;   ///< Maximum spatial separation between objects
529    float  threshVelocity;  ///< Maximum channels separation between objects
530    unsigned int minChannels;     ///< Minimum no. of channels to make an object
531    unsigned int minVoxels;       ///< Minimum no. of voxels required in an object
532    bool   flagRejectBeforeMerge; ///< Whether to reject sources before merging
533    bool   flagTwoStageMerging;  ///< Whether to do a partial merge when the objects are found, via the mergeIntoList function.
534
535    // Input-Output related
536    std::string spectralMethod; ///< A string indicating choice of spectral plotting method: choices are "peak" (default) or "sum"
537    std::string spectralType;   ///< The requested CTYPE that the spectral axis be converted to
538    float  restFrequency;       ///< The rest frequency that should be used when converting - overrides that in the FITS file
539    bool   restFrequencyUsed;   ///< A flag indicating whether the spectral type has been converted from that in the FITS file
540    std::string spectralUnits;  ///< A string indicating what units the spectral axis should be quoted in.
541    std::string pixelCentre;    ///< A string indicating which type of centre to give the results in: "average", "centroid", or "peak"(flux).
542    std::string sortingParam;   ///< A string indicating the parameter to sort the detection list on.
543    bool   borders;             ///< Whether to draw a border around the individual pixels of a detection in the spectral display
544    bool   blankEdge;           ///< Whether to draw a border around the BLANK pixel region in the moment maps and cutout images
545    bool   verbose;             ///< Whether to use maximum verbosity -- use progress indicators in the reconstruction & merging steps.
546
547  };
548
549  //===========================================================================
550
551
552}
553#endif
Note: See TracBrowser for help on using the repository browser.