Coverage for src / galsbi / ucat_sps / config / common_sps.py: 100%

206 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-12 16:31 +0000

1# Copyright (C) 2025 LMU Munich 

2# Author: Luca Tortorelli 

3# created: Apr 2025 

4 

5 

6import numpy as np 

7import PyCosmo 

8 

9from galsbi.ucat.config.common import h, omega_m 

10from galsbi.ucat_sps.galaxy_population_models.galaxy_star_formation_history import ( 

11 get_age_of_the_universe_from_redshift, 

12) 

13 

14# ================================================================== 

15# G A L A X Y C A T A L O G 

16# ================================================================== 

17 

18# --------------------- 

19# Stellar Mass Function 

20# --------------------- 

21 

22gal_sm_fct_seed_offset = 123491 

23SEED_OFFSET_SMFUN = 100 

24 

25# Functional forms of M* and phi*, can be linexp (linear and exponential) or 

26# logpower (for logarithmic and power law) 

27sm_fct_parametrization = "logquadratic_power" 

28# Resolution for sampling stellar mass 

29sm_fct_z_res = 0.001 

30# Maximum redshift of galaxies to sample 

31sm_fct_z_max = 5 

32# Minimum stellar mass to be sampled 

33sm_fct_sm_min = 8 

34# Resolution for sampling stellar masses 

35sm_fct_sm_res = 0.001 

36# Schechter parameter alpha for blue galaxies 

37sm_fct_alpha_blue_lowmass = -1.434 

38# Schechter parameter alpha for blue galaxies 

39sm_fct_alpha_blue_highmass = -0.123 

40# Schechter parameter alpha for red galaxies 

41sm_fct_alpha_red_lowmass = -2.01 

42# Schechter parameter alpha for red galaxies 

43sm_fct_alpha_red_highmass = -0.52 

44 

45# values from Weaver+23 

46sm_fct_m_star_blue_0_lowmass = 10.42822754 

47sm_fct_m_star_blue_1_lowmass = 2.75747512 

48sm_fct_m_star_blue_2_lowmass = -3.78410885 

49sm_fct_phi_star_blue_amp_lowmass = 0.00120151 

50sm_fct_phi_star_blue_exp_lowmass = -1.0522461 

51 

52sm_fct_m_star_blue_0_highmass = sm_fct_m_star_blue_0_lowmass 

53sm_fct_m_star_blue_1_highmass = sm_fct_m_star_blue_1_lowmass 

54sm_fct_m_star_blue_2_highmass = sm_fct_m_star_blue_2_lowmass 

55sm_fct_phi_star_blue_amp_highmass = 7.14975958e-04 

56sm_fct_phi_star_blue_exp_highmass = -1.35852989e00 

57 

58sm_fct_m_star_red_0_lowmass = 11.13180376 

59sm_fct_m_star_red_1_lowmass = -1.32213682 

60sm_fct_m_star_red_2_lowmass = 0.08538828 

61sm_fct_phi_star_red_amp_lowmass = 4.80658020e-05 

62sm_fct_phi_star_red_exp_lowmass = -6.00859413e00 

63 

64sm_fct_m_star_red_0_highmass = sm_fct_m_star_red_0_lowmass 

65sm_fct_m_star_red_1_highmass = sm_fct_m_star_red_1_lowmass 

66sm_fct_m_star_red_2_highmass = sm_fct_m_star_red_2_lowmass 

67sm_fct_phi_star_red_amp_highmass = 0.00133062 

68sm_fct_phi_star_red_exp_highmass = -0.84695455 

69 

70# ------------------- 

71# Size model (stellar mass) 

72# ------------------- 

73 

74SEED_OFFSET_SIZE = 700 

75 

76# Lognormal distribution as with luminosity but the mean is a function of stellar mass 

77# Default values from Nedkova+21 on GAMA galaxies 

78 

79r50_stellar_mass_logA_blue_intcpt = 0.86882979 

80r50_stellar_mass_logA_blue_slope = -0.16382979 

81r50_stellar_mass_B_blue_intcpt = 0.25182844 

82r50_stellar_mass_B_blue_slope = -0.05056433 

