Skip to content

Commit f6b4618

Browse files
committed
Tweaked the sizes
1 parent 8faf84b commit f6b4618

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

src/egg-gencat.cpp

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,48 +1068,54 @@ int phypp_main(int argc, char* argv[]) {
10681068
note("generating morphology...");
10691069
}
10701070

1071+
// Declare functions to assign sizes
1072+
auto size_disk = vectorize_lambda([](double z, double m) {
1073+
if (z < 1.7) {
1074+
return e10(0.41 - 0.22*log10(1.0+z) + 0.2*(min(m, 10.6) - 9.35));
1075+
} else {
1076+
return e10(0.62 - 0.7*log10(1.0+z) + 0.2*(min(m, 10.6) - 9.35));
1077+
}
1078+
});
1079+
1080+
auto size_bulge = vectorize_lambda([&size_disk](double z, double m, double bt) {
1081+
if (z < 0.5) {
1082+
return e10(0.78 - 0.6*log10(1.0+z) + 0.56*(m - 11.25));
1083+
} else {
1084+
return e10(0.90 - 1.3*log10(1.0+z) + 0.56*(m - 11.25));
1085+
}
1086+
});
1087+
10711088
// Bulge and disk have the same position angle, which is completely random
10721089
out.disk_angle = (randomu(seed, ngal) - 0.5)*90.0;
10731090
out.bulge_angle = out.disk_angle;
10741091

1075-
// Calibration from n>2.5 galaxies and M* > 10.5
1092+
// Bulges: calibration from n>2.5 galaxies and M* > 10.5
10761093
vec1f bulge_ratio_x =
10771094
{0.0, 0.1, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95, 1.0};
10781095
vec1f bulge_ratio_p =
10791096
{0.0, 0.0, 165.0, 428.0, 773.0, 914.0, 1069.0, 1191.0, 1154.0, 1067.0, 639.0, 450.0};
10801097
out.bulge_ratio = random_pdf(seed, bulge_ratio_x, bulge_ratio_p, ngal);
10811098

1082-
out.bulge_radius = 8.0*e10(-1.3*log10(1.0+out.z) + 0.56*(out.m - 11.25));
1099+
out.bulge_radius = size_bulge(out.z, out.m, out.bt);
10831100

10841101
if (!no_random) {
10851102
out.bulge_radius *= e10(0.2*randomn(seed, ngal));
10861103
}
10871104

1088-
// Calibration from n<1.5 galaxies and M* > 9.0
1105+
// Disks: calibration from n<1.5 galaxies and M* > 9.0
10891106
vec1f disk_ratio_x =
10901107
{0.0, 0.1, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95, 1.0};
10911108
vec1f disk_ratio_p =
10921109
{0.0, 0.0, 313.0, 900.0, 1143.0, 1127.0, 1059.0, 898.0, 775.0, 548.0, 318.0, 200.0};
10931110
out.disk_ratio = random_pdf(seed, disk_ratio_x, disk_ratio_p, ngal);
10941111

1095-
vec1f fz = -0.3*log10(1.0+out.z);
1096-
double zmid = 1.7;
1097-
vec1u idhz = where(out.z > zmid);
1098-
fz[idhz] = -0.7*log10((1.0 + out.z[idhz])/(1.0 + zmid)) - 0.3*log10(1.0 + zmid);
1099-
out.disk_radius = 2.8*e10(fz + 0.2*(out.m - 9.35));
1112+
out.disk_radius = size_disk(out.z, out.m);
11001113

11011114
if (!no_random) {
11021115
out.disk_radius *= e10(0.17*randomn(seed, ngal));
11031116
}
11041117

1105-
// Use similar size for bulges of disk-dominated galaxies
1106-
vec1u idd = where(out.bt < 0.5);
1107-
out.bulge_radius[idd] = 2.8*e10(fz[idd] + 0.2*(out.m[idd] - 9.35));
1108-
1109-
if (!no_random) {
1110-
out.bulge_radius[idd] *= e10(0.17*randomn(seed, idd.size()));
1111-
}
1112-
1118+
// Convert proper sizes to angular sizes
11131119
vec1d psize = propsize(out.z, cosmo);
11141120
out.disk_radius /= psize;
11151121
out.bulge_radius /= psize;

0 commit comments

Comments
 (0)