Skip to content

Commit 8a99af8

Browse files
committed
Re-introduced the "min_dz" option.
1 parent 2512dda commit 8a99af8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/egg-gencat.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ int phypp_main(int argc, char* argv[]) {
3333
// Define the redshift binning
3434
double bin_dz = 0.05;
3535
double max_dz = 0.5;
36+
double min_dz = 0.001;
3637

3738
// Clustering parameters
3839
double clust_r0 = 0.05; // clustering outer truncation radius in degree
@@ -117,7 +118,7 @@ int phypp_main(int argc, char* argv[]) {
117118
// Read command line arguments
118119
// ---------------------------
119120
read_args(argc, argv, arg_list(
120-
ra0, dec0, area, mmin, maglim, zmin, zmax, name(bin_dz, "dz"), max_dz,
121+
ra0, dec0, area, mmin, maglim, zmin, zmax, name(bin_dz, "dz"), min_dz, max_dz,
121122
name(bin_dm, "dm"), ms_disp,
122123
no_pos, no_clust, no_flux, no_stellar, no_dust, no_passive_lir, no_random,
123124
save_sed, name(mass_func_file, "mass_func"),
@@ -213,6 +214,11 @@ int phypp_main(int argc, char* argv[]) {
213214
return 1;
214215
}
215216

217+
if (min_dz > max_dz) {
218+
error("min_dz must be larger than max_dz (got ", min_dz, " and ", max_dz, ")");
219+
return 1;
220+
}
221+
216222
if (no_dust && no_stellar) {
217223
no_flux = true;
218224
}
@@ -640,7 +646,7 @@ int phypp_main(int argc, char* argv[]) {
640646
return make_bins(tzb);
641647
};
642648

643-
vec2d zb = make_zbins(zmin, zmax, bin_dz, dnan, max_dz);
649+
vec2d zb = make_zbins(zmin, zmax, bin_dz, min_dz, max_dz);
644650
uint_t nz = zb.dims[1];
645651

646652
if (verbose) {
@@ -1781,8 +1787,10 @@ void print_help() {
17811787
"magnitude cut is applied (default: none)");
17821788
argdoc("zmin", "[double]", "minimum redshift generated (default: 0.05)");
17831789
argdoc("zmax", "[double]", "maximum redshift generated (default: 10.5)");
1790+
argdoc("min_dz", "[double]", "minimum size of a redshift bin (default: 0.001)");
1791+
argdoc("max_dz", "[double]", "maximum size of a redshift bin (default: 0.5)");
17841792
argdoc("dz", "[double]", "size of a redshift bin, as a fraction of (1+z) "
1785-
"(default: zmin)");
1793+
"(default: 0.05)");
17861794
argdoc("dm", "[double, dex]", "size of a mass bin (default: 0.05)");
17871795
argdoc("ms_disp", "[double, dex]", "scatter of the main sequence (default: 0.3)");
17881796
print("");

0 commit comments

Comments
 (0)