Coverage for src/galsbi/ucat/config/common.py: 100%

164 statements  

« prev     ^ index     » next       coverage.py v7.10.4, created at 2025-08-18 15:15 +0000

1# Copyright (C) 2018 ETH Zurich, Institute for Particle Physics and Astrophysics 

2 

3""" 

4Created on Mar 5, 2018 

5author: Joerg Herbel 

6""" 

7 

8import numpy as np 

9 

10# ================================================================== 

11# G E N E R A L 

12# ================================================================== 

13 

14# Filter bands (multi-band only) 

15filters = ["g", "r", "i", "z", "y"] 

16# Filters full names 

17filters_full_names = { 

18 "B": "SuprimeCam_B", 

19 "g": "HSC_g", 

20 "r": "HSC_r2", 

21 "i": "HSC_i2", 

22 "z": "HSC_z", 

23 "y": "HSC_y", 

24} 

25reference_band = "i" 

26 

27# Seeds 

28# --------------------- 

29# General seed set when initializing UFig 

30seed = 102301239 

31# Seed offset set before sampling the number of galaxies 

32gal_num_seed_offset = 100 

33# Seed offset set before drawing from luminosity function 

34gal_lum_fct_seed_offset = 1200 

35# Seed offset set before sampling galaxy positions 

36gal_dist_seed_offset = 200 

37# Seed offset set before sampling the galaxies' Sersic indices distribution 

38gal_sersic_seed_offset = 300 

39# Seed offset set before sampling the galaxies' ellipticity distribution 

40gal_ellipticities_seed_offset = 400 

41# Seed to make redshift addition deterministic 

42seed_ngal = 500 

43 

44# Sampling and other general parameters 

45# ------------------------------------- 

46# Sampling mode for galaxy catalog, either "wcs" (for image simulations) or "healpix" 

47sampling_mode = "wcs" 

48# healpy map for healpix sampling 

49healpix_map = None 

50# Healpix pixelization for sampling 

51nside_sampling = 512 

52# Remote directory containing maps 

53maps_remote_dir = "ufig_res/maps/" 

54# galaxy_catalog_name 

55galaxy_catalog_name = "ucat_galaxies.h5" 

56# galaxy_sed_catalog_name 

57galaxy_sed_catalog_name = "ucat_galaxies_sed.h5" 

58# star_catalog_name 

59star_catalog_name = "ucat_stars.h5" 

60# by how much the number of galaxies should be multiplied (used to test high or low 

61# blending regimes) 

62ngal_multiplier = 1 

63# if to enrich the catalog by parameters such as bkg, absolute ellipticity, etc. 

64enrich_catalog = False 

65 

66# ================================================================== 

67# I M A G E P R O P E R T I E S 

68# ================================================================== 

69 

70# Number of pixels on image x-axis 

71size_x = 10000 

72# Number of pixels on image y-axis 

73size_y = 10000 

74# Center of field (RA) 

75ra0 = 70.459787 

76# Center of field (Dec) 

77dec0 = -44.244444 

78# Pixel scale (arcsec/pixel) 

79pixscale = 0.263 

80 

81 

82# ================================================================== 

83# C O S M O L O G Y 

84# ================================================================== 

85 

86# Reduced Hubble parameter 

87h = 0.7 

88# Matter density 

89omega_m = 0.3 

90# Dark energy density 

91omega_l_in = "flat" 

92 

93# ================================================================== 

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

95# ================================================================== 

96 

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

98# Luminosity function 

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

100 

101# Galaxy type, each will have its own luminosity functions (see luminosity_functions.py: 

102# GALAXY_TYPES_ALL, initialize_luminosity_functions) 

103galaxy_types = ["red", "blue"] 

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

105# logpower (for logarithmic and power law) 

106lum_fct_parametrization = "linexp" 

107# Filter band in which the luminosity function is valid 

108lum_fct_filter_band = "B" 

109# Schechter parameter alpha for blue galaxies 

110lum_fct_alpha_blue = -1.3 

111# Schechter parameter alpha for red galaxies 

112lum_fct_alpha_red = -0.5 

113# Parameter a in M*(z) = a*z + b for blue galaxies (if linexp), 

114# M*(z) = a*log(1+z) + b (if logpower), M*: Schechter parameter 

115lum_fct_m_star_blue_slope = -0.9408582 

116# Parameter b in M*(z) = a*z + b for blue galaxies (if linexp), 

117# M*(z) = a*log(1+z) + b (if logpower), M*: Schechter parameter 

118lum_fct_m_star_blue_intcpt = -20.40492365 

