Changeset 3787 in Sophya for trunk/Cosmo/RadioBeam/calcpk2.cc
- Timestamp:
- Jun 25, 2010, 12:00:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/calcpk2.cc
r3784 r3787 7 7 R. Ansari , C. Magneville - Juin 2010 8 8 9 Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync OutPk9 Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync InMapRadioSource convFacRsc OutPk [PixNoiseLevel] 10 10 --------------------------------------------------------------- */ 11 11 … … 22 22 23 23 #include "qhist.h" 24 #include "lobe.h" 25 #include "cubedef.h" 26 24 27 #include "histinit.h" 25 28 #include "fftwserver.h" … … 30 33 typedef ThSDR48RandGen RandomGenerator ; 31 34 //--- Declaration des fonctions 32 TArray<r_4> CleanForeground(TArray<r_4>& maplss, TArray<r_4>& mapsync, TArray<r_8>& synctemp, TArray<r_8>& specidx); 35 TArray<r_4> CleanForeground(TArray<r_4>& maplss, TArray<r_4>& mapsync, double freq0, double dfreq, 36 TArray<r_8>& synctemp, TArray<r_8>& specidx); 33 37 34 38 //------------------------------------------------------------------------- … … 39 43 { 40 44 if (narg<6) { 41 cout << " Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync OutPk" << endl;45 cout << " Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync OutPk [PixNoiseLevel] " << endl; 42 46 return 1; 43 47 } … … 50 54 r_4 rfacsync = atof(arg[4]); 51 55 string outname = arg[5]; 56 57 double pixsignoise = 0.; 58 bool fgaddnoise=false; 59 if (narg>6) { 60 pixsignoise=atof(arg[6]); 61 fgaddnoise=true; 62 } 63 64 52 65 TArray<r_4> inmaplss, inmapsync; 53 66 const char * tits[2]={"LSS", "Sync"}; … … 68 81 cout << " ... Mean=" << mean << " Sigma=" << sigma << endl; 69 82 } 83 84 if (fgaddnoise) { 85 cout << " calcpk2: adding noise to LSS input cube ... " << endl; 86 BeamEffect::AddNoise(inmaplss, pixsignoise); 87 } 88 70 89 tm.Split(" After read "); 71 90 TArray<r_8> synctemp, specidx; 72 91 cout << "calcpk2[3] : calling CleanForeground(...) " << endl; 73 TArray<r_4> inmap = CleanForeground(inmaplss, inmapsync, synctemp, specidx); 92 double freq0 = Freq0MHz; 93 double dfreq = FreqSizeMHz/(double)NFreq; 94 TArray<r_4> inmap = CleanForeground(inmaplss, inmapsync, freq0, dfreq, synctemp, specidx); 74 95 double mean, sigma; 75 96 MeanSigma(inmap, mean, sigma); … … 117 138 118 139 /* --Fonction-- */ 119 TArray<r_4> CleanForeground(TArray<r_4>& maplss, TArray<r_4>& mapsync, TArray<r_8>& synctemp, TArray<r_8>& specidx) 140 TArray<r_4> CleanForeground(TArray<r_4>& maplss, TArray<r_4>& mapsync, double freq0, double dfreq, 141 TArray<r_8>& synctemp, TArray<r_8>& specidx) 142 // Inputs : maplss, mapsyc, freq0, dfreq 143 // Outputs : synctemp, specidx (reconstructed foreground temperature and spectral index 144 // Return_Array : foreground subtracted LSS signal 120 145 { 121 146 bool smo; … … 131 156 Vector vlnf(maplss.SizeZ()); 132 157 int nprt = 0; 133 double freq0=840.; //Frequence premier index en k (MHz)134 double dfreq=1.;// largeur en frequence de chaque plan (Mhz)158 // double freq0 : Frequence premier index en k (MHz) 159 // double dfreq : // largeur en frequence de chaque plan (Mhz) 135 160 for(sa_size_t i=0; i<maplss.SizeX(); i++) 136 161 for(sa_size_t j=0; j<maplss.SizeY(); j++) {
Note:
See TracChangeset
for help on using the changeset viewer.