83 

84r50_stellar_mass_eta_red_intcpt = 0.11901468 

85r50_stellar_mass_eta_red_slope = -0.21145203 

86r50_stellar_mass_theta_red_intcpt = 1.68920793 

87r50_stellar_mass_theta_red_slope = -0.21753742 

88r50_stellar_mass_logzeta_red_intcpt = -1.12244718 

89r50_stellar_mass_logzeta_red_slope = 2.36436158 

90r50_stellar_mass_delta_red_intcpt = 10.96599095 

91r50_stellar_mass_delta_red_slope = -0.10815138 

92 

93# Standard deviation of the log of physical sizes, values from Shen+2003 

94logr50_stellar_mass_std_red = 0.3 

95logr50_stellar_mass_std_blue = 0.3 

96 

97# ------------------------ 

98# Velocity dispersion 

99# ------------------------ 

100 

101SEED_OFFSET_VELDISP = 800 

102 

103# default values from Zahid+16 

104vel_disp_logsigma_b = 2.073 

105vel_disp_logM_b = 10.26 

106vel_disp_s_1 = 0.403 

107vel_disp_s_2 = 0.293 

108vel_disp_std = 10 

109 

110# ---------------------- 

111# Star formation history 

112# ---------------------- 

113 

114time_step = 1e8 

115cosmo = PyCosmo.build() 

116cosmo.set(h=h, omega_m=omega_m) 

117time_grid = np.arange(0, get_age_of_the_universe_from_redshift(0, cosmo), time_step) 

118 

119SEED_OFFSET_SFH = 200 

120 

121# parameters for the snorm_trunc SFH parametrisation obtained from GAMA & DEVILS ata 

122 

123magemax_z0 = 13.4 

124mtrunc = 2 

125 

126logmpeak_massevo_slope_zevo_intcpt_red = -0.10385816 

127logmpeak_massevo_slope_zevo_slope_red = -1.52420053 

128 

129logmpeak_massevo_slope_zevo_intcpt_blue = 0.00648434 

130logmpeak_massevo_slope_zevo_slope_blue = -3.54384208 

131 

132logmpeak_massevo_intcpt_zevo_intcpt_red = 0.22328791 

133logmpeak_massevo_intcpt_zevo_slope_red = 15.14361675 

134 

135logmpeak_massevo_intcpt_zevo_intcpt_blue = -0.65466787 

136logmpeak_massevo_intcpt_zevo_slope_blue = 35.0180344 

137 

138logmperiod_massevo_intcpt_red = 1.19767 

139logmperiod_massevo_slope_red = -0.09370334 

140 

141logmperiod_massevo_intcpt_blue = 2.72710091 

142logmperiod_massevo_slope_blue = -0.21035425 

143 

144mskew_massevo_intcpt_red = -0.55390266 

145mskew_massevo_slope_red = 0.06286995 

146 

147mskew_massevo_intcpt_blue = 0.02656692 

148mskew_massevo_slope_blue = 0.01594687 

149 

150logmpeak_norm_min_blue = -3 

151logmpeak_norm_max_blue = 0.06 

152logmpeak_norm_min_red = -3 

153logmpeak_norm_max_red = 0.06 

154 

155logmperiod_min_blue = np.log10(0.3) 

156logmperiod_max_blue = 2 

157logmperiod_min_red = np.log10(0.3) 

158logmperiod_max_red = 2 

159 

160mskew_min_blue = -0.5 

161mskew_max_blue = 1.0 

162mskew_min_red = -0.5 

163mskew_max_red = 1.0 

164 

165sfh_shape_params_cov_blue = np.array( 

166 [ 

167 [0.4211092, -0.02020991, -0.05997905], 

168 [-0.02020991, 0.2025788, -0.07062304], 

169 [-0.05997905, -0.07062304, 0.12102846], 

170 ] 

171) 

172sfh_shape_params_cov_red = np.array( 

173 [ 

174 [0.51743558, -0.00445069, -0.06305345], 

175 [-0.00445069, 0.13260276, -0.0822066], 

176 [-0.06305345, -0.0822066, 0.09058901], 

177 ] 

178) 