119# Parameter a in M*(z) = a*z + b for red galaxies (if linexp), 

120# M*(z) = a*log(1+z) + b (if logpower), M*: Schechter parameter 

121lum_fct_m_star_red_slope = -0.70798041 

122# Parameter b in M*(z) = a*z + b for red galaxies (if linexp), 

123# M*(z) = a*log(1+z) + b (if logpower), M*: Schechter parameter 

124lum_fct_m_star_red_intcpt = -20.37196157 

125# Parameter a in phi*(z) = a * exp(bz) for blue galaxies (if linexp), 

126# phi*(z) = a*(1+z)**b (if logpower), phi*: Schechter parameter 

127lum_fct_phi_star_blue_amp = 0.00370253 

128# Parameter b in phi*(z) = a * exp(bz) for blue galaxies (if linexp), 

129# phi*(z) = a*(1+z)**b (if logpower), phi*: Schechter parameter 

130lum_fct_phi_star_blue_exp = -0.10268436 

131# Parameter a in phi*(z) = a * exp(bz) for red galaxies(if linexp), 

132# phi*(z) = a*(1+z)**b (if logpower), phi*: Schechter parameter 

133lum_fct_phi_star_red_amp = 0.0035097 

134# Parameter b in phi*(z) = a * exp(bz) for red galaxies (if linexp), 

135# phi*(z) = a*(1+z)**b (if logpower), phi*: Schechter parameter 

136lum_fct_phi_star_red_exp = -0.70596888 

137# Parameter controlling the redshift after which M* for blue galaxies is constant 

138# if the lum_fct_parametrization = truncated_logexp 

139lum_fct_z_const_blue = 4 

140# Parameter controlling the redshift after which M* for red galaxies is constant 

141# if the lum_fct_parametrization = truncated_logexp 

142lum_fct_z_const_red = 4 

143# Resolution for sampling redshift 

144lum_fct_z_res = 0.001 

145# Maximum redshift of galaxies to sample 

146lum_fct_z_max = 3 

147# Maximum absolute magnitude to be sampled 

148lum_fct_m_max = -5 

149# Resolution for sampling absolute magnitudes 

150lum_fct_m_res = 0.001 

151# Maximum number of blue galaxies in one healpix pixel. This parameter has the function 

152# to limit runtime for ABC runs. A reasonable value critically depends on the healpix 

153# pixelization and the maximum absolute and apparent magnitudes. 

154n_gal_max_blue = np.inf 

155# Same as parameter above for red galaxies. 

156n_gal_max_red = np.inf 

157# If to raise an exception if the above limits are reached, or just to finish the 

158# calculation and continue 

159raise_max_num_gal_error = True 

160# Raise an error if there are some galaxies that are fainter than specified 

161raise_z_m_interp_error = False 

162# Memory limit for the size of the catalog in Mb (assuming 10 float64 columns per 

163# catalog), if reached, the UCatNumGalError is thrown, prevents jobs from crashing 

164max_memlimit_gal_catalog = np.inf 

165# Precision of the catalog. 

166catalog_precision = np.float64 

167 

168 

169# ---------- 

170# Clustering 

171# ---------- 

172apply_clustering_for_galaxy_positions = False 

173 

174 

175# --------------------- 

176# Template coefficients 

177# --------------------- 

178# Template coefficients are drawn from Dirichlet distributions of order 5 separately for 

179# blue and red galaxies. 

180# The parameters alpha of these distributions evolve with redshift. The evolution is 

181# parameterized 10 parameters, separately for blue and red galaxies: 5 parameters at 

182# redshift 0 and 5 parameters at redshift z1 > 0. Dirichlet 

183# parameters are calculated separately for each galaxy according to 

184# alpha(z) = (alpha0)^(1-z/z1) * (alpha1)^(z/z1), 

185# where alpha is five-dimensional. Thus, alpha(z=0) = alpha0 and alpha(z=z1) = alpha1 

186# with a smooth transition in between. Finally, after drawing the coefficients, they are 

187# weighted separately along each dimension. 

188 

189# which sampling model to use. 

190# 'dirichlet': from Herbel et al. 2018, 

191# 'dirichlet_alpha_sum': enforce sum of alpha 

192# 'dirichlet_alpha_std': enforce standard deviation of alpha 

193# 'dirichlet_alpha_mode': use parameterisation with mode and standard deviation 

194template_coeff_sampler = "dirichlet" 

195# Redshift z1>0 for blue galaxies 

196template_coeff_z1_blue = 1 

197# Redshift z1>0 for red galaxies 

198template_coeff_z1_red = 1 

199# Dirichlet parameter for blue galaxies at z=0 

