Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97287087
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
Sat, Jan 4, 01:46
Size
714 B
Mime Type
text/x-c
Expires
Mon, Jan 6, 01:46 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23372376
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