source: trunk/src/param.hh @ 1251

Last change on this file since 1251 was 1246, checked in by MatthewWhiting, 11 years ago

Ticket #193 - Removing all the MW-related code. Most of it was commented out, but Param now no longer has anything referring to MW. The flag array in ObjectGrower? has also changed to FLAG from MW.

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