200template_coeff_alpha0_blue_0 = 1.9946549 

201# Dirichlet parameter for blue galaxies at z=0 

202template_coeff_alpha0_blue_1 = 1.99469164 

203# Dirichlet parameter for blue galaxies at z=0 

204template_coeff_alpha0_blue_2 = 1.99461187 

205# Dirichlet parameter for blue galaxies at z=0 

206template_coeff_alpha0_blue_3 = 1.9946589 

207# Dirichlet parameter for blue galaxies at z=0 

208template_coeff_alpha0_blue_4 = 1.99463069 

209# Dirichlet parameter for blue galaxies at z=z1 

210template_coeff_alpha1_blue_0 = template_coeff_alpha0_blue_0 

211# Dirichlet parameter for blue galaxies at z=z1 

212template_coeff_alpha1_blue_1 = template_coeff_alpha0_blue_1 

213# Dirichlet parameter for blue galaxies at z=z1 

214template_coeff_alpha1_blue_2 = template_coeff_alpha0_blue_2 

215# Dirichlet parameter for blue galaxies at z=z1 

216template_coeff_alpha1_blue_3 = template_coeff_alpha0_blue_3 

217# Dirichlet parameter for blue galaxies at z=z1 

218template_coeff_alpha1_blue_4 = template_coeff_alpha0_blue_4 

219# Dirichlet parameter for red galaxies at z=0 

220template_coeff_alpha0_red_0 = 1.62158197 

221# Dirichlet parameter for red galaxies at z=0 

222template_coeff_alpha0_red_1 = 1.62137391 

223# Dirichlet parameter for red galaxies at z=0 

224template_coeff_alpha0_red_2 = 1.62175061 

225# Dirichlet parameter for red galaxies at z=0 

226template_coeff_alpha0_red_3 = 1.62159144 

227# Dirichlet parameter for red galaxies at z=0 

228template_coeff_alpha0_red_4 = 1.62165971 

229# Dirichlet parameter for red galaxies at z=z1 

230template_coeff_alpha1_red_0 = template_coeff_alpha0_red_0 

231# Dirichlet parameter for red galaxies at z=z1 

232template_coeff_alpha1_red_1 = template_coeff_alpha0_red_1 

233# Dirichlet parameter for red galaxies at z=z1 

234template_coeff_alpha1_red_2 = template_coeff_alpha0_red_2 

235# Dirichlet parameter for red galaxies at z=z1 

236template_coeff_alpha1_red_3 = template_coeff_alpha0_red_3 

237# Dirichlet parameter for red galaxies at z=z1 

238template_coeff_alpha1_red_4 = template_coeff_alpha0_red_4 

239# std of the Dirichlet distribution for blue galaxies at z=0 

240template_coeff_alpha0_blue_std = 0.1 

241# std of the Dirichlet distribution for blue galaxies at z=z1 

242template_coeff_alpha1_blue_std = 0.1 

243# std of the Dirichlet distribution for red galaxies at z=0 

244template_coeff_alpha0_red_std = 0.1 

245# std of the Dirichlet distribution for red galaxies at z=z1 

246template_coeff_alpha1_red_std = 0.1 

247# Weights for blue and red galaxies applied after drawing the coefficients 

248template_coeff_weight_blue = np.array( 

249 [3.47116583e09, 3.31262983e06, 2.13298069e09, 1.63722853e10, 1.01368664e09] 

250) 

251template_coeff_weight_red = np.array( 

252 [3.84729278e09, 1.56768931e06, 3.91242928e08, 4.66363319e10, 3.03275998e07] 

253) 

254# If to store the SED in the catalog 

255save_SEDs = False 

256 

257# ------------------------------ 

258# Apparent magnitude calculation 

259# ------------------------------ 

260 

261# The way magnitudes are calculated 

262magnitude_calculation = "table" 

263# File containing filter throughputs 

264filters_file_name = "filters.h5" 

265# File containing template spectra 

266templates_file_name = "template_spectra.h5" 

267# File containing integration tables of template spectra for different filters 

268templates_int_tables_file_name = "template_integrals.h5" 

269# If True, copy the template integration table files to the current working directory 

270# (local scratch) 

271copy_template_int_tables_to_cwd = False 

272# Extinction map (expected to be in galactic coordinates) 

273extinction_map_file_name = "extinction.fits" 

274# Minimum galaxy magnitude cutoff 

275gals_mag_min = 16 

276# Maximum galaxy magnitude cutoff 

277gals_mag_max = 27 

278# Noise level corresponding to background flux, constant across bands (for abs mag 

