source: trunk/src/param.hh @ 1144

Last change on this file since 1144 was 1142, checked in by MatthewWhiting, 11 years ago

Ticket #131: Enabling the writing of the moment-0 mask image, with updated documentation. Also removing the code that wrote the BLANK/BSCALE etc parameters to integer FITS files - the only integer files we write are the mask ones which don't need them.

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