source: Sophya/trunk/Cosmo/SimLSS/cmvtgrowth.cc@ 3768

Last change on this file since 3768 was 3768, checked in by cmv, 15 years ago
  • refonte du code pour creer uniquement des conditions initiales
  • introduction du tirage des vitesse LOS pour les redshift-distortion

cmv 03/05/2010

File size: 1.8 KB
RevLine 
[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
12#include "cosmocalc.h"
13#include "pkspectrum.h"
14
15void usage(void);
[3768]16void usage(void) {cout<<"cmvtgrowth z1,z2,nz [Omatter0,Lambda0]"<<endl;}
[3115]17
18int main(int narg,char *arg[])
19{
20
[3768]21 double z1=0., z2=10.;
22 int nz = 100;;
23 if(narg>1) sscanf(arg[1],"%lf,%lf,%d",&z1,&z2,&nz);
24 if(nz<=0) nz = 100;
25 double dz = (z2-z1)/nz;
26 cout<<"z1="<<z1<<" z2="<<z2<<" nz="<<nz<<" dz="<<dz<<endl;
[3115]27
28 double om0=0.267804, ol0=0.73;
29 if(narg>2) sscanf(arg[2],"%lf,%lf",&om0,&ol0);
30 cout<<"Om0="<<om0<<" Ol0="<<ol0<<endl;
31
32 GrowthFactor growth(om0,ol0);
33 cout<<"D1(z=0) = "<<growth(0.)<<endl;
34
[3768]35 const int n = 3;
36 const char *vname[n] = {"z","d1","d1dz"};
[3115]37 NTuple nt(n,vname);
38 double xnt[n];
39 for(double z=z1;z<z2+dz/2.;z+=dz) {
40 xnt[0] = z;
41 xnt[1] = growth(z);
[3768]42 xnt[2] = growth.DsDz(z,dz/2.);
[3115]43 nt.Fill(xnt);
44 }
45
46 cout<<">>>> Ecriture"<<endl;
47 string tag = "cmvtgrowth.ppf";
48 POutPersist pos(tag);
49 tag = "nt"; pos.PutObject(nt,tag);
50
51 return 0;
52}
53
54
55/*
56openppf cmvtgrowth.ppf
57
58set cut 1
59set cut z<5
60
[3768]61# --- growth
[3115]62n/plot nt.d1%z $cut ! "nsta connectpoints"
63n/plot nt.1./(1.+z)%z $cut ! "nsta connectpoints red same"
[3768]64
65# --- growth'/growth
66n/plot nt.d1dz/d1%z $cut ! "nsta connectpoints"
67n/plot nt.-1./(1.+z)%z $cut ! "nsta connectpoints red same"
68
69# --- d(growth)/dz
70zmin = 0.
71zmax = 10.
72set npt ${dv.size}
73dd = ($zmax-$zmin)/(${npt}-1.)
74exptovec dv nt d1
75c++exec for(int i=1;i<dv.Size(); i++) dv(i-1) = dv(i)-dv(i-1);
76
77n/plot nt.-1./pow(1.+z,2.)%z $cut ! "nsta connectpoints red"
78n/plot nt.d1dz%z $cut ! "nsta connectpoints same"
79n/plot dv.val/${dd}%${zmin}+(n+1)*$dd ! ! "nsta plusmarker5 green same"
80
[3115]81*/
Note: See TracBrowser for help on using the repository browser.