279# calculation, see ABC for deepfields) 

280noise_const_abs_mag = None 

281# Redshift noise, z=sig*(1+z) Leigle et al 2015, doi:10.3847/0067-0049/224/2/24 

282noise_z_sigma = 0.007 

283# Redshift outlier fraction, from 0 to max_z present in catalog Leigle et al 2015, 

284# doi:10.3847/0067-0049/224/2/24 

285noise_z_outlier_fraction = 0.005 

286 

287# ------------------- 

288# Sersic distribution 

289# ------------------- 

290 

291# Mean sersic n for mag<20 galaxies 

292sersic_n_mean_low = 0.2 

293# RMS sersic n for mag<20 galaxies 

294sersic_n_sigma_low = 1 

295# 1st mean sersic n for mag>20 galaxies 

296sersic_n_mean_1_hi = 0.3 

297# 1st RMS sersic n for mag>20 galaxies 

298sersic_n_sigma_1_hi = 0.5 

299# 2nd mean sersic n for mag>20 galaxies 

300sersic_n_mean_2_hi = 1.6 

301# 2nd RMS sersic n for mag>20 galaxies 

302sersic_n_sigma_2_hi = 0.4 

303# Minimum sersic n cutoff 

304sersic_n_offset = 0.2 

305# Switch sampling methods for sersic index 

306# default = use default from Berge et al 2012 (sersic_n_mean_low, sersic_n_sigma_low, 

307# sersic_n_mean_1_hi, sersic_n_sigma_1_hi, sersic_n_mean_2_hi, sersic_n_sigma_2_hi, 

308# sersic_n_offset) 

309# blue_red_fixed = use sersic_index_blue for blue and sersic_index_red for red 

310# single = use sersic_single_value for all galaxies 

311# blue_red_betaprime = use the betaprime distribution with mode and size, limited by 

312# (0.2, 10) 

313sersic_sampling_method = "blue_red_betaprime" 

314# Fixed sersic index all galaxies in case sersic_sampling_method = single 

315sersic_single_value = 1.0 

316# Fixed sersic index for blue galaxies in case sersic_sampling_method = blue_red_fixed 

317sersic_index_blue = 1.0 

318# Fixed sersic index for red galaxies in case sersic_sampling_method = blue_red_fixed 

319sersic_index_red = 4.0 

320# Sersic_betaprime model, peak for blue galaxies 

321sersic_betaprime_blue_mode = 0.8 

322# Sersic_betaprime model, spread for blue galaxies 

323sersic_betaprime_blue_size = 5 

324# Sersic_betaprime model, slope of the redshift dependence 

325sersic_betaprime_blue_mode_alpha = 0 

326# Sersic_betaprime model, peak for red galaxies 

327sersic_betaprime_red_mode = 1.5 

328# Sersic_betaprime model, spread for red galaxies 

329sersic_betaprime_red_size = 50 

330# Sersic_betaprime model, slope of the redshift dependence 

331sersic_betaprime_red_mode_alpha = 0 

332# Sersic_betaprime model, minimum sersic index 

333sersic_n_min = 0.2 

334# Sersic_betaprime model, maximum sersic index 

335sersic_n_max = 10 

336 

337# ---------- 

338# Size model 

339# ---------- 

340# Physical sizes are sampled from a log-normal distribution and then transformed into 

341# apparent sizes using redshift and the input cosmology. The mean of the log of physical 

342# sizes depends linearly on the absolute magnitude of a galaxy: 

343# log(Mean physical sizes) = a * (Abs. mag.) + b 

344# The standard deviation of the distribution of the log of physical sizes is constant. 

345 

346# Method to sample sizes: 

347# "single" - for the same distribution for red and blue, or 

348# "red_blue" for separate parameters 

349# "sdss_fit" - for the SDSS fit from Shen et al. 2003 (in that case use the sdss_fit 

350# parameters) 

351logr50_sampling_method = "single" 

352# shift to the absolute magnitude for the mean physical size of galaxies 

353logr50_phys_M0 = -20 

354# Slope of the evolution of the log of the mean physical size of galaxies (a in eq. 

355# above) 

356logr50_phys_mean_slope = -0.24293465 

357# Intercept of the evolution of the log of the mean physical size of galaxies (b in eq. 

358# above) 

359logr50_phys_mean_intcpt = 1.2268735 

360# Standard deviation of the log of physical sizes 

361logr50_phys_std = 0.56800081 

362# logr50_phys_mean_slope for red galaxies 

363logr50_phys_mean_slope_red = -0.24293465 

364# logr50_phys_mean_intcpt for red galaxies 

