[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 | |
---|
[110] | 14 | // Define funtion to print bools as words, in case the compiler doesn't recognise |
---|
| 15 | // the setf(ios::boolalpha) command... |
---|
| 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"; |
---|
[3] | 268 | // Cube related parameters |
---|
[190] | 269 | this->flagBlankPix = true; |
---|
| 270 | this->blankPixValue = -8.00061; |
---|
| 271 | this->blankKeyword = 1; |
---|
| 272 | this->bscaleKeyword = -8.00061; |
---|
| 273 | this->bzeroKeyword = 0.; |
---|
| 274 | this->flagUsingBlank = false; |
---|
| 275 | this->flagMW = false; |
---|
| 276 | this->maxMW = 112; |
---|
| 277 | this->minMW = 75; |
---|
| 278 | this->numPixBeam = 10.; |
---|
| 279 | this->flagUsingBeam = false; |
---|
[3] | 280 | // Trim-related |
---|
[190] | 281 | this->flagTrimmed = false; |
---|
| 282 | this->borderLeft = 0; |
---|
| 283 | this->borderRight = 0; |
---|
| 284 | this->borderBottom = 0; |
---|
| 285 | this->borderTop = 0; |
---|
[3] | 286 | // Subsection offsets |
---|
[190] | 287 | this->xSubOffset = 0; |
---|
| 288 | this->ySubOffset = 0; |
---|
| 289 | this->zSubOffset = 0; |
---|
[3] | 290 | // Baseline related |
---|
[190] | 291 | this->flagBaseline = false; |
---|
[3] | 292 | // Detection-related |
---|
[190] | 293 | this->flagNegative = false; |
---|
[3] | 294 | // Object growth |
---|
[190] | 295 | this->flagGrowth = false; |
---|
| 296 | this->growthCut = 2.; |
---|
[3] | 297 | // FDR analysis |
---|
[190] | 298 | this->flagFDR = false; |
---|
| 299 | this->alphaFDR = 0.01; |
---|
[3] | 300 | // Other detection |
---|
[190] | 301 | this->snrCut = 3.; |
---|
| 302 | this->threshold = 0.; |
---|
| 303 | this->flagUserThreshold = false; |
---|
[3] | 304 | // A trous reconstruction parameters |
---|
[190] | 305 | this->flagATrous = true; |
---|
| 306 | this->reconDim = 3; |
---|
| 307 | this->scaleMin = 1; |
---|
| 308 | this->snrRecon = 4.; |
---|
| 309 | this->filterCode = 1; |
---|
[3] | 310 | // Volume-merging parameters |
---|
[190] | 311 | this->flagAdjacent = true; |
---|
| 312 | this->threshSpatial = 3.; |
---|
| 313 | this->threshVelocity = 7.; |
---|
| 314 | this->minChannels = 3; |
---|
| 315 | this->minPix = 2; |
---|
[3] | 316 | // Input-Output related |
---|
[190] | 317 | this->spectralMethod = "peak"; |
---|
| 318 | this->borders = true; |
---|
| 319 | this->blankEdge = true; |
---|
| 320 | this->verbose = true; |
---|
| 321 | this->spectralUnits = "km/s"; |
---|
[3] | 322 | }; |
---|
| 323 | |
---|
[137] | 324 | Param& Param::operator= (const Param& p) |
---|
| 325 | { |
---|
[190] | 326 | this->imageFile = p.imageFile; |
---|
| 327 | this->flagSubsection = p.flagSubsection; |
---|
| 328 | this->subsection = p.subsection; |
---|
| 329 | this->flagReconExists = p.flagReconExists; |
---|
| 330 | this->reconFile = p.reconFile; |
---|
| 331 | this->flagLog = p.flagLog; |
---|
| 332 | this->logFile = p.logFile; |
---|
| 333 | this->outFile = p.outFile; |
---|
| 334 | this->spectraFile = p.spectraFile; |
---|
| 335 | this->flagOutputRecon = p.flagOutputRecon; |
---|
| 336 | this->flagOutputResid = p.flagOutputResid; |
---|
| 337 | this->flagVOT = p.flagVOT; |
---|
| 338 | this->votFile = p.votFile; |
---|
| 339 | this->flagKarma = p.flagKarma; |
---|
| 340 | this->karmaFile = p.karmaFile; |
---|
| 341 | this->flagMaps = p.flagMaps; |
---|
| 342 | this->detectionMap = p.detectionMap; |
---|
| 343 | this->momentMap = p.momentMap; |
---|
| 344 | this->flagBlankPix = p.flagBlankPix; |
---|
| 345 | this->blankPixValue = p.blankPixValue; |
---|
| 346 | this->blankKeyword = p.blankKeyword; |
---|
| 347 | this->bscaleKeyword = p.bscaleKeyword; |
---|
| 348 | this->bzeroKeyword = p.bzeroKeyword; |
---|
| 349 | this->flagUsingBlank = p.flagUsingBlank; |
---|
| 350 | this->flagMW = p.flagMW; |
---|
| 351 | this->maxMW = p.maxMW; |
---|
| 352 | this->minMW = p.minMW; |
---|
| 353 | this->numPixBeam = p.numPixBeam; |
---|
| 354 | this->flagTrimmed = p.flagTrimmed; |
---|
| 355 | this->borderLeft = p.borderLeft; |
---|
| 356 | this->borderRight = p.borderRight; |
---|
| 357 | this->borderBottom = p.borderBottom; |
---|
| 358 | this->borderTop = p.borderTop; |
---|
| 359 | this->xSubOffset = p.xSubOffset; |
---|
| 360 | this->ySubOffset = p.ySubOffset; |
---|
| 361 | this->zSubOffset = p.zSubOffset; |
---|
| 362 | this->flagBaseline = p.flagBaseline; |
---|
| 363 | this->flagNegative = p.flagNegative; |
---|
| 364 | this->flagGrowth = p.flagGrowth; |
---|
| 365 | this->growthCut = p.growthCut; |
---|
| 366 | this->flagFDR = p.flagFDR; |
---|
| 367 | this->alphaFDR = p.alphaFDR; |
---|
| 368 | this->snrCut = p.snrCut; |
---|
| 369 | this->threshold = p.threshold; |
---|
| 370 | this->flagUserThreshold = p.threshold; |
---|
| 371 | this->flagATrous = p.flagATrous; |
---|
| 372 | this->reconDim = p.reconDim; |
---|
| 373 | this->scaleMin = p.scaleMin; |
---|
| 374 | this->snrRecon = p.snrRecon; |
---|
| 375 | this->filterCode = p.filterCode; |
---|
| 376 | this->flagAdjacent = p.flagAdjacent; |
---|
| 377 | this->threshSpatial = p.threshSpatial; |
---|
| 378 | this->threshVelocity = p.threshVelocity; |
---|
| 379 | this->minChannels = p.minChannels; |
---|
| 380 | this->minPix = p.minPix; |
---|
| 381 | this->spectralMethod = p.spectralMethod; |
---|
| 382 | this->borders = p.borders; |
---|
| 383 | this->verbose = p.verbose; |
---|
| 384 | this->spectralUnits = p.spectralUnits; |
---|
[137] | 385 | } |
---|
| 386 | |
---|
[3] | 387 | /****************************************************************/ |
---|
| 388 | /////////////////////////////////////////////////// |
---|
| 389 | //// Other Functions using the Parameter class: |
---|
| 390 | /////////////////////////////////////////////////// |
---|
| 391 | |
---|
[163] | 392 | inline string makelower( string s ) |
---|
[3] | 393 | { |
---|
| 394 | // "borrowed" from Matt Howlett's 'fred' |
---|
| 395 | string out = ""; |
---|
| 396 | for( int i=0; i<s.size(); ++i ) { |
---|
| 397 | out += tolower(s[i]); |
---|
| 398 | } |
---|
| 399 | return out; |
---|
| 400 | } |
---|
| 401 | |
---|
[163] | 402 | inline bool boolify( string s ) |
---|
[132] | 403 | { |
---|
| 404 | /** |
---|
[133] | 405 | * bool boolify(string) |
---|
[132] | 406 | * Convert a string to a bool variable |
---|
| 407 | * "1" and "true" get converted to true |
---|
| 408 | * "0" and "false" (and anything else) get converted to false |
---|
| 409 | */ |
---|
| 410 | if((s=="1") || (makelower(s)=="true")) return true; |
---|
| 411 | else if((s=="0") || (makelower(s)=="false")) return false; |
---|
| 412 | else return false; |
---|
| 413 | } |
---|
| 414 | |
---|
[163] | 415 | inline string readSval(std::stringstream& ss) |
---|
| 416 | { |
---|
| 417 | string val; ss >> val; return val; |
---|
| 418 | } |
---|
| 419 | |
---|
| 420 | inline bool readFlag(std::stringstream& ss) |
---|
| 421 | { |
---|
| 422 | string val; ss >> val; return boolify(val); |
---|
| 423 | } |
---|
| 424 | |
---|
| 425 | inline float readFval(std::stringstream& ss) |
---|
| 426 | { |
---|
| 427 | float val; ss >> val; return val; |
---|
| 428 | } |
---|
| 429 | |
---|
| 430 | inline int readIval(std::stringstream& ss) |
---|
| 431 | { |
---|
| 432 | int val; ss >> val; return val; |
---|
| 433 | } |
---|
| 434 | |
---|
[160] | 435 | int Param::readParams(string paramfile) |
---|
[3] | 436 | { |
---|
| 437 | |
---|
| 438 | std::ifstream fin(paramfile.c_str()); |
---|
[160] | 439 | if(!fin.is_open()) return FAILURE; |
---|
[3] | 440 | string line; |
---|
| 441 | while( !std::getline(fin,line,'\n').eof()){ |
---|
| 442 | |
---|
| 443 | if(line[0]!='#'){ |
---|
| 444 | std::stringstream ss; |
---|
| 445 | ss.str(line); |
---|
| 446 | string arg; |
---|
[163] | 447 | ss >> arg; |
---|
| 448 | arg = makelower(arg); |
---|
| 449 | if(arg=="imagefile") this->imageFile = readSval(ss); |
---|
| 450 | if(arg=="flagsubsection") this->flagSubsection = readFlag(ss); |
---|
| 451 | if(arg=="subsection") this->subsection = readSval(ss); |
---|
| 452 | if(arg=="flagreconexists") this->flagReconExists = readFlag(ss); |
---|
| 453 | if(arg=="reconfile") this->reconFile = readSval(ss); |
---|
[71] | 454 | |
---|
[163] | 455 | if(arg=="flaglog") this->flagLog = readFlag(ss); |
---|
| 456 | if(arg=="logfile") this->logFile = readSval(ss); |
---|
| 457 | if(arg=="outfile") this->outFile = readSval(ss); |
---|
| 458 | if(arg=="spectrafile") this->spectraFile = readSval(ss); |
---|
| 459 | if(arg=="flagoutputrecon") this->flagOutputRecon = readFlag(ss); |
---|
| 460 | if(arg=="flagoutputresid") this->flagOutputResid = readFlag(ss); |
---|
| 461 | if(arg=="flagvot") this->flagVOT = readFlag(ss); |
---|
| 462 | if(arg=="votfile") this->votFile = readSval(ss); |
---|
| 463 | if(arg=="flagkarma") this->flagKarma = readFlag(ss); |
---|
| 464 | if(arg=="karmafile") this->karmaFile = readSval(ss); |
---|
| 465 | if(arg=="flagmaps") this->flagMaps = readFlag(ss); |
---|
| 466 | if(arg=="detectionmap") this->detectionMap = readSval(ss); |
---|
| 467 | if(arg=="momentmap") this->momentMap = readSval(ss); |
---|
[3] | 468 | |
---|
[163] | 469 | if(arg=="flagnegative") this->flagNegative = readFlag(ss); |
---|
| 470 | if(arg=="flagblankpix") this->flagBlankPix = readFlag(ss); |
---|
| 471 | if(arg=="blankpixvalue") this->blankPixValue = readFval(ss); |
---|
| 472 | if(arg=="flagmw") this->flagMW = readFlag(ss); |
---|
| 473 | if(arg=="maxmw") this->maxMW = readIval(ss); |
---|
| 474 | if(arg=="minmw") this->minMW = readIval(ss); |
---|
| 475 | if(arg=="beamsize") this->numPixBeam = readFval(ss); |
---|
[71] | 476 | |
---|
[163] | 477 | if(arg=="flagbaseline") this->flagBaseline = readFlag(ss); |
---|
| 478 | if(arg=="minpix") this->minPix = readIval(ss); |
---|
| 479 | if(arg=="flaggrowth") this->flagGrowth = readFlag(ss); |
---|
| 480 | if(arg=="growthcut") this->growthCut = readFval(ss); |
---|
[71] | 481 | |
---|
[163] | 482 | if(arg=="flagfdr") this->flagFDR = readFlag(ss); |
---|
| 483 | if(arg=="alphafdr") this->alphaFDR = readFval(ss); |
---|
[103] | 484 | |
---|
[163] | 485 | if(arg=="snrcut") this->snrCut = readFval(ss); |
---|
[190] | 486 | if(arg=="threshold"){ |
---|
| 487 | this->threshold = readFval(ss); |
---|
| 488 | this->flagUserThreshold = true; |
---|
| 489 | } |
---|
[103] | 490 | |
---|
[163] | 491 | if(arg=="flagatrous") this->flagATrous = readFlag(ss); |
---|
| 492 | if(arg=="recondim") this->reconDim = readIval(ss); |
---|
| 493 | if(arg=="scalemin") this->scaleMin = readIval(ss); |
---|
| 494 | if(arg=="snrrecon") this->snrRecon = readFval(ss); |
---|
| 495 | if(arg=="filtercode") this->filterCode = readIval(ss); |
---|
[71] | 496 | |
---|
[163] | 497 | if(arg=="flagadjacent") this->flagAdjacent = readFlag(ss); |
---|
| 498 | if(arg=="threshspatial") this->threshSpatial = readFval(ss); |
---|
| 499 | if(arg=="threshvelocity") this->threshVelocity = readFval(ss); |
---|
| 500 | if(arg=="minchannels") this->minChannels = readIval(ss); |
---|
[71] | 501 | |
---|
[163] | 502 | if(arg=="spectralmethod") this->spectralMethod=makelower(readSval(ss)); |
---|
| 503 | if(arg=="spectralunits") this->spectralUnits=makelower(readSval(ss)); |
---|
| 504 | if(arg=="drawborders") this->borders = readFlag(ss); |
---|
| 505 | if(arg=="drawblankedges") this->blankEdge = readFlag(ss); |
---|
| 506 | if(arg=="verbose") this->verbose = readFlag(ss); |
---|
[3] | 507 | } |
---|
| 508 | } |
---|
[160] | 509 | return SUCCESS; |
---|
[3] | 510 | } |
---|
| 511 | |
---|
| 512 | |
---|
| 513 | std::ostream& operator<< ( std::ostream& theStream, Param& par) |
---|
| 514 | { |
---|
[103] | 515 | // Only show the [blankPixValue] bit if we are using the parameter |
---|
| 516 | // otherwise we have read it from the FITS header. |
---|
| 517 | string blankParam = ""; |
---|
| 518 | if(par.getFlagUsingBlank()) blankParam = "[blankPixValue]"; |
---|
[172] | 519 | string beamParam = ""; |
---|
| 520 | if(par.getFlagUsingBeam()) beamParam = "[beamSize]"; |
---|
[103] | 521 | |
---|
[107] | 522 | // BUG -- can get error: `boolalpha' is not a member of type `ios' -- old compilers: gcc 2.95.3? |
---|
[172] | 523 | // theStream.setf(std::ios::boolalpha); |
---|
[3] | 524 | theStream.setf(std::ios::left); |
---|
| 525 | theStream <<"---- Parameters ----"<<endl; |
---|
[103] | 526 | theStream << std::setfill('.'); |
---|
[187] | 527 | const int widthText = 38; |
---|
| 528 | const int widthPar = 18; |
---|
[3] | 529 | if(par.getFlagSubsection()) |
---|
[187] | 530 | theStream<<setw(widthText)<<"Image to be analysed" |
---|
| 531 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[imageFile]" |
---|
[103] | 532 | <<" = " <<resetiosflags(std::ios::right) |
---|
[172] | 533 | <<(par.getImageFile()+par.getSubsection()) <<endl; |
---|
[3] | 534 | else |
---|
[187] | 535 | theStream<<setw(widthText)<<"Image to be analysed" |
---|
| 536 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[imageFile]" |
---|
[172] | 537 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 538 | <<par.getImageFile() <<endl; |
---|
[81] | 539 | if(par.getFlagReconExists() && par.getFlagATrous()){ |
---|
[187] | 540 | theStream<<setw(widthText)<<"Reconstructed array exists?" |
---|
| 541 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[reconExists]" |
---|
[172] | 542 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 543 | <<stringize(par.getFlagReconExists())<<endl; |
---|
[187] | 544 | theStream<<setw(widthText)<<"FITS file containing reconstruction" |
---|
| 545 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[reconFile]" |
---|
[172] | 546 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 547 | <<par.getReconFile() <<endl; |
---|
[71] | 548 | } |
---|
[187] | 549 | theStream <<setw(widthText)<<"Intermediate Logfile" |
---|
| 550 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[logFile]" |
---|
[172] | 551 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 552 | <<par.getLogFile() <<endl; |
---|
[187] | 553 | theStream <<setw(widthText)<<"Final Results file" |
---|
| 554 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[outFile]" |
---|
[172] | 555 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 556 | <<par.getOutFile() <<endl; |
---|
[187] | 557 | theStream <<setw(widthText)<<"Spectrum file" |
---|
| 558 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[spectraFile]" |
---|
[172] | 559 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 560 | <<par.getSpectraFile() <<endl; |
---|
[3] | 561 | if(par.getFlagVOT()){ |
---|
[187] | 562 | theStream<<setw(widthText)<<"VOTable file" |
---|
| 563 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[votFile]" |
---|
[172] | 564 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 565 | <<par.getVOTFile() <<endl; |
---|
[3] | 566 | } |
---|
[20] | 567 | if(par.getFlagKarma()){ |
---|
[187] | 568 | theStream<<setw(widthText)<<"Karma annotation file" |
---|
| 569 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[karmaFile]" |
---|
[172] | 570 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 571 | |
---|
| 572 | <<par.getKarmaFile() <<endl; |
---|
[20] | 573 | } |
---|
[3] | 574 | if(par.getFlagMaps()){ |
---|
[187] | 575 | theStream<<setw(widthText)<<"0th Moment Map" |
---|
| 576 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[momentMap]" |
---|
[172] | 577 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 578 | <<par.getMomentMap() <<endl; |
---|
[187] | 579 | theStream<<setw(widthText)<<"Detection Map" |
---|
| 580 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[detectionMap]" |
---|
[172] | 581 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 582 | <<par.getDetectionMap() <<endl; |
---|
[3] | 583 | } |
---|
| 584 | if(par.getFlagATrous()){ |
---|
[187] | 585 | theStream<<setw(widthText)<<"Saving reconstructed cube?" |
---|
| 586 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagoutputrecon]" |
---|
[172] | 587 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 588 | <<stringize(par.getFlagOutputRecon())<<endl; |
---|
[187] | 589 | theStream<<setw(widthText)<<"Saving residuals from reconstruction?" |
---|
| 590 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagoutputresid]" |
---|
[172] | 591 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 592 | <<stringize(par.getFlagOutputResid())<<endl; |
---|
[3] | 593 | } |
---|
[60] | 594 | theStream <<"------"<<endl; |
---|
[187] | 595 | theStream <<setw(widthText)<<"Searching for Negative features?" |
---|
| 596 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagNegative]" |
---|
[172] | 597 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 598 | <<stringize(par.getFlagNegative()) <<endl; |
---|
[187] | 599 | theStream <<setw(widthText)<<"Fixing Blank Pixels?" |
---|
| 600 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagBlankPix]" |
---|
[172] | 601 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 602 | <<stringize(par.getFlagBlankPix()) <<endl; |
---|
[3] | 603 | if(par.getFlagBlankPix()){ |
---|
[187] | 604 | theStream<<setw(widthText)<<"Blank Pixel Value" |
---|
| 605 | <<setw(widthPar)<<setiosflags(std::ios::right)<< blankParam |
---|
[172] | 606 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 607 | <<par.getBlankPixVal() <<endl; |
---|
[3] | 608 | } |
---|
[187] | 609 | theStream <<setw(widthText)<<"Removing Milky Way channels?" |
---|
| 610 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagMW]" |
---|
[172] | 611 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 612 | <<stringize(par.getFlagMW()) <<endl; |
---|
[3] | 613 | if(par.getFlagMW()){ |
---|
[187] | 614 | theStream<<setw(widthText)<<"Milky Way Channels" |
---|
| 615 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[minMW - maxMW]" |
---|
[172] | 616 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 617 | <<par.getMinMW() |
---|
[103] | 618 | <<"-" <<par.getMaxMW() <<endl; |
---|
[3] | 619 | } |
---|
[187] | 620 | theStream <<setw(widthText)<<"Beam Size (pixels)" |
---|
| 621 | <<setw(widthPar)<<setiosflags(std::ios::right)<< beamParam |
---|
[172] | 622 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 623 | <<par.getBeamSize() <<endl; |
---|
[187] | 624 | theStream <<setw(widthText)<<"Removing baselines before search?" |
---|
| 625 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagBaseline]" |
---|
[172] | 626 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 627 | <<stringize(par.getFlagBaseline()) <<endl; |
---|
[187] | 628 | theStream <<setw(widthText)<<"Minimum # Pixels in a detection" |
---|
| 629 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[minPix]" |
---|
[172] | 630 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 631 | <<par.getMinPix() <<endl; |
---|
[187] | 632 | theStream <<setw(widthText)<<"Minimum # Channels in a detection" |
---|
| 633 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[minChannels]" |
---|
[172] | 634 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 635 | <<par.getMinChannels() <<endl; |
---|
[187] | 636 | theStream <<setw(widthText)<<"Growing objects after detection?" |
---|
| 637 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagGrowth]" |
---|
[172] | 638 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 639 | <<stringize(par.getFlagGrowth()) <<endl; |
---|
[3] | 640 | if(par.getFlagGrowth()) { |
---|
[187] | 641 | theStream<<setw(widthText)<<"SNR Threshold for growth" |
---|
| 642 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[growthCut]" |
---|
[172] | 643 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 644 | <<par.getGrowthCut() <<endl; |
---|
[3] | 645 | } |
---|
[187] | 646 | theStream <<setw(widthText)<<"Using A Trous reconstruction?" |
---|
| 647 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagATrous]" |
---|
[172] | 648 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 649 | <<stringize(par.getFlagATrous()) <<endl; |
---|
[3] | 650 | if(par.getFlagATrous()){ |
---|
[187] | 651 | theStream<<setw(widthText)<<"Number of dimensions in reconstruction" |
---|
| 652 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[reconDim]" |
---|
[172] | 653 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 654 | <<par.getReconDim() <<endl; |
---|
[187] | 655 | theStream<<setw(widthText)<<"Minimum scale in reconstruction" |
---|
| 656 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[scaleMin]" |
---|
[172] | 657 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 658 | <<par.getMinScale() <<endl; |
---|
[187] | 659 | theStream<<setw(widthText)<<"SNR Threshold within reconstruction" |
---|
| 660 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[snrRecon]" |
---|
[172] | 661 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 662 | <<par.getAtrousCut() <<endl; |
---|
[187] | 663 | theStream<<setw(widthText)<<"Filter being used for reconstruction" |
---|
| 664 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[filterCode]" |
---|
[172] | 665 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 666 | <<par.getFilterCode() |
---|
[103] | 667 | << " (" << par.getFilterName() << ")" <<endl; |
---|
[3] | 668 | } |
---|
[187] | 669 | theStream <<setw(widthText)<<"Using FDR analysis?" |
---|
| 670 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagFDR]" |
---|
[172] | 671 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 672 | <<stringize(par.getFlagFDR()) <<endl; |
---|
[3] | 673 | if(par.getFlagFDR()){ |
---|
[187] | 674 | theStream<<setw(widthText)<<"Alpha value for FDR analysis" |
---|
| 675 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[alphaFDR]" |
---|
[172] | 676 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 677 | <<par.getAlpha() <<endl; |
---|
[3] | 678 | } |
---|
| 679 | else { |
---|
[190] | 680 | if(par.getFlagUserThreshold()){ |
---|
[189] | 681 | theStream<<setw(widthText)<<"Detection Threshold" |
---|
| 682 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[threshold]" |
---|
| 683 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 684 | <<par.getThreshold() <<endl; |
---|
| 685 | } |
---|
| 686 | else{ |
---|
| 687 | theStream<<setw(widthText)<<"SNR Threshold (in sigma)" |
---|
| 688 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[snrCut]" |
---|
| 689 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 690 | <<par.getCut() <<endl; |
---|
| 691 | } |
---|
[3] | 692 | } |
---|
[187] | 693 | theStream <<setw(widthText)<<"Using Adjacent-pixel criterion?" |
---|
| 694 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[flagAdjacent]" |
---|
[172] | 695 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 696 | <<stringize(par.getFlagAdjacent()) <<endl; |
---|
[3] | 697 | if(!par.getFlagAdjacent()){ |
---|
[187] | 698 | theStream<<setw(widthText)<<"Max. spatial separation for merging" |
---|
| 699 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[threshSpatial]" |
---|
[172] | 700 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 701 | <<par.getThreshS() <<endl; |
---|
[3] | 702 | } |
---|
[187] | 703 | theStream <<setw(widthText)<<"Max. velocity separation for merging" |
---|
| 704 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[threshVelocity]" |
---|
[172] | 705 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 706 | <<par.getThreshV() <<endl; |
---|
[187] | 707 | theStream <<setw(widthText)<<"Method of spectral plotting" |
---|
| 708 | <<setw(widthPar)<<setiosflags(std::ios::right)<<"[spectralMethod]" |
---|
[172] | 709 | <<" = " <<resetiosflags(std::ios::right) |
---|
| 710 | <<par.getSpectralMethod() <<endl; |
---|
[3] | 711 | theStream <<"--------------------"<<endl; |
---|
[103] | 712 | theStream << std::setfill(' '); |
---|
[3] | 713 | theStream.unsetf(std::ios::left); |
---|
[110] | 714 | // theStream.unsetf(std::ios::boolalpha); |
---|
[3] | 715 | } |
---|
| 716 | |
---|
[120] | 717 | |
---|
[112] | 718 | void Param::copyHeaderInfo(FitsHeader &head) |
---|
| 719 | { |
---|
| 720 | /** |
---|
| 721 | * Param::copyHeaderInfo(FitsHeader &head) |
---|
| 722 | * A function to copy across relevant header keywords from the |
---|
| 723 | * FitsHeader class to the Param class, as they are needed by |
---|
| 724 | * functions in the Param class. |
---|
| 725 | */ |
---|
| 726 | |
---|
| 727 | this->blankKeyword = head.getBlankKeyword(); |
---|
| 728 | this->bscaleKeyword = head.getBscaleKeyword(); |
---|
| 729 | this->bzeroKeyword = head.getBzeroKeyword(); |
---|
[159] | 730 | this->blankPixValue = this->blankKeyword * this->bscaleKeyword + |
---|
| 731 | this->bzeroKeyword; |
---|
[112] | 732 | |
---|
| 733 | this->numPixBeam = head.getBeamSize(); |
---|
| 734 | } |
---|
| 735 | |
---|
[118] | 736 | bool Param::isBlank(float &value) |
---|
[3] | 737 | { |
---|
[120] | 738 | /** |
---|
| 739 | * Param::isBlank(float) |
---|
| 740 | * Tests whether the value passed as the argument is BLANK or not. |
---|
| 741 | * If flagBlankPix is false, return false. |
---|
[159] | 742 | * Otherwise, compare to the relevant FITS keywords, using integer |
---|
| 743 | * comparison. |
---|
[120] | 744 | * Return a bool. |
---|
| 745 | */ |
---|
| 746 | |
---|
| 747 | return this->flagBlankPix && |
---|
| 748 | (this->blankKeyword == int((value-this->bzeroKeyword)/this->bscaleKeyword)); |
---|
[3] | 749 | } |
---|
[103] | 750 | |
---|
| 751 | string Param::outputReconFile() |
---|
| 752 | { |
---|
| 753 | /** |
---|
| 754 | * outputReconFile() |
---|
| 755 | * |
---|
| 756 | * This function produces the required filename in which to save |
---|
| 757 | * the reconstructed array. If the input image is image.fits, then |
---|
| 758 | * the output will be eg. image.RECON-3-2-4-1.fits, where the numbers are |
---|
| 759 | * 3=reconDim, 2=filterCode, 4=snrRecon, 1=minScale |
---|
| 760 | */ |
---|
| 761 | string inputName = this->imageFile; |
---|
| 762 | std::stringstream ss; |
---|
| 763 | ss << inputName.substr(0,inputName.size()-5); // remove the ".fits" on the end. |
---|
[106] | 764 | if(this->flagSubsection) ss<<".sub"; |
---|
[103] | 765 | ss << ".RECON-" << this->reconDim |
---|
| 766 | << "-" << this->filterCode |
---|
| 767 | << "-" << this->snrRecon |
---|
| 768 | << "-" << this->scaleMin |
---|
| 769 | << ".fits"; |
---|
| 770 | return ss.str(); |
---|
| 771 | } |
---|
| 772 | |
---|
| 773 | string Param::outputResidFile() |
---|
| 774 | { |
---|
| 775 | /** |
---|
| 776 | * outputResidFile() |
---|
| 777 | * |
---|
| 778 | * This function produces the required filename in which to save |
---|
| 779 | * the reconstructed array. If the input image is image.fits, then |
---|
| 780 | * the output will be eg. image.RESID-3-2-4-1.fits, where the numbers are |
---|
| 781 | * 3=reconDim, 2=filterCode, 4=snrRecon, 1=scaleMin |
---|
| 782 | */ |
---|
| 783 | string inputName = this->imageFile; |
---|
| 784 | std::stringstream ss; |
---|
| 785 | ss << inputName.substr(0,inputName.size()-5); // remove the ".fits" on the end. |
---|
[106] | 786 | if(this->flagSubsection) ss<<".sub"; |
---|
[103] | 787 | ss << ".RESID-" << this->reconDim |
---|
| 788 | << "-" << this->filterCode |
---|
| 789 | << "-" << this->snrRecon |
---|
| 790 | << "-" << this->scaleMin |
---|
| 791 | << ".fits"; |
---|
| 792 | return ss.str(); |
---|
| 793 | } |
---|