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