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