[3115] | 1 | #include "sopnamsp.h"
|
---|
| 2 | #include "machdefs.h"
|
---|
| 3 | #include <iostream>
|
---|
| 4 | #include <stdlib.h>
|
---|
| 5 | #include <stdio.h>
|
---|
| 6 | #include <string.h>
|
---|
| 7 | #include <math.h>
|
---|
| 8 | #include <unistd.h>
|
---|
| 9 | #include "timing.h"
|
---|
| 10 | #include "ntuple.h"
|
---|
| 11 | #include "matharr.h"
|
---|
| 12 |
|
---|
| 13 | #include "constcosmo.h"
|
---|
[3157] | 14 | #include "cosmocalc.h"
|
---|
[3115] | 15 | #include "schechter.h"
|
---|
| 16 | #include "geneutils.h"
|
---|
| 17 | #include "genefluct3d.h"
|
---|
| 18 |
|
---|
| 19 | void usage(void);
|
---|
| 20 | void usage(void)
|
---|
| 21 | {
|
---|
[3182] | 22 | cout<<"cmvobserv3d [...options...]"<<endl
|
---|
[3200] | 23 | <<" -a : auto init random seed (needed for multiple simul)"<<endl
|
---|
| 24 | <<" -0 : use ComputeFourier0 method (defaut: no, use normal way)"<<endl
|
---|
[3331] | 25 | <<" -G typevol: compute Pk(z=0) and apply growth factor in real space"<<endl
|
---|
| 26 | <<" typevol=1 noise evolved with distance / observateur (def)"<<endl
|
---|
| 27 | <<" typevol=2 noise evolved with distance to middle of Z planes"<<endl
|
---|
[3200] | 28 | <<" (default: no, spectrum Pk(z=z_median) for all cube)"<<endl
|
---|
[3289] | 29 | <<" -F : filter spectrum by pixel shape (0=no 1=yes(default)"<<endl
|
---|
[3329] | 30 | <<" -U : do not poisson fluctuate with Ngal, convert directly to HI mass"<<endl
|
---|
[3200] | 31 | <<" -x nx,dx : size along x axis (npix,Mpc)"<<endl
|
---|
| 32 | <<" -y ny,dy : size along y axis (npix,Mpc)"<<endl
|
---|
| 33 | <<" if ny or dy <=0 take same value as for x"<<endl
|
---|
| 34 | <<" -z nz,dz : size along z axis (redshift axis, npix,Mpc)"<<endl
|
---|
| 35 | <<" -Z zref : redshift for the center of the simulation cube"<<endl
|
---|
[3331] | 36 | <<" -s snoise,typevol : gaussian noise sigma in equivalent Msol"<<endl
|
---|
| 37 | <<" typevol=0 no evolution (def)"<<endl
|
---|
| 38 | <<" typevol=1 noise evolved with distance / observateur"<<endl
|
---|
| 39 | <<" typevol=2 noise evolved with distance to middle of Z planes"<<endl
|
---|
[3200] | 40 | <<" -2 : compute also 2D spectrum (default: no)"<<endl
|
---|
[3351] | 41 | <<" -N scalemass: facteur d\'unite pour la masse (default: 1)"<<endl
|
---|
| 42 | <<" ex: si on veut unites 10^8 Msol -> scalemass=1.e-8"<<endl
|
---|
| 43 | <<" si <0 alors facteur=-scalemass*Mpix"<<endl
|
---|
[3193] | 44 | <<" -M schmin,schmax,nsch : min,max mass and nb points for schechter HI"<<endl
|
---|
[3322] | 45 | <<" If nsch<0 alors no,bre de points par decade"<<endl
|
---|
| 46 | <<" -Q naleagal : use quick method for turning ngal to mass"<<endl
|
---|
| 47 | <<" -R schmassdist.ppf : read mass distribution for trials from file"<<endl
|
---|
| 48 | <<" instead of computing it (ONLY if \"-Q\" option is activated)"<<endl
|
---|
[3200] | 49 | <<" -W : write cube in FITS format (complex cube is coded as real cube)"<<endl
|
---|
[3154] | 50 | <<" -P : write cube in PPF format"<<endl
|
---|
[3281] | 51 | <<" -S : write cube slices in PPF format"<<endl
|
---|
[3200] | 52 | <<" -V : compute variance from real space (for check, default: no)"<<endl
|
---|
[3281] | 53 | <<" -T nth : nombre de threads (si compil multi-thread, default: 0)"<<endl
|
---|
[3115] | 54 | <<endl;
|
---|
[3349] | 55 | ////<<" -A <log10(S_agn in Jy at 1.4 GHz)>,sigma,powlaw :"<<endl
|
---|
| 56 | ////<<" AGN mean and sigma gaussian equiv. distrib. for solid angle of centeral pixel"<<endl
|
---|
| 57 | ////<<" powlaw: apply S_agn evolution as (Nu/1.4)^powlaw"<<endl
|
---|
[3115] | 58 | }
|
---|
| 59 |
|
---|
| 60 | int main(int narg,char *arg[])
|
---|
| 61 | {
|
---|
| 62 | InitTim();
|
---|
| 63 |
|
---|
| 64 | //-----------------------------------------------------------------
|
---|
| 65 | // *** Survey definition
|
---|
[3129] | 66 | long nx=360, ny=-1, nz=64; double dx=1., dy=-1., dz=-1.;
|
---|
| 67 | //long nx=1000, ny=-1, nz=128; double dx=3., dy=-1., dz=6.;
|
---|
| 68 | //long nx=1200, ny=-1, nz=128; double dx=1., dy=-1., dz=3;
|
---|
[3115] | 69 |
|
---|
| 70 | // *** Cosmography definition (WMAP)
|
---|
[3157] | 71 | unsigned short flat = 0;
|
---|
[3115] | 72 | double ob0 = 0.0444356;
|
---|
| 73 | double h100=0.71, om0=0.267804, or0=7.9e-05, ol0=0.73,w0=-1.;
|
---|
| 74 | double zref = 0.5;
|
---|
[3285] | 75 | double perc=0.01,dzinc=-1.,dzmax=-1.; unsigned short glorder=4;
|
---|
[3115] | 76 |
|
---|
| 77 | // *** Spectrum and variance definition
|
---|
| 78 | double ns = 1., as = 1.;
|
---|
| 79 | double R=8./h100, Rg=R/sqrt(5.);
|
---|
| 80 | double sigmaR = 1.;
|
---|
| 81 |
|
---|
| 82 | double kmin=1e-5,kmax=1000.;
|
---|
| 83 | int npt = 10000;
|
---|
| 84 | double lkmin=log10(kmin), lkmax=log10(kmax);
|
---|
| 85 | double eps=1.e-3;
|
---|
| 86 |
|
---|
| 87 | // *** Schechter mass function definition
|
---|
[3193] | 88 | double h75 = h100 / 0.75;
|
---|
| 89 | double nstar = 0.006*pow(h75,3.);
|
---|
[3343] | 90 | double mstar = pow(10.,9.8); // MSol
|
---|
[3115] | 91 | double alpha = -1.37;
|
---|
| 92 |
|
---|
[3344] | 93 | double schmin=1.e7, schmax=1.e13;
|
---|
[3322] | 94 | int schnpt = -100;
|
---|
| 95 | bool use_schmassdist = false;
|
---|
| 96 | long naleagal = 100000;
|
---|
| 97 | bool recompute_schmassdist = true;
|
---|
| 98 | string schmassdistfile = "";
|
---|
[3329] | 99 | bool no_poisson = false;
|
---|
[3115] | 100 |
|
---|
[3351] | 101 | double scalemass = 1.;
|
---|
| 102 |
|
---|
[3115] | 103 | // *** Niveau de bruit
|
---|
| 104 | double snoise= 0.; // en equivalent MSol
|
---|
[3331] | 105 | int noise_evol = 0;
|
---|
[3115] | 106 |
|
---|
[3349] | 107 | //// *** AGN
|
---|
| 108 | ////bool do_agn = false;
|
---|
| 109 | ////double lfjy_agn=-99., lsigma_agn=0.; // en Jy
|
---|
| 110 | ////double powlaw_agn = 0.;
|
---|
[3196] | 111 |
|
---|
[3115] | 112 | // *** type de generation
|
---|
| 113 | bool computefourier0=false;
|
---|
[3331] | 114 | int use_growth_factor = 0;
|
---|
[3281] | 115 | unsigned short nthread=0;
|
---|
[3289] | 116 | int filter_by_pixel = 1;
|
---|
[3115] | 117 |
|
---|
[3154] | 118 | // *** What to do
|
---|
| 119 | bool comp2dspec = false;
|
---|
| 120 | bool wfits = false;
|
---|
| 121 | bool wppf = false;
|
---|
[3281] | 122 | bool wslice = false;
|
---|
[3154] | 123 | bool compvarreal = false;
|
---|
| 124 |
|
---|
[3115] | 125 | // --- Decodage arguments
|
---|
[3262] | 126 | if(narg>0) {
|
---|
[3322] | 127 | cout<<"\n--- Arguments: "<<endl;
|
---|
[3262] | 128 | for(int i=0;i<narg;i++) cout<<arg[i]<<" ";
|
---|
| 129 | cout<<endl;
|
---|
| 130 | }
|
---|
[3115] | 131 |
|
---|
| 132 | char c;
|
---|
[3331] | 133 | while((c = getopt(narg,arg,"ha0PWSV2UG:F:x:y:z:s:Z:M:A:T:N:Q:R:")) != -1) {
|
---|
[3281] | 134 | int nth = 0;
|
---|
[3115] | 135 | switch (c) {
|
---|
| 136 | case 'a' :
|
---|
| 137 | Auto_Ini_Ranf(5);
|
---|
| 138 | break;
|
---|
| 139 | case '0' :
|
---|
| 140 | computefourier0 = true;
|
---|
| 141 | break;
|
---|
[3157] | 142 | case 'G' :
|
---|
[3331] | 143 | sscanf(optarg,"%d",&use_growth_factor);
|
---|
[3157] | 144 | break;
|
---|
[3329] | 145 | case 'U' :
|
---|
| 146 | no_poisson = true;
|
---|
| 147 | break;
|
---|
[3289] | 148 | case 'F' :
|
---|
| 149 | sscanf(optarg,"%d",&filter_by_pixel);
|
---|
| 150 | break;
|
---|
[3115] | 151 | case 'x' :
|
---|
[3129] | 152 | sscanf(optarg,"%ld,%lf",&nx,&dx);
|
---|
[3115] | 153 | break;
|
---|
| 154 | case 'y' :
|
---|
[3129] | 155 | sscanf(optarg,"%ld,%lf",&ny,&dy);
|
---|
[3115] | 156 | break;
|
---|
| 157 | case 'z' :
|
---|
[3129] | 158 | sscanf(optarg,"%ld,%lf",&nz,&dz);
|
---|
[3115] | 159 | break;
|
---|
| 160 | case 's' :
|
---|
[3331] | 161 | sscanf(optarg,"%lf,%d",&snoise,&noise_evol);
|
---|
[3115] | 162 | break;
|
---|
| 163 | case 'Z' :
|
---|
| 164 | sscanf(optarg,"%lf",&zref);
|
---|
| 165 | break;
|
---|
[3154] | 166 | case '2' :
|
---|
| 167 | comp2dspec = true;
|
---|
| 168 | break;
|
---|
[3322] | 169 | case 'N' :
|
---|
[3351] | 170 | sscanf(optarg,"%lf",&scalemass);
|
---|
| 171 | if(scalemass==0.) scalemass = 1.;
|
---|
[3322] | 172 | break;
|
---|
[3193] | 173 | case 'M' :
|
---|
| 174 | sscanf(optarg,"%lf,%lf,%d",&schmin,&schmax,&schnpt);
|
---|
| 175 | break;
|
---|
[3322] | 176 | case 'Q' :
|
---|
| 177 | use_schmassdist = true;
|
---|
| 178 | sscanf(optarg,"%ld",&naleagal);
|
---|
| 179 | break;
|
---|
| 180 | case 'R' :
|
---|
| 181 | schmassdistfile = optarg;
|
---|
| 182 | break;
|
---|
[3349] | 183 | //// case 'A' :
|
---|
| 184 | ////do_agn = true;
|
---|
| 185 | ////sscanf(optarg,"%lf,%lf,%lf",&lfjy_agn,&lsigma_agn,&powlaw_agn);
|
---|
| 186 | ////break;
|
---|
[3154] | 187 | case 'V' :
|
---|
| 188 | compvarreal = true;
|
---|
| 189 | break;
|
---|
| 190 | case 'W' :
|
---|
| 191 | wfits = true;
|
---|
| 192 | break;
|
---|
| 193 | case 'P' :
|
---|
| 194 | wppf = true;
|
---|
| 195 | break;
|
---|
[3281] | 196 | case 'S' :
|
---|
| 197 | wslice = true;
|
---|
| 198 | break;
|
---|
| 199 | case 'T' :
|
---|
| 200 | sscanf(optarg,"%d",&nth);
|
---|
| 201 | nthread = (nth<1)? 0: nth;
|
---|
| 202 | break;
|
---|
[3115] | 203 | case 'h' :
|
---|
| 204 | default :
|
---|
| 205 | usage(); return -1;
|
---|
| 206 | }
|
---|
| 207 | }
|
---|
| 208 |
|
---|
[3322] | 209 | double lschmin=log10(schmin), lschmax=log10(schmax);
|
---|
| 210 | if(schnpt<=0) { // alors c'est un nombre de points par decade
|
---|
| 211 | schnpt = long( (-schnpt)*(lschmax-lschmin+1.) + 0.5 );
|
---|
| 212 | if(schnpt<=2) schnpt = 1000;
|
---|
| 213 | }
|
---|
| 214 | if(naleagal<=2) naleagal = 100000;
|
---|
[3193] | 215 |
|
---|
[3115] | 216 | cout<<"zref="<<zref<<endl;
|
---|
| 217 | cout<<"nx="<<nx<<" dx="<<dx<<" ny="<<ny<<" dy="<<dy<<" nz="<<nz<<" dz="<<dz<<endl;
|
---|
| 218 | cout<<"kmin="<<kmin<<" ("<<lkmin<<"), kmax="<<kmax<<" ("<<lkmax<<") Mpc^-1"
|
---|
| 219 | <<", npt="<<npt<<endl;
|
---|
[3289] | 220 | cout<<"Filter by pixel = "<<filter_by_pixel<<endl;
|
---|
[3115] | 221 | cout<<"R="<<R<<" Rg="<<Rg<<" Mpc, sigmaR="<<sigmaR<<endl;
|
---|
[3331] | 222 | cout<<"Use_growth_factor = "<<use_growth_factor<<endl;
|
---|
[3246] | 223 | cout<<"nstar= "<<nstar<<" mstar="<<mstar<<" alpha="<<alpha<<endl;
|
---|
[3115] | 224 | cout<<"schmin="<<schmin<<" ("<<lschmin
|
---|
| 225 | <<"), schmax="<<schmax<<" ("<<lschmax<<") Msol"
|
---|
| 226 | <<", schnpt="<<schnpt<<endl;
|
---|
[3329] | 227 | if(no_poisson) cout<<"No poisson fluctuation, direct conversion to HI mass"<<endl;
|
---|
[3331] | 228 | cout<<"snoise="<<snoise<<" equivalent Msol, evolution="<<noise_evol<<endl;
|
---|
[3351] | 229 | cout<<"scalemass="<<scalemass<<endl;
|
---|
[3349] | 230 | ////if(do_agn)
|
---|
| 231 | //// cout<<"AGN: <log10(Jy)>="<<lfjy_agn<<" , sigma="<<lsigma_agn
|
---|
| 232 | //// <<" , powlaw="<<powlaw_agn<<endl;
|
---|
[3115] | 233 |
|
---|
[3322] | 234 | string tagobs = "cmvobserv3d.ppf";
|
---|
| 235 | POutPersist posobs(tagobs);
|
---|
| 236 |
|
---|
[3115] | 237 | //-----------------------------------------------------------------
|
---|
[3157] | 238 | cout<<endl<<"\n--- Create Cosmology"<<endl;
|
---|
[3115] | 239 |
|
---|
[3157] | 240 | CosmoCalc univ(flat,true,zref+1.);
|
---|
| 241 | univ.SetInteg(perc,dzinc,dzmax,glorder);
|
---|
| 242 | univ.SetDynParam(h100,om0,or0,ol0,w0);
|
---|
[3285] | 243 | univ.PrtInteg();
|
---|
[3157] | 244 | univ.Print();
|
---|
| 245 | double loscomref = univ.Dloscom(zref);
|
---|
[3193] | 246 | cout<<"\nzref = "<<zref<<" -> dloscom = "<<loscomref<<" Mpc"<<endl;
|
---|
| 247 | univ.Print(zref);
|
---|
[3157] | 248 |
|
---|
| 249 | //-----------------------------------------------------------------
|
---|
[3193] | 250 | cout<<endl<<"\n--- Create Spectrum"<<endl;
|
---|
[3157] | 251 |
|
---|
[3115] | 252 | InitialSpectrum pkini(ns,as);
|
---|
| 253 |
|
---|
| 254 | TransfertEisenstein tf(h100,om0-ob0,ob0,T_CMB_Par,false);
|
---|
| 255 | //tf.SetNoOscEnv(2);
|
---|
| 256 |
|
---|
[3157] | 257 | GrowthFactor growth(om0,ol0);
|
---|
[3193] | 258 | // GrowthFactor growth(1.,0.); // D(z) = 1/(1+z)
|
---|
[3283] | 259 | double growth_at_z = growth(zref);
|
---|
| 260 | cout<<"...Growth factor at z="<<zref<<" = "<<growth_at_z<<endl;
|
---|
[3115] | 261 |
|
---|
| 262 | PkSpectrum0 pk0(pkini,tf);
|
---|
| 263 |
|
---|
[3157] | 264 | PkSpectrumZ pkz(pk0,growth,zref);
|
---|
[3193] | 265 |
|
---|
[3115] | 266 | //-----------------------------------------------------------------
|
---|
| 267 | pkz.SetZ(0.);
|
---|
| 268 | cout<<endl<<"\n--- Compute variance for top-hat R="<<R
|
---|
| 269 | <<" at z="<<pkz.GetZ()<<endl;
|
---|
[3349] | 270 | VarianceSpectrum varpk_th(pkz,R,VarianceSpectrum::TOPHAT);
|
---|
| 271 | double kfind_th = varpk_th.FindMaximum(kmin,kmax,eps);
|
---|
[3115] | 272 | double pkmax_th = varpk_th(kfind_th);
|
---|
| 273 | cout<<"kfind_th = "<<kfind_th<<" ("<<log10(kfind_th)<<"), integrand="<<pkmax_th<<endl;
|
---|
| 274 | double k1=kmin, k2=kmax;
|
---|
[3349] | 275 | int rc = varpk_th.FindLimits(pkmax_th/1.e4,k1,k2,eps);
|
---|
[3115] | 276 | cout<<"limit_th: rc="<<rc<<" : "<<k1<<" ("<<log10(k1)<<") , "
|
---|
| 277 | <<k2<<" ("<<log10(k2)<<")"<<endl;
|
---|
| 278 |
|
---|
| 279 | double ldlk = (log10(k2)-log10(k1))/npt;
|
---|
| 280 | varpk_th.SetInteg(0.01,ldlk,-1.,4);
|
---|
[3349] | 281 | double sr2 = varpk_th.Variance(k1,k2);
|
---|
[3115] | 282 | cout<<"varpk_th="<<sr2<<" -> sigma="<<sqrt(sr2)<<endl;
|
---|
| 283 |
|
---|
| 284 | double normpkz = sigmaR*sigmaR/sr2;
|
---|
| 285 | pkz.SetScale(normpkz);
|
---|
| 286 | cout<<"Spectrum normalisation = "<<pkz.GetScale()<<endl;
|
---|
| 287 |
|
---|
| 288 | pkz.SetZ(zref);
|
---|
| 289 |
|
---|
[3120] | 290 | Histo hpkz(lkmin,lkmax,npt); hpkz.ReCenterBin();
|
---|
[3115] | 291 | FuncToHisto(pkz,hpkz,true);
|
---|
| 292 | {
|
---|
| 293 | tagobs = "hpkz"; posobs.PutObject(hpkz,tagobs);
|
---|
| 294 | }
|
---|
| 295 |
|
---|
| 296 | //-----------------------------------------------------------------
|
---|
| 297 | cout<<endl<<"\n--- Compute variance for Pk at z="<<pkz.GetZ()<<endl;
|
---|
[3349] | 298 | VarianceSpectrum varpk_int(pkz,R,VarianceSpectrum::NOFILTER);
|
---|
[3115] | 299 |
|
---|
[3349] | 300 | double kfind_int = varpk_int.FindMaximum(kmin,kmax,eps);
|
---|
[3115] | 301 | double pkmax_int = varpk_int(kfind_int);
|
---|
| 302 | cout<<"kfind_int = "<<kfind_int<<" ("<<log10(kfind_int)<<"), integrand="<<pkmax_int<<endl;
|
---|
| 303 | double k1int=kmin, k2int=kmax;
|
---|
[3349] | 304 | int rcint = varpk_int.FindLimits(pkmax_int/1.e4,k1int,k2int,eps);
|
---|
[3115] | 305 | cout<<"limit_int: rc="<<rcint<<" : "<<k1int<<" ("<<log10(k1int)<<") , "
|
---|
| 306 | <<k2int<<" ("<<log10(k2int)<<")"<<endl;
|
---|
| 307 |
|
---|
| 308 | double ldlkint = (log10(k2int)-log10(k1int))/npt;
|
---|
| 309 | varpk_int.SetInteg(0.01,ldlkint,-1.,4);
|
---|
[3349] | 310 | double sr2int = varpk_int.Variance(k1int,k2int);
|
---|
[3115] | 311 | cout<<"varpk_int="<<sr2int<<" -> sigma="<<sqrt(sr2int)<<endl;
|
---|
[3322] | 312 |
|
---|
[3115] | 313 | //-----------------------------------------------------------------
|
---|
[3322] | 314 | cout<<endl<<"\n--- Create mass function, compute number/mass density, init mass trials"<<endl;
|
---|
[3115] | 315 |
|
---|
[3322] | 316 | Schechter sch(nstar,mstar,alpha);
|
---|
| 317 | sch.Print();
|
---|
| 318 |
|
---|
[3115] | 319 | sch.SetOutValue(0);
|
---|
| 320 | cout<<"sch(mstar) = "<<sch(mstar)<<" /Mpc^3/Msol"<<endl;
|
---|
[3322] | 321 | double ngal_by_mpc3 = sch.Integrate(schmin,schmax,schnpt);
|
---|
[3115] | 322 | cout<<"Galaxy density number = "<<ngal_by_mpc3<<" /Mpc^3 between limits"<<endl;
|
---|
| 323 |
|
---|
| 324 | sch.SetOutValue(1);
|
---|
| 325 | cout<<"mstar*sch(mstar) = "<<sch(mstar)<<" Msol/Mpc^3/Msol"<<endl;
|
---|
[3322] | 326 | double mass_by_mpc3 = sch.Integrate(schmin,schmax,schnpt);
|
---|
[3115] | 327 | cout<<"Galaxy mass density= "<<mass_by_mpc3<<" Msol/Mpc^3 between limits"<<endl;
|
---|
[3193] | 328 | cout<<"Omega_HI at z=0 is "<<mass_by_mpc3/(univ.Rhoc(0.)*GCm3toMsolMpc3_Cst)<<endl
|
---|
| 329 | <<" at z="<<zref<<" is "<<mass_by_mpc3/(univ.Rhoc(zref)*GCm3toMsolMpc3_Cst)<<endl;
|
---|
[3115] | 330 |
|
---|
[3322] | 331 | SchechterMassDist schmdist(sch,schmin,schmax,schnpt);
|
---|
| 332 | if(use_schmassdist && schmassdistfile.size()>0) {
|
---|
[3345] | 333 | cout<<"\nSchechterMassDist read from "<<schmassdistfile<<endl;
|
---|
[3322] | 334 | schmdist.ReadPPF(schmassdistfile);
|
---|
[3345] | 335 | bool compsch = IsCompatible(sch,schmdist.GetSchechter());
|
---|
| 336 | double m1,m2; schmdist.GetMassLim(m1,m2);
|
---|
| 337 | if( !compsch || fabs(m1-schmin)>1e-4*schmin || fabs(m2-schmax)>1e-4*schmax) {
|
---|
| 338 | cout<<"FATAL_ERROR: INCONSISTENT SchechterMassDist file / Schechter or limits"<<endl;
|
---|
| 339 | cout<<"Schechter:"<<endl; sch.Print();
|
---|
| 340 | cout<<"schmin="<<schmin<<" schmax="<<schmax<<endl;
|
---|
| 341 | cout<<"SchechterMassDist:"<<endl; schmdist.Print();
|
---|
| 342 | return -10;
|
---|
| 343 | }
|
---|
[3323] | 344 | recompute_schmassdist = false;
|
---|
[3322] | 345 | }
|
---|
| 346 | schmdist.Print();
|
---|
| 347 | Histo hmdndm = schmdist.GetHmDnDm();
|
---|
| 348 | FunRan tirhmdndm = schmdist.GetTmDnDm();
|
---|
| 349 | {
|
---|
| 350 | tagobs = "hmdndm"; posobs.PutObject(hmdndm,tagobs);
|
---|
| 351 | Histo hdum1(tirhmdndm);
|
---|
| 352 | tagobs = "tirhmdndm"; posobs.PutObject(hdum1,tagobs);
|
---|
| 353 | }
|
---|
| 354 |
|
---|
[3155] | 355 | PrtTim(">>>> End of definition");
|
---|
| 356 |
|
---|
[3115] | 357 | //-----------------------------------------------------------------
|
---|
| 358 | // FFTW3 (p26): faster if sizes 2^a 3^b 5^c 7^d 11^e 13^f with e+f=0 ou 1
|
---|
[3155] | 359 | cout<<endl<<"\n--- Initialisation de GeneFluct3D"<<endl;
|
---|
[3115] | 360 |
|
---|
[3349] | 361 | GeneFluct3D fluct3d(nx,ny,nz,dx,dy,dz,nthread,2);
|
---|
[3267] | 362 | fluct3d.SetObservator(zref,-nz/2.);
|
---|
[3157] | 363 | fluct3d.SetCosmology(univ);
|
---|
| 364 | fluct3d.SetGrowthFactor(growth);
|
---|
[3199] | 365 | fluct3d.LosComRedshift(0.001,-1);
|
---|
[3349] | 366 | TArray< complex<r_8> >& pkgen = fluct3d.GetComplexArray();
|
---|
| 367 | TArray<r_8>& rgen = fluct3d.GetRealArray();
|
---|
[3157] | 368 | cout<<endl; fluct3d.Print();
|
---|
[3322] | 369 | cout<<"\nMean number of galaxies per pixel = "<<ngal_by_mpc3*fluct3d.GetDVol()<<endl;
|
---|
[3351] | 370 | double mass_by_pixel = mass_by_mpc3 * fluct3d.GetDVol();
|
---|
| 371 | cout<<"Mean mass per pixel = "<<mass_by_pixel<<endl;
|
---|
[3141] | 372 |
|
---|
| 373 | double dkmin = fluct3d.GetKincMin();
|
---|
[3115] | 374 | double knyqmax = fluct3d.GetKmax();
|
---|
[3141] | 375 | long nherr = long(knyqmax/dkmin+0.5);
|
---|
[3322] | 376 | cout<<"\nFor HistoErr: d="<<dkmin<<" max="<<knyqmax<<" n="<<nherr<<endl;
|
---|
[3115] | 377 |
|
---|
[3141] | 378 | double dktmin = fluct3d.GetKTincMin();
|
---|
| 379 | double ktnyqmax = fluct3d.GetKTmax();
|
---|
| 380 | long nherrt = long(ktnyqmax/dktmin+0.5);
|
---|
| 381 | double dkzmin = fluct3d.GetKinc()[2];
|
---|
| 382 | double kznyqmax = fluct3d.GetKnyq()[2];
|
---|
| 383 | long nherrz = long(kznyqmax/dkzmin+0.5);
|
---|
| 384 | cout<<"For Histo2DErr: d="<<dktmin<<","<<dkzmin
|
---|
| 385 | <<" max="<<ktnyqmax<<","<<kznyqmax<<" n="<<nherrt<<","<<nherrz<<endl;
|
---|
| 386 |
|
---|
[3157] | 387 | //-----------------------------------------------------------------
|
---|
[3115] | 388 | cout<<"\n--- Computing spectra variance up to Kmax at z="<<pkz.GetZ()<<endl;
|
---|
| 389 | // En fait on travaille sur un cube inscrit dans la sphere de rayon kmax:
|
---|
| 390 | // sphere: Vs = 4Pi/3 k^3 , cube inscrit (cote k*sqrt(2)): Vc = (k*sqrt(2))^3
|
---|
| 391 | // Vc/Vs = 0.675 -> keff = kmax * (0.675)^(1/3) = kmax * 0.877
|
---|
[3141] | 392 | double knyqmax_mod = 0.877*knyqmax;
|
---|
| 393 | ldlkint = (log10(knyqmax_mod)-log10(k1int))/npt;
|
---|
[3115] | 394 | varpk_int.SetInteg(0.01,ldlkint,-1.,4);
|
---|
[3349] | 395 | double sr2int_kmax = varpk_int.Variance(k1int,knyqmax_mod);
|
---|
[3141] | 396 | cout<<"varpk_int(<"<<knyqmax_mod<<")="<<sr2int_kmax<<" -> sigma="<<sqrt(sr2int_kmax)<<endl;
|
---|
[3115] | 397 |
|
---|
[3155] | 398 | PrtTim(">>>> End Initialisation de GeneFluct3D");
|
---|
| 399 |
|
---|
[3157] | 400 | //-----------------------------------------------------------------
|
---|
[3115] | 401 | cout<<"\n--- Computing a realization in Fourier space"<<endl;
|
---|
[3331] | 402 | if(use_growth_factor>0) pkz.SetZ(0.); else pkz.SetZ(zref);
|
---|
[3157] | 403 | cout<<"Power spectrum set at redshift: "<<pkz.GetZ()<<endl;
|
---|
[3141] | 404 | if(computefourier0) fluct3d.ComputeFourier0(pkz);
|
---|
| 405 | else fluct3d.ComputeFourier(pkz);
|
---|
[3155] | 406 | PrtTim(">>>> End Computing a realization in Fourier space");
|
---|
[3115] | 407 |
|
---|
[3289] | 408 | cout<<"\n--- Checking realization spectra"<<endl;
|
---|
| 409 | HistoErr hpkgen(0.,knyqmax,nherr);
|
---|
| 410 | hpkgen.ReCenterBin(); hpkgen.Zero();
|
---|
| 411 | hpkgen.Show();
|
---|
| 412 | fluct3d.ComputeSpectrum(hpkgen);
|
---|
| 413 | {
|
---|
| 414 | tagobs = "hpkgen"; posobs.PutObject(hpkgen,tagobs);
|
---|
[3115] | 415 | }
|
---|
[3289] | 416 | PrtTim(">>>> End Checking realization spectra");
|
---|
[3115] | 417 |
|
---|
[3154] | 418 | if(comp2dspec) {
|
---|
[3141] | 419 | cout<<"\n--- Checking realization 2D spectra"<<endl;
|
---|
| 420 | Histo2DErr hpkgen2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz);
|
---|
| 421 | hpkgen2.ReCenterBin(); hpkgen2.Zero();
|
---|
| 422 | hpkgen2.Show();
|
---|
| 423 | fluct3d.ComputeSpectrum2D(hpkgen2);
|
---|
| 424 | {
|
---|
| 425 | tagobs = "hpkgen2"; posobs.PutObject(hpkgen2,tagobs);
|
---|
| 426 | }
|
---|
[3155] | 427 | PrtTim(">>>> End Checking realization 2D spectra");
|
---|
[3141] | 428 | }
|
---|
| 429 |
|
---|
[3289] | 430 | if(filter_by_pixel!=0) {
|
---|
[3115] | 431 | cout<<"\n--- Computing convolution by pixel shape"<<endl;
|
---|
| 432 | fluct3d.FilterByPixel();
|
---|
[3155] | 433 | PrtTim(">>>> End Computing convolution by pixel shape");
|
---|
[3115] | 434 |
|
---|
| 435 | cout<<"\n--- Checking realization spectra after pixel shape convol."<<endl;
|
---|
[3330] | 436 | HistoErr hpkgenfb(0.,knyqmax,nherr);
|
---|
| 437 | hpkgenfb.ReCenterBin(); hpkgenfb.Zero();
|
---|
| 438 | hpkgenfb.Show();
|
---|
| 439 | fluct3d.ComputeSpectrum(hpkgenfb);
|
---|
[3115] | 440 | {
|
---|
[3330] | 441 | tagobs = "hpkgenfb"; posobs.PutObject(hpkgenfb,tagobs);
|
---|
[3115] | 442 | }
|
---|
[3155] | 443 | PrtTim(">>>> End Checking realization spectra");
|
---|
[3115] | 444 |
|
---|
[3330] | 445 | cout<<"\n--- Checking realization spectra after pixel shape convol. with pixel correc."<<endl;
|
---|
| 446 | HistoErr hpkgenf(hpkgenfb); hpkgenf.Zero();
|
---|
| 447 | fluct3d.ComputeSpectrum(hpkgenf,0.,filter_by_pixel);
|
---|
| 448 | {
|
---|
| 449 | tagobs = "hpkgenf"; posobs.PutObject(hpkgenf,tagobs);
|
---|
| 450 | }
|
---|
| 451 | PrtTim(">>>> End Checking realization spectra with pixel correc.");
|
---|
| 452 |
|
---|
[3289] | 453 | if(comp2dspec) {
|
---|
| 454 | cout<<"\n--- Checking realization 2D spectra after pixel shape convol."<<endl;
|
---|
[3330] | 455 | Histo2DErr hpkgenfb2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz);
|
---|
| 456 | hpkgenfb2.ReCenterBin(); hpkgenfb2.Zero();
|
---|
| 457 | hpkgenfb2.Show();
|
---|
| 458 | fluct3d.ComputeSpectrum2D(hpkgenfb2);
|
---|
[3289] | 459 | {
|
---|
[3330] | 460 | tagobs = "hpkgenfb2"; posobs.PutObject(hpkgenfb2,tagobs);
|
---|
| 461 | }
|
---|
| 462 | PrtTim(">>>> End Checking realization 2D spectra");
|
---|
| 463 |
|
---|
| 464 | cout<<"\n--- Checking realization 2D spectra after pixel shape convol. with pixel correc."<<endl;
|
---|
| 465 | Histo2DErr hpkgenf2(hpkgenfb2); hpkgenf2.Zero();
|
---|
| 466 | fluct3d.ComputeSpectrum2D(hpkgenf2,0.,filter_by_pixel);
|
---|
| 467 | {
|
---|
[3289] | 468 | tagobs = "hpkgenf2"; posobs.PutObject(hpkgenf2,tagobs);
|
---|
| 469 | }
|
---|
[3330] | 470 | PrtTim(">>>> End Checking realization 2D spectra with pixel correc.");
|
---|
[3141] | 471 | }
|
---|
[3115] | 472 | }
|
---|
| 473 |
|
---|
[3289] | 474 | if(wfits) {
|
---|
| 475 | fluct3d.WriteFits("!cmvobserv3d_k0.fits");
|
---|
| 476 | PrtTim(">>>> End WriteFits");
|
---|
| 477 | }
|
---|
| 478 | if(wppf) {
|
---|
| 479 | fluct3d.WritePPF("cmvobserv3d_k0.ppf",false);
|
---|
| 480 | PrtTim(">>>> End WritePPF");
|
---|
| 481 | }
|
---|
| 482 |
|
---|
[3157] | 483 | //-----------------------------------------------------------------
|
---|
[3115] | 484 | cout<<"\n--- Computing a realization in real space"<<endl;
|
---|
| 485 | fluct3d.ComputeReal();
|
---|
[3322] | 486 | double rmin,rmax; fluct3d.MinMax(rmin,rmax);
|
---|
[3115] | 487 | cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl;
|
---|
[3157] | 488 | PrtTim(">>>> End Computing a realization in real space");
|
---|
[3115] | 489 |
|
---|
[3331] | 490 | if(use_growth_factor>0) {
|
---|
[3157] | 491 | cout<<"\n--- Apply Growth factor"<<endl;
|
---|
| 492 | cout<<"...D(z=0)="<<growth(0.)<<" D(z="<<zref<<")="<<growth(zref)<<endl;
|
---|
[3331] | 493 | fluct3d.ApplyGrowthFactor(use_growth_factor);
|
---|
[3322] | 494 | fluct3d.MinMax(rmin,rmax);
|
---|
[3157] | 495 | cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl;
|
---|
| 496 | PrtTim(">>>> End Applying growth factor");
|
---|
| 497 | }
|
---|
| 498 |
|
---|
[3322] | 499 | int_8 nm;
|
---|
| 500 | double rmref,rs2ref;
|
---|
| 501 | cout<<"\n--- Computing reference variance in real space"<<endl;
|
---|
| 502 | nm = fluct3d.MeanSigma2(rmref,rs2ref);
|
---|
| 503 | cout<<" rs2ref= "<<rs2ref<<" , rmref="<<rmref<<" ("<<nm<<")"<<endl;
|
---|
| 504 | PrtTim(">>>> End Computing reference variance in real space");
|
---|
[3289] | 505 |
|
---|
[3155] | 506 | if(wfits) {
|
---|
| 507 | fluct3d.WriteFits("!cmvobserv3d_r0.fits");
|
---|
| 508 | PrtTim(">>>> End WriteFits");
|
---|
| 509 | }
|
---|
| 510 | if(wppf) {
|
---|
| 511 | fluct3d.WritePPF("cmvobserv3d_r0.ppf",true);
|
---|
| 512 | PrtTim(">>>> End WritePPF");
|
---|
| 513 | }
|
---|
[3281] | 514 | if(wslice) {
|
---|
| 515 | fluct3d.WriteSlicePPF("cmvobserv3d_s_r0.ppf");
|
---|
| 516 | PrtTim(">>>> End WriteSlicePPF");
|
---|
| 517 | }
|
---|
[3115] | 518 |
|
---|
[3289] | 519 | cout<<"\n--- Check mean and variance in real space"<<endl;
|
---|
| 520 | fluct3d.NumberOfBad(-1.,1e+200);
|
---|
[3322] | 521 | double rm,rs2;
|
---|
[3289] | 522 | nm = fluct3d.MeanSigma2(rm,rs2);
|
---|
| 523 | PrtTim(">>>> End Check mean and variance in real space");
|
---|
[3141] | 524 |
|
---|
[3154] | 525 | if(compvarreal) {
|
---|
[3115] | 526 | cout<<"\n--- Check variance sigmaR in real space"<<endl;
|
---|
| 527 | double varr;
|
---|
[3262] | 528 | fluct3d.VarianceFrReal(R,varr);
|
---|
[3283] | 529 | cout<<"...Computed variance = "<<varr
|
---|
| 530 | <<" , Theorical variance at (z=0) = "<<pow(sigmaR,1.)
|
---|
| 531 | <<" , at (z="<<zref<<") = "<<pow(sigmaR*growth_at_z,1.)<<endl;
|
---|
[3155] | 532 | PrtTim(">>>> End Check variance sigmaR in real space");
|
---|
[3115] | 533 | }
|
---|
| 534 |
|
---|
| 535 | //-----------------------------------------------------------------
|
---|
| 536 | cout<<endl<<"\n--- Converting fluctuations into mass"<<endl;
|
---|
| 537 | fluct3d.TurnFluct2Mass();
|
---|
[3262] | 538 | nm = fluct3d.MeanSigma2(rm,rs2);
|
---|
[3155] | 539 | PrtTim(">>>> End Converting fluctuations into mass");
|
---|
[3115] | 540 |
|
---|
[3329] | 541 | if(no_poisson) {
|
---|
| 542 | cout<<"\n--- Converting !!!DIRECTLY!!! mass into HI mass: mass per pixel ="
|
---|
[3351] | 543 | <<mass_by_pixel<<endl;
|
---|
| 544 | rm = fluct3d.TurnMass2MeanNumber(mass_by_mpc3); // ici on doit donner Msol/Mpc^3
|
---|
[3329] | 545 | } else {
|
---|
| 546 | cout<<"\n--- Converting mass into galaxy number: gal per pixel ="
|
---|
| 547 | <<ngal_by_mpc3*fluct3d.GetDVol()<<endl;
|
---|
| 548 | rm = fluct3d.TurnMass2MeanNumber(ngal_by_mpc3);
|
---|
[3349] | 549 | }
|
---|
| 550 | nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200);
|
---|
| 551 | nm = fluct3d.MeanSigma2(rm,rs2);
|
---|
| 552 | PrtTim(">>>> End Converting mass into galaxy number or mass");
|
---|
[3329] | 553 |
|
---|
[3349] | 554 | if( !no_poisson ) {
|
---|
[3329] | 555 |
|
---|
| 556 | cout<<"\n--- Apply poisson on galaxy number"<<endl;
|
---|
| 557 | fluct3d.ApplyPoisson();
|
---|
[3349] | 558 | nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200);
|
---|
| 559 | nm = fluct3d.MeanSigma2(rm,rs2);
|
---|
[3329] | 560 | double xgalmin,xgalmax; fluct3d.MinMax(xgalmin,xgalmax,0.1,1.e50);
|
---|
| 561 | PrtTim(">>>> End Apply poisson on galaxy number");
|
---|
| 562 | if(wslice) {
|
---|
| 563 | fluct3d.WriteSlicePPF("cmvobserv3d_s_rn.ppf");
|
---|
| 564 | PrtTim(">>>> End WriteSlicePPF");
|
---|
[3322] | 565 | }
|
---|
[3329] | 566 |
|
---|
| 567 | cout<<"\n--- Convert Galaxy number to HI mass"<<endl;
|
---|
| 568 | double mhi = 0.;
|
---|
| 569 | if(use_schmassdist) {
|
---|
| 570 | if(recompute_schmassdist) {
|
---|
| 571 | int ngalmax = int(xgalmax+0.5);
|
---|
| 572 | schmdist.SetNgalLim(ngalmax,1,naleagal);
|
---|
| 573 | PrtTim(">>>> End creating tabulated histograms for trials");
|
---|
| 574 | }
|
---|
| 575 | mhi = fluct3d.TurnNGal2MassQuick(schmdist);
|
---|
| 576 | schmdist.PrintStatus();
|
---|
| 577 | } else {
|
---|
| 578 | mhi = fluct3d.TurnNGal2Mass(tirhmdndm,true);
|
---|
| 579 | }
|
---|
| 580 | cout<<mhi<<" MSol in survey / "<<mass_by_mpc3*fluct3d.GetVol()<<endl;
|
---|
[3349] | 581 | nm = fluct3d.MeanSigma2(rm,rs2,0.,1e200);
|
---|
[3329] | 582 | cout<<"Equivalent: "<<rm*nm/fluct3d.NPix()<<" Msol / pixels"<<endl;
|
---|
[3349] | 583 | nm = fluct3d.MeanSigma2(rm,rs2);
|
---|
[3329] | 584 | PrtTim(">>>> End Convert Galaxy number to HI mass");
|
---|
| 585 |
|
---|
[3115] | 586 | }
|
---|
| 587 |
|
---|
[3351] | 588 | //-----------------------------------------------------------------
|
---|
[3155] | 589 | if(wfits) {
|
---|
| 590 | fluct3d.WriteFits("!cmvobserv3d_r.fits");
|
---|
| 591 | PrtTim(">>>> End WriteFits");
|
---|
| 592 | }
|
---|
| 593 | if(wppf) {
|
---|
| 594 | fluct3d.WritePPF("cmvobserv3d_r.ppf",true);
|
---|
| 595 | PrtTim(">>>> End WritePPF");
|
---|
| 596 | }
|
---|
[3281] | 597 | if(wslice) {
|
---|
| 598 | fluct3d.WriteSlicePPF("cmvobserv3d_s_r.ppf");
|
---|
| 599 | PrtTim(">>>> End WriteSlicePPF");
|
---|
| 600 | }
|
---|
[3120] | 601 |
|
---|
[3329] | 602 | //-----------------------------------------------------------------
|
---|
[3349] | 603 | ////if(do_agn) {
|
---|
| 604 | //// cout<<"\n--- Add AGN: <log10(S Jy)>="<<lfjy_agn<<" , sigma="<<lsigma_agn
|
---|
| 605 | //// <<" , powlaw="<<powlaw_agn<<endl;
|
---|
| 606 | //// fluct3d.AddAGN(lfjy_agn,lsigma_agn,powlaw_agn);
|
---|
| 607 | //// nm = fluct3d.MeanSigma2(rm,rs2);
|
---|
| 608 | //// PrtTim(">>>> End Add AGN");
|
---|
| 609 | ////}
|
---|
[3196] | 610 |
|
---|
[3329] | 611 | //-----------------------------------------------------------------
|
---|
[3330] | 612 | double snoisesave = 0.;
|
---|
[3193] | 613 | if(snoise>0.) {
|
---|
[3331] | 614 | cout<<"\n--- Add noise to HI Flux snoise="<<snoise<<", evolution="<<noise_evol<<endl;
|
---|
| 615 | fluct3d.AddNoise2Real(snoise,noise_evol);
|
---|
[3330] | 616 | snoisesave = snoise;
|
---|
[3262] | 617 | nm = fluct3d.MeanSigma2(rm,rs2);
|
---|
[3193] | 618 | PrtTim(">>>> End Add noise");
|
---|
| 619 | }
|
---|
[3115] | 620 |
|
---|
[3349] | 621 | //-----------------------------------------------------------------
|
---|
[3351] | 622 | if(scalemass!=0. && scalemass!=1.) { // Si scalemass==0 pas de normalisation
|
---|
| 623 | if(scalemass<0.) scalemass = 1. / (-scalemass * mass_by_pixel);
|
---|
| 624 | cout<<"\n--- Scale cube scale="<<scalemass<<endl;
|
---|
| 625 | fluct3d.ScaleOffset(scalemass);
|
---|
| 626 | snoisesave *= scalemass;
|
---|
[3322] | 627 | nm = fluct3d.MeanSigma2(rm,rs2);
|
---|
| 628 | PrtTim(">>>> End Scale cube");
|
---|
[3283] | 629 | }
|
---|
[3351] | 630 |
|
---|
| 631 | //-----------------------------------------------------------------
|
---|
[3199] | 632 | if(wfits) {
|
---|
| 633 | fluct3d.WriteFits("!cmvobserv3d_rf.fits");
|
---|
| 634 | PrtTim(">>>> End WriteFits");
|
---|
| 635 | }
|
---|
| 636 | if(wppf) {
|
---|
| 637 | fluct3d.WritePPF("cmvobserv3d_rf.ppf",true);
|
---|
| 638 | PrtTim(">>>> End WritePPF");
|
---|
| 639 | }
|
---|
[3281] | 640 | if(wslice) {
|
---|
| 641 | fluct3d.WriteSlicePPF("cmvobserv3d_s_rf.ppf");
|
---|
| 642 | PrtTim(">>>> End WriteSlicePPF");
|
---|
| 643 | }
|
---|
[3199] | 644 |
|
---|
[3115] | 645 | //-----------------------------------------------------------------
|
---|
| 646 | // -- NE PAS FAIRE CA SI ON VEUT CONTINUER LA SIMULATION -> d_rho/rho ecrase
|
---|
[3141] | 647 |
|
---|
[3289] | 648 | cout<<endl<<"\n--- ReComputing spectrum from real space"<<endl;
|
---|
| 649 | fluct3d.ReComputeFourier();
|
---|
| 650 | PrtTim(">>>> End ReComputing spectrum");
|
---|
[3141] | 651 |
|
---|
[3155] | 652 | if(wfits) {
|
---|
| 653 | fluct3d.WriteFits("!cmvobserv3d_k.fits");
|
---|
| 654 | PrtTim(">>>> End WriteFits");
|
---|
| 655 | }
|
---|
| 656 | if(wppf) {
|
---|
| 657 | fluct3d.WritePPF("cmvobserv3d_k.ppf",false);
|
---|
| 658 | PrtTim(">>>> End WritePPF");
|
---|
| 659 | }
|
---|
[3154] | 660 |
|
---|
[3289] | 661 | cout<<endl<<"\n--- Computing final spectrum"<<endl;
|
---|
[3330] | 662 | HistoErr hpkrecb(0.,knyqmax,nherr); hpkrecb.Zero();
|
---|
| 663 | hpkrecb.ReCenterBin();
|
---|
| 664 | hpkrecb.Show();
|
---|
| 665 | fluct3d.ComputeSpectrum(hpkrecb);
|
---|
| 666 | {
|
---|
| 667 | tagobs = "hpkrecb"; posobs.PutObject(hpkrecb,tagobs);
|
---|
| 668 | }
|
---|
[3289] | 669 | PrtTim(">>>> End Computing final spectrum");
|
---|
[3115] | 670 |
|
---|
[3330] | 671 | cout<<endl<<"\n--- Computing final spectrum with pixel deconv."<<endl;
|
---|
| 672 | HistoErr hpkrec(hpkrecb); hpkrec.Zero();
|
---|
| 673 | fluct3d.ComputeSpectrum(hpkrec,snoisesave,filter_by_pixel);
|
---|
| 674 | {
|
---|
| 675 | tagobs = "hpkrec"; posobs.PutObject(hpkrec,tagobs);
|
---|
| 676 | }
|
---|
| 677 | PrtTim(">>>> End Computing final spectrum with pixel deconv.");
|
---|
| 678 |
|
---|
[3154] | 679 | if(comp2dspec) {
|
---|
[3141] | 680 | cout<<"\n--- Computing final 2D spectrum"<<endl;
|
---|
[3330] | 681 | Histo2DErr hpkrecb2(0.,ktnyqmax,nherrt,0.,kznyqmax,nherrz);
|
---|
| 682 | hpkrecb2.ReCenterBin(); hpkrecb2.Zero();
|
---|
| 683 | hpkrecb2.Show();
|
---|
| 684 | fluct3d.ComputeSpectrum2D(hpkrecb2);
|
---|
[3141] | 685 | {
|
---|
[3330] | 686 | tagobs = "hpkrecb2"; posobs.PutObject(hpkrecb2,tagobs);
|
---|
| 687 | }
|
---|
| 688 | PrtTim(">>>> End Computing final 2D spectrum");
|
---|
| 689 |
|
---|
| 690 | cout<<"\n--- Computing final 2D spectrum with pixel deconv."<<endl;
|
---|
| 691 | Histo2DErr hpkrec2(hpkrecb2); hpkrec2.Zero();
|
---|
| 692 | fluct3d.ComputeSpectrum2D(hpkrec2,snoisesave,filter_by_pixel);
|
---|
| 693 | {
|
---|
[3141] | 694 | tagobs = "hpkrec2"; posobs.PutObject(hpkrec2,tagobs);
|
---|
| 695 | }
|
---|
[3330] | 696 | PrtTim(">>>> End Computing final 2D spectrum with pixel deconv.");
|
---|
| 697 |
|
---|
[3141] | 698 | }
|
---|
| 699 |
|
---|
[3155] | 700 | PrtTim(">>>> End Of Job");
|
---|
[3115] | 701 | return 0;
|
---|
| 702 | }
|
---|
| 703 |
|
---|