source: trunk/src/param.hh @ 822

Last change on this file since 822 was 822, checked in by MatthewWhiting, 13 years ago

Extra interfaces to the parseSubsections function

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