Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96629815
d_rndz.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Dec 29, 05:59
Size
714 B
Mime Type
text/x-c
Expires
Tue, Dec 31, 05:59 (7 h, 10 m)
Engine
blob
Format
Raw Data
Handle
23219078
Attached To
R1448 Lenstool-HPC
d_rndz.c
View Options
#include<math.h>
#include<fonction.h>
/* -------------------------------------------------------------------
generate a redshift for a source in a homogeneous, non-evolutive universe.
normalized so that z < zmax.
-------------------------------------------------------------------*/
double d_rndz(double zmax, int *idum)
{
const extern struct g_cosmo C;
double zrnd, dl, prnd;
do
{
zrnd = pow(d_random(idum), 1.0 / 3.0) * zmax; /* majorating func.: */
prnd = zrnd * zrnd * d_random(idum); /* Euclidean static approx. */
dl = dlumcosmo1(zrnd);
}
while ( dl*dl / (pow(1.0 + zrnd, 3.0)*sqrt(1.0 + C.omegaM*zrnd))
< prnd);
return zrnd;
}
Event Timeline
Log In to Comment