179 

180# ---------------------- 

181# Surviving stellar mass emulator 

182# ---------------------- 

183 

184surviv_stellar_mass_emulator_property_scaler = "property_scaler_surv_sm_emulator.pkl" 

185surviv_stellar_mass_emulator_ssm_scaler = "ssm_scaler_surv_sm_emulator.pkl" 

186surviv_stellar_mass_emulator_model = "surv_sm_emulator.pt" 

187 

188# ---------------------- 

189# Prospect SED generator 

190# ---------------------- 

191 

192sed_generator = "Prospect" 

193ssp_library_filepath = "PG_Ch_Mi_C3K.fits" 

194filters_full_names_prospect = [ 

195 "g_HSC", 

196 "r_HSC", 

197 "i_HSC", 

198 "z_HSC", 

199 "Y_HSC", 

200 "u_SDSS", 

201 "Y_VISTA", 

202 "J_VISTA", 

203 "H_VISTA", 

204 "K_VISTA", 

205] 

206save_SEDs = False 

207full_resolution_SEDs = False 

208n_cores_for_sed_generation = 2 

209SOLAR_LUMINOSITY_ERG_S = 3.8275 * 10**33 

210MPC_TO_CM = 3.08567758128 * 10**24 

211LIGHTSPEED_ANGSTROM_S = 2.9979245800 * 10**18 

212 

213# ---------------------- 

214# ProMage magnitude emulator 

215# ---------------------- 

216 

217ProMage_model_filepath = "ProMage_GalSBI_SPS_HSC_mags.pt" 

218ProMage_property_scaler_filepath = "ProMage_GalSBI_SPS_HSC_mags_property_scaler.pkl" 

219ProMage_magnitude_scaler_filepath = "ProMage_GalSBI_SPS_HSC_mags_magnitude_scaler.pkl" 

220 

221# ---------------- 

222# Dust attenuation 

223# ---------------- 

224 

225SEED_OFFSET_DUSTATT = 500 

226 

227# logtauscreen limits from Thorne+2022 in place of Bellstedt+20 

228dust_attenuation_law = "CharlotFall2000" 

229logtaubirth_mean_blue = -0.10 

230logtaubirth_mean_red = -0.18 

231logtaubirth_scatter_blue = 0.24 

232logtaubirth_scatter_red = 0.21 

233logtaubirth_min = -2.5 

234logtaubirth_max = 1.5 

235 

236logtauscreen_a0_blue = -0.861 

237logtauscreen_a1_blue = 0.643 

238logtauscreen_a2_blue = 0.210 

239logtauscreen_a3_blue = 0.170 

240logtauscreen_scatter_blue = 0.247 

241 

242logtauscreen_a0_red = 0.850 

243logtauscreen_a1_red = 1.586 

244logtauscreen_a2_red = -0.174 

245logtauscreen_a3_red = -0.0083 

246logtauscreen_scatter_red = 0.417 

247 

248logtauscreen_min = -5 

249logtauscreen_max = 1 

250 

251# ---------------- 

252# Dust emission 

253# ---------------- 

254 

255SEED_OFFSET_DUSTEM = 600 

256 

257dust_emission_mean_blue = np.array([1.80, 1.70]) 

258dust_emission_mean_red = np.array([1.97, 1.91]) 

259dust_emission_cov_blue = np.array([[0.19, 0.12], [0.12, 0.20]]) 

260dust_emission_cov_red = np.array([[0.08, 0.02], [0.02, 0.16]]) 

261 

262# ------------------- 

263# Metallicity 

264# ------------------- 

265 

266# # SOLAR_GAS_METALLICITY = 0.0142 

267SOLAR_GAS_METALLICITY = ( 

268 0.02 # Aaron's suggestion to ensure compatibility with PROSPECT definitions 

269) 

270SOLAR_LOG_OH_PLUS12 = 8.69 

271SOLAR_STELLAR_METALLICITY = 0.02 

272SEED_OFFSET_ZGAS = 300 

273 

274# parametrization from Bellstedt+2021 

275# parameters for the scatter: Bellstedt+2021 

