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