365logr50_phys_mean_intcpt_red = 1.2268735 

366# logr50_phys_std for red galaxies 

367logr50_phys_std_red = 0.56800081 

368# logr50_phys_mean_slope for blue galaxies 

369logr50_phys_mean_slope_blue = -0.24293465 

370# logr50_phys_mean_intcpt for blue galaxies 

371logr50_phys_mean_intcpt_blue = 1.2268735 

372# logr50_phys_std for blue galaxies 

373logr50_phys_std_blue = 0.56800081 

374# redshift dependence scaling factor parametrized with (1+z)**alpha, also for sdss_fit 

375logr50_alpha = 0 

376logr50_alpha_red = 0 

377logr50_alpha_blue = 0 

378# SDSS fit parameters (defaults to measurements for Fig. 4 of Shen et al. 2003) 

379logr50_sdss_fit_sigma1_red = 0.48 

380logr50_sdss_fit_sigma2_red = 0.25 

381logr50_sdss_fit_M0_red = -20.52 

382logr50_sdss_fit_a_red = 0.6 

383logr50_sdss_fit_b_red = -4.63 

384logr50_sdss_fit_sigma1_blue = 0.48 

385logr50_sdss_fit_sigma2_blue = 0.25 

386logr50_sdss_fit_M0_blue = -20.52 

387logr50_sdss_fit_alpha_blue = 0.21 

388logr50_sdss_fit_beta_blue = 0.53 

389logr50_sdss_fit_gamma_blue = -1.31 

390 

391 

392# ------------------------ 

393# Ellipticity distribution 

394# ------------------------ 

395 

396# Mean galaxy e1 before PSF 

397e1_mean = 0 

398# RMS galaxy e1 before PSF 

399e1_sigma = 0.39 

400# Mean galaxy e2 before PSF 

401e2_mean = 0 

402# RMS galaxy e1 before PSF 

403e2_sigma = 0.39 

404# mean galaxy e1 for blue galaxies 

405e1_mean_blue = 0 

406# mean galaxy e2 for blue galaxies 

407e2_mean_blue = 0 

408# Sigma of a Gaussian for blue galaxies 

409ell_sigma_blue = 0.4600 

410# Sigma of a Gaussian for red galaxies 

411ell_sigma_red = 0.2 

412# Parameters for the ellipticity distribution for the 

413# ellipticity_sampling_method=blue_red_miller2013 

414ell_disc_log_a = -1.3708147902715042 

415ell_disc_emax = 0.8 

416ell_disc_min_e = 0.02 

417ell_disc_pow_alpha = 1 

418 

419ell_bulge_b = 2.368 

420ell_bulge_c = 6.691 

421 

422# Ratio of a and b parameters 

423ell_beta_ab_ratio = 0.57 

424# Mode of the ellipticity distribution 

425ell_beta_mode = 0.2 

426# Sum of a and b parameters of the beta distribution 

427ell_beta_ab_sum = 2.9 

428# Maximum ellipticity 

429ell_beta_emax = 0.98 

430# p(e) with beta_function and beta_function_mod for red galaxies: maximum ellipticity 

431ell_beta_mode_red = 0.2 

432# p(e) with beta_function and beta_function_mod for red galaxies: sum of a and b 

433# parameters of the beta distribution 

434ell_beta_ab_sum_red = 2.9 

435# p(e) with beta_function and beta_function_mode for blue galaxies: maximum ellipticity 

436ell_beta_mode_blue = 0.2 

437# p(e) with beta_function and beta_function_mode for blue galaxies: sum of a and b 

438# parameters of the beta distribution 

439ell_beta_ab_sum_blue = 2.9 

440 

441# Switch sampling methods for ellipticity: 

442# default = use single Gaussian (e*_mean, e*_sigma), 

443# blue_red = use separate Gaussians for blue and red (ell_sigma_blue, ell_sigma_red) 

444# blue_red_miller2013 = use functions from Miller et al 2013 (ell_disc_log_a, 

445# ell_disc_min_e, ell_bulge_b, ell_disc_pow_alpha) 

446# beta_ratio = use modified beta function (ell_beta_ab_ratio, ell_beta_ab_sum, 

447# ell_beta_emax) 

448# beta_mode = use modified beta function (ell_beta_mode, ell_beta_ab_sum, 

449# ell_beta_emax) 

450# beta_mode_red_blue = same as beta_function_mode, but for different parameters 

451# for red and blue 

452ellipticity_sampling_method = "beta_mode_red_blue" 

453 

454# ----- 

455# Shear 

456# ----- 

457 

458path_shear_map = None 

459 

460gamma1_sign = -1