276gas_metallicity_scatter0_blue = 0.427 

277gas_metallicity_scatter1_blue = -0.02979 

278gas_metallicity_scatter2_blue = 0.0026182 

279gas_metallicity_scatter0_red = 0.427 

280gas_metallicity_scatter1_red = -0.02979 

281gas_metallicity_scatter2_red = 0.0026182 

282 

283gas_metallicity_alpha0_blue = -0.9202 

284gas_metallicity_alpha1_blue = 0.2916 

285gas_metallicity_alpha2_blue = -0.05082 

286gas_metallicity_beta0_blue = 1.198 

287gas_metallicity_beta1_blue = -0.2658 

288gas_metallicity_beta2_blue = 0.04884 

289gas_metallicity_gamma0_blue = -2.785 

290gas_metallicity_gamma1_blue = 2.268 

291gas_metallicity_gamma2_blue = -0.4267 

292gas_metallicity_alpha0_red = -0.9202 

293gas_metallicity_alpha1_red = 0.2916 

294gas_metallicity_alpha2_red = -0.05082 

295gas_metallicity_beta0_red = 1.198 

296gas_metallicity_beta1_red = -0.2658 

297gas_metallicity_beta2_red = 0.04884 

298gas_metallicity_gamma0_red = -2.785 

299gas_metallicity_gamma1_red = 2.268 

300gas_metallicity_gamma2_red = -0.4267 

301 

302# limits from Bellstedt+2021 

303Zgas_init = 0.0001 

304Zgas_max = 10 ** (-1.3) 

305 

306# -------------- 

307# Gas ionization 

308# -------------- 

309 

310SEED_OFFSET_LOGU = 400 

311 

312# parametrization from Kashino+2019 

313gas_ionization_upsilon0 = -2.316 

314gas_ionization_upsilon1 = -0.360 

315gas_ionization_upsilon2 = -0.292 

316gas_ionization_upsilon3 = 0.428 

317gas_ionization_scatter = 0.1 

318logUmin = -4 

319logUmax = -1 

320 

321# -------------- 

322# AGN 

323# -------------- 

324 

325SEED_OFFSET_AGN = 900 

326 

327abs_path_temple2021 = "qsogen" 

328add_agn_component = False 

329 

330logfagn_mu1_blue = -6.25 

331logfagn_sigma1_blue = 2 

332logfagn_mu2_blue = -0.75 

333logfagn_sigma2_blue = 0.8 

334 

335logfagn_mu1_red = -5.5 

336logfagn_sigma1_red = 1.75 

337logfagn_mu2_red = -0.25 

338logfagn_sigma2_red = 0.7 

339 

340alpha_AGN_03_z_08 = -0.25 

341alpha_AGN_08_z_15 = -0.19 

342alpha_AGN_15_z_25 = -0.03 

343 

344log_Mstar_AGN_03_z_08 = 10.99 

345log_Mstar_AGN_08_z_15 = 10.99 

346log_Mstar_AGN_15_z_25 = 10.99 

347 

348phi_star_AGN_03_z_08 = 10 ** (-3.83) 

349phi_star_AGN_08_z_15 = 10 ** (-3.54) 

350phi_star_AGN_15_z_25 = 10 ** (-3.84) 

351 

352logfagn_nohost_min = -10 

353logfagn_nohost_max = -1 

354 

355logfagn_host_min = -1 

356logfagn_host_max = 2 

357 

358# ------------------- 

359# Sersic distribution 

360# ------------------- 

361 

362sersic_sampling_method = "sersic_stellar_mass" 

363 

364# minimum sersic index 

365sersic_n_min = 0.2 

366# maximum sersic index 

367sersic_n_max = 10 

368 

369sersic_n_0_blue = 1.04269007 

370sersic_n_1_blue = 0.17637649 

371sersic_n_2_blue = 12.75004841 

372sersic_n_scatter_blue = 0.90902036 

373 

374sersic_n_0_red = 1.05421348 

375sersic_n_1_red = 1.45273864 

376sersic_n_2_red = 7.63380979 

377sersic_n_scatter_red = 1.4392298