Changeset 3350 in Sophya for trunk/Cosmo/SimLSS


Ignore:
Timestamp:
Oct 11, 2007, 6:07:47 PM (18 years ago)
Author:
cmv
Message:

add cosmic variance and poisson noise estimate for Pk, cmv 11/10/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/SimLSS/cmvdefsurv.cc

    r3347 r3350  
    88#include <unistd.h>
    99
     10#include <vector>
     11
    1012#include "constcosmo.h"
    1113#include "cosmocalc.h"
    1214#include "geneutils.h"
    1315#include "schechter.h"
     16#include "pkspectrum.h"
    1417#include "planckspectra.h"
    1518
     
    2730void usage(void);
    2831void usage(void) {
    29   cout<<"cmvdefsurv [-r] -x adtx,atxlarg[,unit_x] -y adty,atylarg[,unit_y] -z dred,redlarg[,unit_z] redshift"<<endl
     32  cout<<"cmvdefsurv [options] -x adtx,atxlarg[,unit_x] -y adty,atylarg[,unit_y] -z dred,redlarg[,unit_z] redshift"<<endl
    3033      <<"----------------"<<endl
    3134      <<" -x adtx,atxlarg : resolution et largeur dans le plan transverse selon X"<<endl
     
    3740      <<"   \'F\' : en frequence (pour Z)    : resolution et largeur MHz"<<endl
    3841      <<"   \'M\' : en distance (pour X-Y-Z) : resolution et largeur Mpc"<<endl
     42      <<"----------------"<<endl
     43      <<" -K k,pk,dk : k(Mpc^-1) dk(Mpc^-1) pk(a z=0 en Mpc^-3) pour estimer la variance cosmique"<<endl
    3944      <<"----------------"<<endl
    4045      <<" -O surf,tobs : surface effective (m^2) et temps d\'observation (s)"<<endl
     
    8287 double redshift = 0.;
    8388 double tobs = 6000., surfeff = 400000.;
     89 // variance cosmique (default = standard SDSSII)
     90 double kcosm = 0.05, dkcosm = -1., pkcosm = 40000.;
    8491 // taille du lobe d'observation en arcmin pour la frequence
    8592 double lobewidth0 = -1., lobefreq0 = Fr_HyperFin_Par*1.e3;
     
    96103 // --- Decodage arguments
    97104 char c;
    98   while((c = getopt(narg,arg,"h2x:y:z:N:S:O:M:F:V:U:L:A:")) != -1) {
     105  while((c = getopt(narg,arg,"h2x:y:z:N:S:O:M:F:V:U:L:A:K:")) != -1) {
    99106  switch (c) {
    100107  case 'x' :
     
    137144  case 'A' :
    138145    sscanf(optarg,"%lf",&lflux_agn);
     146    break;
     147  case 'K' :
     148    sscanf(optarg,"%lf,%lf,%lf",&kcosm,&pkcosm,&dkcosm);
    139149    break;
    140150  case 'h' :
     
    158168 univ.Print(0.);
    159169 univ.Print(redshift);
     170 GrowthFactor growth(om0,ol0);
     171 double grothfac = growth(redshift);
     172 cout<<"Facteur de croissance lineaire = "<<grothfac
     173     <<" ^2 , ( 1/(1+z)="<<1./(1.+redshift)<<" )"<<endl;
    160174
    161175 double dang    = univ.Dang(redshift);
     
    291305 cout<<"Resolution: dk_z = "<<dk_z<<" Mpc^-1  (2Pi/dk_z="<<2.*M_PI/dk_z<<" Mpc)"<<endl;
    292306 cout<<"Nyquist:    kz = "<<knyq_z<<" Mpc^-1  (2Pi/knyq_z="<<2.*M_PI/knyq_z<<" Mpc)"<<endl;
     307
     308 // --- Variance cosmique
     309 //                      cosmique                    poisson
     310 // (sigma/P)^2 = 2*(2Pi)^3 / (4Pi dk Vsurvey) * [(1+n*P)/(n*P)]^2
     311 // nombre de mode = 1/2 * Vsurvey/(2Pi)^3 * 4Pi*k^2*dk
     312 if(kcosm>0. && pkcosm>0.) {
     313   double pk = pkcosm*pow(grothfac,2.);
     314   cout<<"\n>>>>\n>>>> variance cosmique pour k="<<kcosm<<" Mpc^-1, pk(z=0)="
     315       <<pkcosm<<", pk(z="<<redshift<<")="<<pk<<"\n>>>>"<<endl;
     316   for(int i=0;i<3;i++) {  // la correction de variance du au bruit de poisson
     317     double v = 1.1; if(i==1) v=1.5; if(i==2) v=2.0;
     318     double ngal = 1./(v-1.)/pk;
     319     cout<<"  pour "<<ngal<<" gal/Mpc^3 on multiplie par "<<v<<" sigma/P"<<endl;
     320   }
     321   vector<double> dk; if(dkcosm>0.) dk.push_back(dkcosm);
     322   dk.push_back(dk_x); dk.push_back(dk_y); dk.push_back(dk_z);
     323   for(int i=0;i<(int)dk.size();i++) { // la variance cosmique pure
     324     double vcosm = sqrt( 2.*pow(2.*M_PI,3.)/(4.*M_PI*dk[i]*vol) );
     325     double nmode = 0.5*vol/pow(2.*M_PI,3.) * 4.*M_PI*pow(kcosm,2.)*dk[i];
     326     cout<<"  pour dk = "<<dk[i]<<" Mpc^-1:  sigma/P = "<<vcosm
     327         <<" , Nmode = "<<nmode<<endl;
     328   }
     329 }
    293330
    294331 // --- Masse de HI
Note: See TracChangeset for help on using the changeset viewer.