Changeset 3873 in Sophya for trunk/SophyaProg/PMixer/extractRS.cc
- Timestamp:
- Sep 2, 2010, 5:38:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/PMixer/extractRS.cc
r2615 r3873 43 43 string msg; 44 44 int rc = 0; 45 RadSpectra * es = NULL;46 SpectralResponse * sr = NULL;45 //RadSpectra * es = NULL; 46 //SpectralResponse * sr = NULL; 47 47 double moy, sig; 48 48 … … 91 91 // Loop over sky frequencies components 92 92 int maxOfSkyComp = nskycomp; 93 int nbOfPix ;93 int nbOfPix = 0; 94 94 int sk; 95 95 Vector freq(maxOfSkyComp); … … 138 138 if (printlev > 2) cout << " Reading Input FITS map " << nameOfFile << endl; 139 139 ifstream from(nameOfFile); 140 char ch;141 140 string dum; 142 141 from >> nb_source >> dum; … … 209 208 for(i=0;i<OutputMap.NbPixels();i++) 210 209 { 211 float rndval = frand01(); 212 if(rndval == 1) rndval = frand01(); 213 int rndvalPix = rndval*OutputMap.NbPixels(); 214 int outpix = rndval*nbOfPix; 210 double rndval = drand01(); 211 //stupid!!!!! if(rndval == 1) rndval = drand01(); 212 //unsused!!!!! int rndvalPix = rndval*OutputMap.NbPixels(); 213 int outpix = int(rndval*nbOfPix); 214 if(outpix >= nbOfPix) outpix = nbOfPix - 1; // add clean size protection 215 215 OutputMap(i) = outCoeff(outpix); 216 216 } … … 234 234 for(i=0;i<nb_source;i++) 235 235 { 236 float rndval = frand01(); 237 int outPix = rndval*OutputMap.NbPixels(); 236 double rndval = drand01(); 237 int outPix = int(rndval*OutputMap.NbPixels()); 238 if(outPix >= OutputMap.NbPixels()) outPix = OutputMap.NbPixels() - 1; // add clean size protection 238 239 SourceMap(outPix) = sourceCoeff(i); 239 240 OutputMap(outPix) = OutputMap(i)+ SourceMap(outPix);
Note:
See TracChangeset
for help on using the changeset viewer.