Skip to content

Commit 8bd64d5

Browse files
committed
Renamed clustering parameters to avoid confusion and lowered clust at
low redshifts
1 parent da636dc commit 8bd64d5

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

src/egg-gencat.cpp

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ int phypp_main(int argc, char* argv[]) {
3434
double bin_dz = dnan;
3535

3636
// Clustering parameters
37-
double clust_r0 = 0.05; // clustering outer truncation radius in degree
38-
double clust_r1 = 0.0006; // clustering inner truncation radius in degree
39-
uint_t clust_eta = 5; // number of sub haloes per halo
40-
double clust_lambda = 6.0; // radius shrinking factor of subhaloes
41-
double clust_frnd_him = 0.4; // fraction of random vs clustered positions for
42-
// high-mass galaxies
43-
double clust_frnd_lom = 0.2; // fraction of random vs clustered positions for
44-
// low-mass galaxies
45-
double clust_frnd_mlim = 10.5; // threshold between high and low mass for the above
46-
double clust_urnd_mlim = 8.0; // threshold in mass below which there is no clustering
37+
double clust_r0 = 0.05; // clustering outer truncation radius in degree
38+
double clust_r1 = 0.0006; // clustering inner truncation radius in degree
39+
uint_t clust_eta = 5; // number of sub haloes per halo
40+
double clust_lambda = 6.0; // radius shrinking factor of subhaloes
41+
double clust_fclust_him = 0.4; // fraction of clustered vs uniform positions for
42+
// high-mass galaxies
43+
double clust_fclust_lom = 0.2; // fraction of clustered vs uniform positions for
44+
// low-mass galaxies
45+
double clust_fclust_mlim = 10.5; // threshold between high and low mass for the above
46+
double clust_urnd_mlim = 8.0; // threshold in mass below which there is no clustering
4747

4848
// Dispersion of the Main Sequence in SFR, at fixed Mstar
4949
// Changing this value will alter the quality of the simulation.
@@ -124,8 +124,8 @@ int phypp_main(int argc, char* argv[]) {
124124
name(out_file, "out"), name(filter_db_file, "filter_db"),
125125
verbose, name(tseed, "seed"), name(tcosmo, "cosmo"),
126126
name(input_cat_file, "input_cat"), selection_band, bands, rfbands, help, list_bands,
127-
clust_r0, clust_r1, clust_lambda, clust_eta, clust_frnd_mlim, clust_frnd_lom,
128-
clust_frnd_him, clust_urnd_mlim, magdis_tdust
127+
clust_r0, clust_r1, clust_lambda, clust_eta, clust_fclust_mlim, clust_fclust_lom,
128+
clust_fclust_him, clust_urnd_mlim, magdis_tdust
129129
));
130130

131131
if (help) {
@@ -978,13 +978,20 @@ int phypp_main(int argc, char* argv[]) {
978978

979979
vec1b cls = replicate(true, z_ngal);
980980

981-
// Each galaxy has a probability of not being clustered
982-
vec1d prnd = replicate(1-clust_frnd_lom, z_ngal);
981+
// Each galaxy has a probability of being clustered
982+
vec1d prnd = replicate(clust_fclust_lom, z_ngal);
983983
// We treat massive and low mass galaxies differently,
984984
// assuming more clustering for the most massive objects.
985-
prnd[where(out.m[idz] > clust_frnd_mlim)] = 1-clust_frnd_him;
985+
prnd[where(out.m[idz] > clust_fclust_mlim)] = clust_fclust_him;
986986
// and no clustering at all below a certain mass
987-
prnd[where(out.m[idz] < clust_urnd_mlim)] = 1;
987+
prnd[where(out.m[idz] < clust_urnd_mlim)] = 0;
988+
// then reduce clustering at low redshifts (Béthermin+15)
989+
{
990+
vec1u idlz = where(out.z[idz] < 1.0);
991+
prnd[idlz] *= max(0.0, out.z[idz[idlz]] - 0.5)/0.5;
992+
}
993+
994+
prnd = 1-prnd;
988995

989996
vec1u idr = where(random_coin(seed, prnd));
990997
uint_t nrnd = idr.size();

0 commit comments

Comments
 (0)