[3] | 1 | #include <iostream> |
---|
| 2 | #include <iomanip> |
---|
| 3 | #include <fstream> |
---|
| 4 | #include <sstream> |
---|
| 5 | #include <string> |
---|
| 6 | #include <math.h> |
---|
[103] | 7 | #include <wcs.h> |
---|
| 8 | #include <wcsunits.h> |
---|
[3] | 9 | #include <param.hh> |
---|
[134] | 10 | #include <config.h> |
---|
[142] | 11 | #include <duchamp.hh> |
---|
[103] | 12 | #include <Utils/utils.hh> |
---|
[3] | 13 | |
---|
[194] | 14 | // Define funtion to print bools as words, in case the compiler doesn't |
---|
| 15 | // recognise the setf(ios::boolalpha) command... |
---|
[110] | 16 | #ifdef HAVE_STDBOOL_H |
---|
| 17 | string stringize(bool b){ |
---|
| 18 | std::stringstream ss; |
---|
| 19 | ss.setf(std::ios::boolalpha); |
---|
| 20 | ss << b; |
---|
| 21 | return ss.str(); |
---|
| 22 | } |
---|
| 23 | #else |
---|
| 24 | string stringize(bool b){ |
---|
| 25 | std::string output; |
---|
| 26 | if(b) output="true"; |
---|
| 27 | else output="false"; |
---|
| 28 | return output; |
---|
| 29 | } |
---|
| 30 | #endif |
---|
| 31 | |
---|
[3] | 32 | using std::setw; |
---|
| 33 | using std::endl; |
---|
| 34 | |
---|
| 35 | /****************************************************************/ |
---|
| 36 | /////////////////////////////////////////////////// |
---|
[103] | 37 | //// Functions for FitsHeader class: |
---|
| 38 | /////////////////////////////////////////////////// |
---|
| 39 | |
---|
| 40 | FitsHeader::FitsHeader(){ |
---|
| 41 | this->wcs = new wcsprm; |
---|
| 42 | this->wcs->flag=-1; |
---|
| 43 | wcsini(true,3,this->wcs); |
---|
| 44 | this->wcsIsGood = false; |
---|
| 45 | this->nwcs = 0; |
---|
| 46 | this->scale=1.; |
---|
| 47 | this->offset=0.; |
---|
| 48 | this->power=1.; |
---|
| 49 | this->fluxUnits="counts"; |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | FitsHeader::FitsHeader(const FitsHeader& h){ |
---|
| 53 | this->wcs = new wcsprm; |
---|
| 54 | this->wcs->flag=-1; |
---|
| 55 | wcsini(true,h.wcs->naxis,this->wcs); |
---|
| 56 | wcscopy(true,h.wcs,this->wcs); |
---|
| 57 | wcsset(this->wcs); |
---|
[137] | 58 | this->nwcs = h.nwcs; |
---|
| 59 | this->wcsIsGood = h.wcsIsGood; |
---|
| 60 | this->spectralUnits = h.spectralUnits; |
---|
| 61 | this->fluxUnits = h.fluxUnits; |
---|
| 62 | this->intFluxUnits = h.intFluxUnits; |
---|
| 63 | this->beamSize = h.beamSize; |
---|
| 64 | this->bmajKeyword = h.bmajKeyword; |
---|
| 65 | this->bminKeyword = h.bminKeyword; |
---|
| 66 | this->blankKeyword = h.blankKeyword; |
---|
| 67 | this->bzeroKeyword = h.bzeroKeyword; |
---|
| 68 | this->bscaleKeyword = h.bscaleKeyword; |
---|
| 69 | this->scale = h.scale; |
---|
| 70 | this->offset = h.offset; |
---|
| 71 | this->power = h.power; |
---|
[103] | 72 | } |
---|
| 73 | |
---|
| 74 | FitsHeader& FitsHeader::operator= (const FitsHeader& h){ |
---|
| 75 | this->wcs = new wcsprm; |
---|
| 76 | this->wcs->flag=-1; |
---|
| 77 | wcsini(true,h.wcs->naxis,this->wcs); |
---|
| 78 | wcscopy(true,h.wcs,this->wcs); |
---|
| 79 | wcsset(this->wcs); |
---|
[137] | 80 | this->nwcs = h.nwcs; |
---|
| 81 | this->wcsIsGood = h.wcsIsGood; |
---|
| 82 | this->spectralUnits = h.spectralUnits; |
---|
| 83 | this->fluxUnits = h.fluxUnits; |
---|
| 84 | this->intFluxUnits = h.intFluxUnits; |
---|
| 85 | this->beamSize = h.beamSize; |
---|
| 86 | this->bmajKeyword = h.bmajKeyword; |
---|
| 87 | this->bminKeyword = h.bminKeyword; |
---|
| 88 | this->blankKeyword = h.blankKeyword; |
---|
| 89 | this->bzeroKeyword = h.bzeroKeyword; |
---|
| 90 | this->bscaleKeyword = h.bscaleKeyword; |
---|
| 91 | this->scale = h.scale; |
---|
| 92 | this->offset = h.offset; |
---|
| 93 | this->power = h.power; |
---|
[103] | 94 | } |
---|
| 95 | |
---|
| 96 | void FitsHeader::setWCS(wcsprm *w) |
---|
| 97 | { |
---|
| 98 | /** |
---|
| 99 | * FitsHeader::setWCS(wcsprm *) |
---|
| 100 | * A function that assigns the wcs parameters, and runs |
---|
| 101 | * wcsset to set it up correctly. |
---|
| 102 | * Performs a check to see if the WCS is good (by looking at |
---|
| 103 | * the lng and lat wcsprm parameters), and sets the wcsIsGood |
---|
| 104 | * flag accordingly. |
---|
| 105 | */ |
---|
| 106 | wcscopy(true,w,this->wcs); |
---|
| 107 | wcsset(this->wcs); |
---|
| 108 | if( (w->lng!=-1) && (w->lat!=-1) ) this->wcsIsGood = true; |
---|
| 109 | } |
---|
| 110 | |
---|
| 111 | wcsprm *FitsHeader::getWCS() |
---|
| 112 | { |
---|
| 113 | /** |
---|
| 114 | * FitsHeader::getWCS() |
---|
| 115 | * A function that returns a wcsprm object corresponding to the WCS. |
---|
| 116 | */ |
---|
| 117 | wcsprm *wNew = new wcsprm; |
---|
| 118 | wNew->flag=-1; |
---|
| 119 | wcsini(true,this->wcs->naxis,wNew); |
---|
| 120 | wcscopy(true,this->wcs,wNew); |
---|
| 121 | wcsset(wNew); |
---|
| 122 | return wNew; |
---|
| 123 | } |
---|
| 124 | |
---|
| 125 | int FitsHeader::wcsToPix(const double *world, double *pix){ |
---|
| 126 | return wcsToPixSingle(this->wcs,world,pix);} |
---|
| 127 | int FitsHeader::wcsToPix(const double *world, double *pix, const int npts){ |
---|
| 128 | return wcsToPixMulti(this->wcs,world,pix,npts);} |
---|
| 129 | int FitsHeader::pixToWCS(const double *pix, double *world){ |
---|
| 130 | return pixToWCSSingle(this->wcs,pix,world);} |
---|
| 131 | int FitsHeader::pixToWCS(const double *pix, double *world, const int npts){ |
---|
| 132 | return pixToWCSMulti(this->wcs,pix,world,npts);} |
---|
| 133 | |
---|
| 134 | double FitsHeader::pixToVel(double &x, double &y, double &z) |
---|
| 135 | { |
---|
[186] | 136 | double vel; |
---|
| 137 | if(this->wcsIsGood){ |
---|
| 138 | double *pix = new double[3]; |
---|
| 139 | double *world = new double[3]; |
---|
| 140 | pix[0] = x; pix[1] = y; pix[2] = z; |
---|
| 141 | pixToWCSSingle(this->wcs,pix,world); |
---|
| 142 | vel = this->specToVel(world[2]); |
---|
| 143 | delete [] pix; |
---|
| 144 | delete [] world; |
---|
| 145 | } |
---|
| 146 | else vel = z; |
---|
[103] | 147 | return vel; |
---|
| 148 | } |
---|
| 149 | |
---|
| 150 | double* FitsHeader::pixToVel(double &x, double &y, double *zarray, int size) |
---|
| 151 | { |
---|
[186] | 152 | double *newzarray = new double[size]; |
---|
| 153 | if(this->wcsIsGood){ |
---|
| 154 | double *pix = new double[size*3]; |
---|
| 155 | for(int i=0;i<size;i++){ |
---|
[187] | 156 | pix[3*i] = x; |
---|
| 157 | pix[3*i+1] = y; |
---|
| 158 | pix[3*i+2] = zarray[i]; |
---|
[186] | 159 | } |
---|
| 160 | double *world = new double[size*3]; |
---|
| 161 | pixToWCSMulti(this->wcs,pix,world,size); |
---|
| 162 | delete [] pix; |
---|
| 163 | for(int i=0;i<size;i++) newzarray[i] = this->specToVel(world[3*i+2]); |
---|
| 164 | delete [] world; |
---|
[103] | 165 | } |
---|
[186] | 166 | else{ |
---|
| 167 | for(int i=0;i<size;i++) newzarray[i] = zarray[i]; |
---|
| 168 | } |
---|
[103] | 169 | return newzarray; |
---|
| 170 | } |
---|
| 171 | |
---|
| 172 | double FitsHeader::specToVel(const double &coord) |
---|
| 173 | { |
---|
| 174 | double vel; |
---|
[139] | 175 | if(power==1.0) vel = coord*this->scale + this->offset; |
---|
[103] | 176 | else vel = pow( (coord*this->scale + this->offset), this->power); |
---|
| 177 | return vel; |
---|
| 178 | } |
---|
| 179 | |
---|
| 180 | double FitsHeader::velToSpec(const float &velocity) |
---|
| 181 | { |
---|
| 182 | // return velToCoord(this->wcs,velocity,this->spectralUnits);}; |
---|
| 183 | return (pow(velocity, 1./this->power) - this->offset) / this->scale;} |
---|
| 184 | |
---|
| 185 | string FitsHeader::getIAUName(double ra, double dec) |
---|
| 186 | { |
---|
| 187 | if(strcmp(this->wcs->lngtyp,"RA")==0) return getIAUNameEQ(ra, dec, this->wcs->equinox); |
---|
| 188 | else return getIAUNameGAL(ra, dec); |
---|
| 189 | } |
---|
| 190 | |
---|
| 191 | void FitsHeader::fixUnits(Param &par) |
---|
| 192 | { |
---|
| 193 | // define spectral units from the param set |
---|
| 194 | this->spectralUnits = par.getSpectralUnits(); |
---|
| 195 | |
---|
| 196 | double sc=1.; |
---|
| 197 | double of=0.; |
---|
| 198 | double po=1.;; |
---|
| 199 | if(this->wcsIsGood){ |
---|
[160] | 200 | int flag = wcsunits( this->wcs->cunit[wcs->spec], |
---|
| 201 | this->spectralUnits.c_str(), |
---|
[142] | 202 | &sc, &of, &po); |
---|
[103] | 203 | if(flag>0){ |
---|
[120] | 204 | std::stringstream errmsg; |
---|
[142] | 205 | errmsg << "WCSUNITS Error, Code = " << flag |
---|
| 206 | << ": "<< wcsunits_errmsg[flag]; |
---|
| 207 | if(flag==10) errmsg << "\nTried to get conversion from '" |
---|
[160] | 208 | << wcs->cunit[wcs->spec] << "' to '" |
---|
[142] | 209 | << this->spectralUnits.c_str() << "'\n"; |
---|
[160] | 210 | this->spectralUnits = this->wcs->cunit[wcs->spec]; |
---|
[103] | 211 | if(this->spectralUnits==""){ |
---|
[120] | 212 | errmsg << "Setting coordinates to 'XX' for clarity.\n"; |
---|
[103] | 213 | this->spectralUnits = "XX"; |
---|
| 214 | } |
---|
[120] | 215 | duchampError("fixUnits", errmsg.str()); |
---|
| 216 | |
---|
[103] | 217 | } |
---|
| 218 | } |
---|
| 219 | this->scale = sc; |
---|
| 220 | this->offset= of; |
---|
| 221 | this->power = po; |
---|
| 222 | |
---|
[142] | 223 | // Work out the integrated flux units, based on the spectral units. |
---|
| 224 | // If flux is per beam, trim the /beam from the flux units and multiply |
---|
| 225 | // by the spectral units. |
---|
| 226 | // Otherwise, just muliply by the spectral units. |
---|
[103] | 227 | if(this->fluxUnits.size()>0){ |
---|
[142] | 228 | if(this->fluxUnits.substr(this->fluxUnits.size()-5, |
---|
| 229 | this->fluxUnits.size() ) == "/beam"){ |
---|
[103] | 230 | this->intFluxUnits = this->fluxUnits.substr(0,this->fluxUnits.size()-5) |
---|
| 231 | +" " +this->spectralUnits; |
---|
| 232 | } |
---|
[159] | 233 | else this->intFluxUnits = this->fluxUnits + " " + this->spectralUnits; |
---|
[103] | 234 | } |
---|
| 235 | |
---|
| 236 | } |
---|
| 237 | |
---|
| 238 | /****************************************************************/ |
---|
| 239 | /////////////////////////////////////////////////// |
---|
[3] | 240 | //// Accessor Functions for Parameter class: |
---|
| 241 | /////////////////////////////////////////////////// |
---|
| 242 | Param::Param(){ |
---|
| 243 | /** |
---|
| 244 | * Param() |
---|
| 245 | * Default intial values for the parameters. |
---|
| 246 | * imageFile has no default value! |
---|
| 247 | */ |
---|
| 248 | // Input files |
---|
[190] | 249 | this->imageFile = ""; |
---|
| 250 | this->flagSubsection = false; |
---|
| 251 | this->subsection = "[*,*,*]"; |
---|
| 252 | this->flagReconExists = false; |
---|
| 253 | this->reconFile = ""; |
---|
[3] | 254 | // Output files |
---|
[190] | 255 | this->flagLog = true; |
---|
| 256 | this->logFile = "duchamp-Logfile.txt"; |
---|
| 257 | this->outFile = "duchamp-Results.txt"; |
---|
| 258 | this->spectraFile = "duchamp-Spectra.ps"; |
---|
| 259 | this->flagOutputRecon = false; |
---|
| 260 | this->flagOutputResid = false; |
---|
| 261 | this->flagVOT = false; |
---|
| 262 | this->votFile = "duchamp-Results.xml"; |
---|
| 263 | this->flagKarma = false; |
---|
| 264 | this->karmaFile = "duchamp-Results.ann"; |
---|
| 265 | this->flagMaps = true; |
---|
| 266 | this->detectionMap = "duchamp-DetectionMap.ps"; |
---|
| 267 | this->momentMap = "duchamp-MomentMap.ps"; |
---|
[195] | 268 | this->flagXOutput = true; |
---|
[3] | 269 | // Cube related parameters |
---|
[190] | 270 | this->flagBlankPix = true; |
---|
| 271 | this->blankPixValue = -8.00061; |
---|
| 272 | this->blankKeyword = 1; |
---|
| 273 | this->bscaleKeyword = -8.00061; |
---|
| 274 | this->bzeroKeyword = 0.; |
---|
| 275 | this->flagUsingBlank = false; |
---|
| 276 | this->flagMW = false; |
---|
| 277 | this->maxMW = 112; |
---|
| 278 | this->minMW = 75; |
---|
| 279 | this->numPixBeam = 10.; |
---|
| 280 | this->flagUsingBeam = false; |
---|
[3] | 281 | // Trim-related |
---|
[190] | 282 | this->flagTrimmed = false; |
---|
| 283 | this->borderLeft = 0; |
---|
| 284 | this->borderRight = 0; |
---|
| 285 | this->borderBottom = 0; |
---|
| 286 | this->borderTop = 0; |
---|
[3] | 287 | // Subsection offsets |
---|
[190] | 288 | this->xSubOffset = 0; |
---|
| 289 | this->ySubOffset = 0; |
---|
| 290 | this->zSubOffset = 0; |
---|
[3] | 291 | // Baseline related |
---|
[190] | 292 | this->flagBaseline = false; |
---|
[3] | 293 | // Detection-related |
---|
[190] | 294 | this->flagNegative = false; |
---|
[3] | 295 | // Object growth |
---|
[190] | 296 | this->flagGrowth = false; |
---|
| 297 | this->growthCut = 2.; |
---|
[3] | 298 | // FDR analysis |
---|
[190] | 299 | this->flagFDR = false; |
---|
| 300 | this->alphaFDR = 0.01; |
---|
[3] | 301 | // Other detection |
---|
[190] | 302 | this->snrCut = 3.; |
---|
| 303 | this->threshold = 0.; |
---|
| 304 | this->flagUserThreshold = false; |
---|
[3] | 305 | // A trous reconstruction parameters |
---|
[190] | 306 | this->flagATrous = true; |
---|
| 307 | this->reconDim = 3; |
---|
| 308 | this->scaleMin = 1; |
---|
| 309 | this->snrRecon = 4.; |
---|
| 310 | this->filterCode = 1; |
---|
[3] | 311 | // Volume-merging parameters |
---|
[190] | 312 | this->flagAdjacent = true; |
---|
| 313 | this->threshSpatial = 3.; |
---|
| 314 | this->threshVelocity = 7.; |
---|
| 315 | this->minChannels = 3; |
---|
| 316 | this->minPix = 2; |
---|
[3] | 317 | // Input-Output related |
---|
[190] | 318 | this->spectralMethod = "peak"; |
---|
| 319 | this->borders = true; |
---|
| 320 | this->blankEdge = true; |
---|
| 321 | this->verbose = true; |
---|
| 322 | this->spectralUnits = "km/s"; |
---|
[3] | 323 | }; |
---|
| 324 | |
---|
[137] | 325 | Param& Param::operator= (const Param& p) |
---|
| 326 | { |
---|
[190] | 327 | this->imageFile = p.imageFile; |
---|
| 328 | this->flagSubsection = p.flagSubsection; |
---|
| 329 | this->subsection = p.subsection; |
---|
| 330 | this->flagReconExists = p.flagReconExists; |
---|
| 331 | this->reconFile = p.reconFile; |
---|
| 332 | this->flagLog = p.flagLog; |
---|
| 333 | this->logFile = p.logFile; |
---|
| 334 | this->outFile = p.outFile; |
---|
| 335 | this->spectraFile = p.spectraFile; |
---|
| 336 | this->flagOutputRecon = p.flagOutputRecon; |
---|
| 337 | this->flagOutputResid = p.flagOutputResid; |
---|
| 338 | this->flagVOT = p.flagVOT; |
---|
| 339 | this->votFile = p.votFile; |
---|
| 340 | this->flagKarma = p.flagKarma; |
---|
| 341 | this->karmaFile = p.karmaFile; |
---|
| 342 | this->flagMaps = p.flagMaps; |
---|
| 343 | this->detectionMap = p.detectionMap; |
---|
| 344 | this->momentMap = p.momentMap; |
---|
[195] | 345 | this->flagXOutput = p.flagXOutput; |
---|
[190] | 346 | this->flagBlankPix = p.flagBlankPix; |
---|
| 347 | this->blankPixValue = p.blankPixValue; |
---|
| 348 | this->blankKeyword = p.blankKeyword; |
---|
| 349 | this->bscaleKeyword = p.bscaleKeyword; |
---|
| 350 | this->bzeroKeyword = p.bzeroKeyword; |
---|
| 351 | this->flagUsingBlank = p.flagUsingBlank; |
---|
| 352 | this->flagMW = p.flagMW; |
---|
| 353 | this->maxMW = p.maxMW; |
---|
| 354 | this->minMW = p.minMW; |
---|
| 355 | this->numPixBeam = p.numPixBeam; |
---|
| 356 | this->flagTrimmed = p.flagTrimmed; |
---|
| 357 | this->borderLeft = p.borderLeft; |
---|
| 358 | this->borderRight = p.borderRight; |
---|
| 359 | this->borderBottom = p.borderBottom; |
---|
| 360 | this->borderTop = p.borderTop; |
---|
| 361 | this->xSubOffset = p.xSubOffset; |
---|
| 362 | this->ySubOffset = p.ySubOffset; |
---|
| 363 | this->zSubOffset = p.zSubOffset; |
---|
| 364 | this->flagBaseline = p.flagBaseline; |
---|
| 365 | this->flagNegative = p.flagNegative; |
---|
| 366 | this->flagGrowth = p.flagGrowth; |
---|
| 367 | this->growthCut = p.growthCut; |
---|
| 368 | this->flagFDR = p.flagFDR; |
---|
| 369 | this->alphaFDR = p.alphaFDR; |
---|
| 370 | this->snrCut = p.snrCut; |
---|
| 371 | this->threshold = p.threshold; |
---|
| 372 | this->flagUserThreshold = p.threshold; |
---|
| 373 | this->flagATrous = p.flagATrous; |
---|
| 374 | this->reconDim = p.reconDim; |
---|
| 375 | this->scaleMin = p.scaleMin; |
---|
| 376 | this->snrRecon = p.snrRecon; |
---|
| 377 | this->filterCode = p.filterCode; |
---|
| 378 | this->flagAdjacent = p.flagAdjacent; |
---|
| 379 | this->threshSpatial = p.threshSpatial; |
---|
| 380 | this->threshVelocity = p.threshVelocity; |
---|
| 381 | this->minChannels = p.minChannels; |
---|
| 382 | this->minPix = p.minPix; |
---|
| 383 | this->spectralMethod = p.spectralMethod; |
---|
| 384 | this->borders = p.borders; |
---|
| 385 | this->verbose = p.verbose; |
---|
| 386 | this->spectralUnits = p.spectralUnits; |
---|
[137] | 387 | } |
---|
| 388 | |
---|
[3] | 389 | /****************************************************************/ |
---|
| 390 | /////////////////////////////////////////////////// |
---|
| 391 | //// Other Functions using the Parameter class: |
---|
| 392 | /////////////////////////////////////////////////// |
---|
| 393 | |
---|
[163] | 394 | inline string makelower( string s ) |
---|
[3] | 395 | { |
---|
| 396 | // "borrowed" from Matt Howlett's 'fred' |
---|
| 397 | string out = ""; |
---|
| 398 | for( int i=0; i<s.size(); ++i ) { |
---|
| 399 | out += tolower(s[i]); |
---|
| 400 | } |
---|
| 401 | return out; |
---|
| 402 | } |
---|
| 403 | |
---|
[163] | 404 | inline bool boolify( string s ) |
---|
[132] | 405 | { |
---|
| 406 | /** |
---|
[133] | 407 | * bool boolify(string) |
---|
[132] | 408 | * Convert a string to a bool variable |
---|
| 409 | * "1" and "true" get converted to true |
---|
| 410 | * "0" and "false" (and anything else) get converted to false |
---|
| 411 | */ |
---|
| 412 | if((s=="1") || (makelower(s)=="true")) return true; |
---|
| 413 | else if((s=="0") || (makelower(s)=="false")) return false; |
---|
| 414 | else return false; |
---|
| 415 | } |
---|
| 416 | |
---|
[163] | 417 | inline string readSval(std::stringstream& ss) |
---|
| 418 | { |
---|
| 419 | string val; ss >> val; return val; |
---|
| 420 | } |
---|
| 421 | |
---|
| 422 | inline bool readFlag(std::stringstream& ss) |
---|
| 423 | { |
---|
| 424 | string val; ss >> val; return boolify(val); |
---|
| 425 | } |
---|
| 426 | |
---|
| 427 | inline float readFval(std::stringstream& ss) |
---|
| 428 | { |
---|
| 429 | float val; ss >> val; return val; |
---|
| 430 | } |
---|
| 431 | |
---|
| 432 | inline int readIval(std::stringstream& ss) |
---|
| 433 | { |
---|
| 434 | int val; ss >> val; return val; |
---|
| 435 | } |
---|
| 436 | |
---|
[160] | 437 | int Param::readParams(string paramfile) |
---|
[3] | 438 | { |
---|
| 439 | |
---|
| 440 | std::ifstream fin(paramfile.c_str()); |
---|
[160] | 441 | if(!fin.is_open()) return FAILURE; |
---|
[3] | 442 | string line; |
---|
| 443 | while( !std::getline(fin,line,'\n').eof()){ |
---|
| 444 | |
---|
| 445 | if(line[0]!='#'){ |
---|
| 446 | std::stringstream ss; |
---|
| 447 | ss.str(line); |
---|
| 448 | string arg; |
---|
[163] | 449 | ss >> arg; |
---|
| 450 | arg = makelower(arg); |
---|
| 451 | if(arg=="imagefile") this->imageFile = readSval(ss); |
---|
| 452 | if(arg=="flagsubsection") this->flagSubsection = readFlag(ss); |
---|
| 453 | if(arg=="subsection") this->subsection = readSval(ss); |
---|
| 454 | if(arg=="flagreconexists") this->flagReconExists = readFlag(ss); |
---|
| 455 | if(arg=="reconfile") this->reconFile = readSval(ss); |
---|
[71] | 456 | |
---|
[163] | 457 | if(arg=="flaglog") this->flagLog = readFlag(ss); |
---|
| 458 | if(arg=="logfile") this->logFile = readSval(ss); |
---|
| 459 | if(arg=="outfile") this->outFile = readSval(ss); |
---|
| 460 | if(arg=="spectrafile") this->spectraFile = readSval(ss); |
---|
| 461 | if(arg=="flagoutputrecon") this->flagOutputRecon = readFlag(ss); |
---|
| 462 | if(arg=="flagoutputresid") this->flagOutputResid = readFlag(ss); |
---|
| 463 | if(arg=="flagvot") this->flagVOT = readFlag(ss); |
---|
| 464 | if(arg=="votfile") this->votFile = readSval(ss); |
---|
| 465 | if(arg=="flagkarma") this->flagKarma = readFlag(ss); |
---|
| 466 | if(arg=="karmafile") this->karmaFile = readSval(ss); |
---|
| 467 | if(arg=="flagmaps") this->flagMaps = readFlag(ss); |
---|
| 468 | if(arg=="detectionmap") this->detectionMap = readSval(ss); |
---|
| 469 | if(arg=="momentmap") this->momentMap = readSval(ss); |
---|
[195] | 470 | if(arg=="flagxoutput") this->flagXOutput = readFlag(ss); |
---|
[3] | 471 | |
---|
[163] | 472 | if(arg=="flagnegative") this->flagNegative = readFlag(ss); |
---|
| 473 | if(arg=="flagblankpix") this->flagBlankPix = readFlag(ss); |
---|
| 474 | if(arg=="blankpixvalue") this->blankPixValue = readFval(ss); |
---|
| 475 | if(arg=="flagmw") this->flagMW = readFlag(ss); |
---|
| 476 | if(arg=="maxmw") this->maxMW = readIval(ss); |
---|
| 477 | if(arg=="minmw") this->minMW = readIval(ss); |
---|
| 478 | if(arg=="beamsize") this->numPixBeam = readFval(ss); |
---|
[71] | 479 | |
---|
[163] | 480 | if(arg=="flagbaseline") this->flagBaseline = readFlag(ss); |
---|
| 481 | if(arg=="minpix") this->minPix = readIval(ss); |
---|
| 482 | if(arg=="flaggrowth") this->flagGrowth = readFlag(ss); |
---|
| 483 | if(arg=="growthcut") this->growthCut = readFval(ss); |
---|
[71] | 484 | |
---|
[163] | 485 | if(arg=="flagfdr") this->flagFDR = readFlag(ss); |
---|
| 486 | if(arg=="alphafdr") this->alphaFDR = readFval(ss); |
---|
[103] | 487 | |
---|
[163] | 488 | if(arg=="snrcut") this->snrCut = readFval(ss); |
---|
[190] | 489 | if(arg=="threshold"){ |
---|
| 490 | this->threshold = readFval(ss); |
---|
| 491 | this->flagUserThreshold = true; |
---|
| 492 | } |
---|
[103] | 493 | |
---|
[163] | 494 | if(arg=="flagatrous") this->flagATrous = readFlag(ss); |
---|
| 495 | if(arg=="recondim") this->reconDim = readIval(ss); |
---|
| 496 | if(arg=="scalemin") this->scaleMin = readIval(ss); |
---|
| 497 | if(arg=="snrrecon") this->snrRecon = readFval(ss); |
---|
| 498 | if(arg=="filtercode") this->filterCode = readIval(ss); |
---|
[71] | 499 | |
---|
[163] | 500 | if(arg=="flagadjacent") this->flagAdjacent = readFlag(ss); |
---|
| 501 | if(arg=="threshspatial") this->threshSpatial = readFval(ss); |
---|
| 502 | if(arg=="threshvelocity") this->threshVelocity = readFval(ss); |
---|
| 503 | if(arg=="minchannels") this->minChannels = readIval(ss); |
---|
[71] | 504 | |
---|
[163] | 505 | if(arg=="spectralmethod") this->spectralMethod=makelower(readSval(ss)); |
---|
| 506 | if(arg=="spectralunits") this->spectralUnits=makelower(readSval(ss)); |
---|
| 507 | if(arg=="drawborders") this->borders = readFlag(ss); |
---|
| 508 | if(arg=="drawblankedges") this->blankEdge = readFlag(ss); |
---|
| 509 | if(arg=="verbose") this->verbose = readFlag(ss); |
---|
[3] | 510 | } |
---|
| 511 | } |
---|
[160] | 512 | return SUCCESS; |
---|
[3] | 513 | } |
---|
| 514 | |
---|
| 515 | |
---|
| 516 | std::ostream& operator<< ( std::ostream& theStream, Param& par) |
---|
| 517 | { |
---|
[103] | 518 | // Only show the [blankPixValue] bit if we are using the parameter |
---|
| 519 | // otherwise we have read it from the FITS header. |
---|
| 520 | string blankParam = ""; |
---|
| 521 | if(par.getFlagUsingBlank()) blankParam = "[blankPixValue]"; |
---|
[172] | 522 | string beamParam = ""; |
---|
| 523 | if(par.getFlagUsingBeam()) beamParam = "[beamSize]"; |
---|
[103] | 524 | |
---|
[107] | 525 | // BUG -- can get error: `boolalpha' is not a member of type `ios' -- old compilers: gcc 2.95.3? |
---|
[172] | 526 | // theStream.setf(std::ios::boolalpha); |
---|
[3] | 527 | theStream.setf(std::ios::left); |
---|
| 528 | theStream <<"---- Parameters ----"<<endl; |
---|
[103] | 529 | theStream << std::setfill('.'); |
---|
[187] | 530 | const int widthText = 38; |
---|
| 531 | const int widthPar = 18; |
---|
[3] | 532 | if(par.getFlagSubsection()) |
---|
[187] | 533 | theStream<<setw(widthText)<<"Image to be analysed" |
---|
| 534 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[imageFile]" |
---|
[103] | 535 | <<" = " <<resetiosflags(std::ios::right) |
---|
[172] | 536 | <<(par.getImageFile()+par.getSubsection()) <<endl; |
---|
[3] | 537 | else |
---|
[187] | 538 | theStream<<setw(widthText)<<"Image to be analysed" |
---|
| 539 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[imageFile]" |
---|
[172] | 540 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 541 | <<par.getImageFile() <<endl; |
---|
[81] | 542 | if(par.getFlagReconExists() && par.getFlagATrous()){ |
---|
[187] | 543 | theStream<<setw(widthText)<<"Reconstructed array exists?" |
---|
| 544 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[reconExists]" |
---|
[172] | 545 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 546 | <<stringize(par.getFlagReconExists())<<endl; |
---|
[187] | 547 | theStream<<setw(widthText)<<"FITS file containing reconstruction" |
---|
| 548 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[reconFile]" |
---|
[172] | 549 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 550 | <<par.getReconFile() <<endl; |
---|
[71] | 551 | } |
---|
[187] | 552 | theStream <<setw(widthText)<<"Intermediate Logfile" |
---|
| 553 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[logFile]" |
---|
[172] | 554 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 555 | <<par.getLogFile() <<endl; |
---|
[187] | 556 | theStream <<setw(widthText)<<"Final Results file" |
---|
| 557 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[outFile]" |
---|
[172] | 558 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 559 | <<par.getOutFile() <<endl; |
---|
[187] | 560 | theStream <<setw(widthText)<<"Spectrum file" |
---|
| 561 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[spectraFile]" |
---|
[172] | 562 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 563 | <<par.getSpectraFile() <<endl; |
---|
[3] | 564 | if(par.getFlagVOT()){ |
---|
[187] | 565 | theStream<<setw(widthText)<<"VOTable file" |
---|
| 566 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[votFile]" |
---|
[172] | 567 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 568 | <<par.getVOTFile() <<endl; |
---|
[3] | 569 | } |
---|
[20] | 570 | if(par.getFlagKarma()){ |
---|
[187] | 571 | theStream<<setw(widthText)<<"Karma annotation file" |
---|
| 572 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[karmaFile]" |
---|
[172] | 573 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 574 | |
---|
| 575 | <<par.getKarmaFile() <<endl; |
---|
[20] | 576 | } |
---|
[3] | 577 | if(par.getFlagMaps()){ |
---|
[187] | 578 | theStream<<setw(widthText)<<"0th Moment Map" |
---|
| 579 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[momentMap]" |
---|
[172] | 580 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 581 | <<par.getMomentMap() <<endl; |
---|
[187] | 582 | theStream<<setw(widthText)<<"Detection Map" |
---|
| 583 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[detectionMap]" |
---|
[172] | 584 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 585 | <<par.getDetectionMap() <<endl; |
---|
[3] | 586 | } |
---|
[195] | 587 | theStream <<setw(widthText)<<"Display a map in a pgplot xwindow?" |
---|
| 588 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagXOutput]" |
---|
| 589 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 590 | <<stringize(par.getFlagXOutput()) <<endl; |
---|
[3] | 591 | if(par.getFlagATrous()){ |
---|
[187] | 592 | theStream<<setw(widthText)<<"Saving reconstructed cube?" |
---|
| 593 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagoutputrecon]" |
---|
[172] | 594 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 595 | <<stringize(par.getFlagOutputRecon())<<endl; |
---|
[187] | 596 | theStream<<setw(widthText)<<"Saving residuals from reconstruction?" |
---|
| 597 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagoutputresid]" |
---|
[172] | 598 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 599 | <<stringize(par.getFlagOutputResid())<<endl; |
---|
[3] | 600 | } |
---|
[60] | 601 | theStream <<"------"<<endl; |
---|
[187] | 602 | theStream <<setw(widthText)<<"Searching for Negative features?" |
---|
| 603 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagNegative]" |
---|
[172] | 604 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 605 | <<stringize(par.getFlagNegative()) <<endl; |
---|
[187] | 606 | theStream <<setw(widthText)<<"Fixing Blank Pixels?" |
---|
| 607 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagBlankPix]" |
---|
[172] | 608 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 609 | <<stringize(par.getFlagBlankPix()) <<endl; |
---|
[3] | 610 | if(par.getFlagBlankPix()){ |
---|
[187] | 611 | theStream<<setw(widthText)<<"Blank Pixel Value" |
---|
| 612 | <<setw(widthPar)<<setiosflags(std::ios::right)<< blankParam |
---|
[172] | 613 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 614 | <<par.getBlankPixVal() <<endl; |
---|
[3] | 615 | } |
---|
[187] | 616 | theStream <<setw(widthText)<<"Removing Milky Way channels?" |
---|
| 617 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagMW]" |
---|
[172] | 618 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 619 | <<stringize(par.getFlagMW()) <<endl; |
---|
[3] | 620 | if(par.getFlagMW()){ |
---|
[187] | 621 | theStream<<setw(widthText)<<"Milky Way Channels" |
---|
| 622 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[minMW - maxMW]" |
---|
[172] | 623 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 624 | <<par.getMinMW() |
---|
[103] | 625 | <<"-" <<par.getMaxMW() <<endl; |
---|
[3] | 626 | } |
---|
[187] | 627 | theStream <<setw(widthText)<<"Beam Size (pixels)" |
---|
| 628 | <<setw(widthPar)<<setiosflags(std::ios::right)<< beamParam |
---|
[172] | 629 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 630 | <<par.getBeamSize() <<endl; |
---|
[187] | 631 | theStream <<setw(widthText)<<"Removing baselines before search?" |
---|
| 632 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagBaseline]" |
---|
[172] | 633 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 634 | <<stringize(par.getFlagBaseline()) <<endl; |
---|
[187] | 635 | theStream <<setw(widthText)<<"Minimum # Pixels in a detection" |
---|
| 636 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[minPix]" |
---|
[172] | 637 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 638 | <<par.getMinPix() <<endl; |
---|
[187] | 639 | theStream <<setw(widthText)<<"Minimum # Channels in a detection" |
---|
| 640 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[minChannels]" |
---|
[172] | 641 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 642 | <<par.getMinChannels() <<endl; |
---|
[187] | 643 | theStream <<setw(widthText)<<"Growing objects after detection?" |
---|
| 644 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagGrowth]" |
---|
[172] | 645 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 646 | <<stringize(par.getFlagGrowth()) <<endl; |
---|
[3] | 647 | if(par.getFlagGrowth()) { |
---|
[187] | 648 | theStream<<setw(widthText)<<"SNR Threshold for growth" |
---|
| 649 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[growthCut]" |
---|
[172] | 650 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 651 | <<par.getGrowthCut() <<endl; |
---|
[3] | 652 | } |
---|
[187] | 653 | theStream <<setw(widthText)<<"Using A Trous reconstruction?" |
---|
| 654 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagATrous]" |
---|
[172] | 655 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 656 | <<stringize(par.getFlagATrous()) <<endl; |
---|
[3] | 657 | if(par.getFlagATrous()){ |
---|
[187] | 658 | theStream<<setw(widthText)<<"Number of dimensions in reconstruction" |
---|
| 659 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[reconDim]" |
---|
[172] | 660 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 661 | <<par.getReconDim() <<endl; |
---|
[187] | 662 | theStream<<setw(widthText)<<"Minimum scale in reconstruction" |
---|
| 663 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[scaleMin]" |
---|
[172] | 664 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 665 | <<par.getMinScale() <<endl; |
---|
[187] | 666 | theStream<<setw(widthText)<<"SNR Threshold within reconstruction" |
---|
| 667 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[snrRecon]" |
---|
[172] | 668 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 669 | <<par.getAtrousCut() <<endl; |
---|
[187] | 670 | theStream<<setw(widthText)<<"Filter being used for reconstruction" |
---|
| 671 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[filterCode]" |
---|
[172] | 672 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 673 | <<par.getFilterCode() |
---|
[103] | 674 | << " (" << par.getFilterName() << ")" <<endl; |
---|
[3] | 675 | } |
---|
[187] | 676 | theStream <<setw(widthText)<<"Using FDR analysis?" |
---|
| 677 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagFDR]" |
---|
[172] | 678 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 679 | <<stringize(par.getFlagFDR()) <<endl; |
---|
[3] | 680 | if(par.getFlagFDR()){ |
---|
[187] | 681 | theStream<<setw(widthText)<<"Alpha value for FDR analysis" |
---|
| 682 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[alphaFDR]" |
---|
[172] | 683 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 684 | <<par.getAlpha() <<endl; |
---|
[3] | 685 | } |
---|
| 686 | else { |
---|
[190] | 687 | if(par.getFlagUserThreshold()){ |
---|
[189] | 688 | theStream<<setw(widthText)<<"Detection Threshold" |
---|
| 689 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[threshold]" |
---|
| 690 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 691 | <<par.getThreshold() <<endl; |
---|
| 692 | } |
---|
| 693 | else{ |
---|
| 694 | theStream<<setw(widthText)<<"SNR Threshold (in sigma)" |
---|
| 695 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[snrCut]" |
---|
| 696 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 697 | <<par.getCut() <<endl; |
---|
| 698 | } |
---|
[3] | 699 | } |
---|
[187] | 700 | theStream <<setw(widthText)<<"Using Adjacent-pixel criterion?" |
---|
| 701 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagAdjacent]" |
---|
[172] | 702 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 703 | <<stringize(par.getFlagAdjacent()) <<endl; |
---|
[3] | 704 | if(!par.getFlagAdjacent()){ |
---|
[187] | 705 | theStream<<setw(widthText)<<"Max. spatial separation for merging" |
---|
| 706 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[threshSpatial]" |
---|
[172] | 707 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 708 | <<par.getThreshS() <<endl; |
---|
[3] | 709 | } |
---|
[187] | 710 | theStream <<setw(widthText)<<"Max. velocity separation for merging" |
---|
| 711 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[threshVelocity]" |
---|
[172] | 712 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 713 | <<par.getThreshV() <<endl; |
---|
[187] | 714 | theStream <<setw(widthText)<<"Method of spectral plotting" |
---|
| 715 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[spectralMethod]" |
---|
[172] | 716 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 717 | <<par.getSpectralMethod() <<endl; |
---|
[3] | 718 | theStream <<"--------------------"<<endl; |
---|
[103] | 719 | theStream << std::setfill(' '); |
---|
[3] | 720 | theStream.unsetf(std::ios::left); |
---|
[110] | 721 | // theStream.unsetf(std::ios::boolalpha); |
---|
[3] | 722 | } |
---|
| 723 | |
---|
[120] | 724 | |
---|
[112] | 725 | void Param::copyHeaderInfo(FitsHeader &head) |
---|
| 726 | { |
---|
| 727 | /** |
---|
| 728 | * Param::copyHeaderInfo(FitsHeader &head) |
---|
| 729 | * A function to copy across relevant header keywords from the |
---|
| 730 | * FitsHeader class to the Param class, as they are needed by |
---|
| 731 | * functions in the Param class. |
---|
| 732 | */ |
---|
| 733 | |
---|
| 734 | this->blankKeyword = head.getBlankKeyword(); |
---|
| 735 | this->bscaleKeyword = head.getBscaleKeyword(); |
---|
| 736 | this->bzeroKeyword = head.getBzeroKeyword(); |
---|
[159] | 737 | this->blankPixValue = this->blankKeyword * this->bscaleKeyword + |
---|
| 738 | this->bzeroKeyword; |
---|
[112] | 739 | |
---|
| 740 | this->numPixBeam = head.getBeamSize(); |
---|
| 741 | } |
---|
| 742 | |
---|
[118] | 743 | bool Param::isBlank(float &value) |
---|
[3] | 744 | { |
---|
[120] | 745 | /** |
---|
| 746 | * Param::isBlank(float) |
---|
| 747 | * Tests whether the value passed as the argument is BLANK or not. |
---|
| 748 | * If flagBlankPix is false, return false. |
---|
[159] | 749 | * Otherwise, compare to the relevant FITS keywords, using integer |
---|
| 750 | * comparison. |
---|
[120] | 751 | * Return a bool. |
---|
| 752 | */ |
---|
| 753 | |
---|
| 754 | return this->flagBlankPix && |
---|
| 755 | (this->blankKeyword == int((value-this->bzeroKeyword)/this->bscaleKeyword)); |
---|
[3] | 756 | } |
---|
[103] | 757 | |
---|
| 758 | string Param::outputReconFile() |
---|
| 759 | { |
---|
| 760 | /** |
---|
| 761 | * outputReconFile() |
---|
| 762 | * |
---|
| 763 | * This function produces the required filename in which to save |
---|
| 764 | * the reconstructed array. If the input image is image.fits, then |
---|
| 765 | * the output will be eg. image.RECON-3-2-4-1.fits, where the numbers are |
---|
| 766 | * 3=reconDim, 2=filterCode, 4=snrRecon, 1=minScale |
---|
| 767 | */ |
---|
| 768 | string inputName = this->imageFile; |
---|
| 769 | std::stringstream ss; |
---|
| 770 | ss << inputName.substr(0,inputName.size()-5); // remove the ".fits" on the end. |
---|
[106] | 771 | if(this->flagSubsection) ss<<".sub"; |
---|
[103] | 772 | ss << ".RECON-" << this->reconDim |
---|
| 773 | << "-" << this->filterCode |
---|
| 774 | << "-" << this->snrRecon |
---|
| 775 | << "-" << this->scaleMin |
---|
| 776 | << ".fits"; |
---|
| 777 | return ss.str(); |
---|
| 778 | } |
---|
| 779 | |
---|
| 780 | string Param::outputResidFile() |
---|
| 781 | { |
---|
| 782 | /** |
---|
| 783 | * outputResidFile() |
---|
| 784 | * |
---|
| 785 | * This function produces the required filename in which to save |
---|
| 786 | * the reconstructed array. If the input image is image.fits, then |
---|
| 787 | * the output will be eg. image.RESID-3-2-4-1.fits, where the numbers are |
---|
| 788 | * 3=reconDim, 2=filterCode, 4=snrRecon, 1=scaleMin |
---|
| 789 | */ |
---|
| 790 | string inputName = this->imageFile; |
---|
| 791 | std::stringstream ss; |
---|
| 792 | ss << inputName.substr(0,inputName.size()-5); // remove the ".fits" on the end. |
---|
[106] | 793 | if(this->flagSubsection) ss<<".sub"; |
---|
[103] | 794 | ss << ".RESID-" << this->reconDim |
---|
| 795 | << "-" << this->filterCode |
---|
| 796 | << "-" << this->snrRecon |
---|
| 797 | << "-" << this->scaleMin |
---|
| 798 | << ".fits"; |
---|
| 799 | return ss.str(); |
---|
| 800 | } |
---|