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

161 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2024-12-13 03:24 +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 = "ufig_galaxies.h5" 

56# star_catalog_name 

57star_catalog_name = "ufig_stars.h5" 

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

59# blending regimes) 

60ngal_multiplier = 1 

61 

62# ================================================================== 

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

64# ================================================================== 

65 

66# Number of pixels on image x-axis 

67size_x = 10000 

68# Number of pixels on image y-axis 

69size_y = 10000 

70# Center of field (RA) 

71ra0 = 70.459787 

72# Center of field (Dec) 

73dec0 = -44.244444 

74# Pixel scale (arcsec/pixel) 

75pixscale = 0.263 

76 

77 

78# ================================================================== 

79# C O S M O L O G Y 

80# ================================================================== 

81 

82# Reduced Hubble parameter 

83h = 0.7 

84# Matter density 

85omega_m = 0.3 

86# Dark energy density 

87omega_l_in = "flat" 

88 

89# ================================================================== 

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

91# ================================================================== 

92 

93# ------------------- 

94# Luminosity function 

95# ------------------- 

96 

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

98# GALAXY_TYPES_ALL, initialize_luminosity_functions) 

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

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

101# logpower (for logarithmic and power law) 

102lum_fct_parametrization = "linexp" 

103# Filter band in which the luminosity function is valid 

104lum_fct_filter_band = "B" 

105# Schechter parameter alpha for blue galaxies 

106lum_fct_alpha_blue = -1.3 

107# Schechter parameter alpha for red galaxies 

108lum_fct_alpha_red = -0.5 

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

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

111lum_fct_m_star_blue_slope = -0.9408582 

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

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

114lum_fct_m_star_blue_intcpt = -20.40492365 

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

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

117lum_fct_m_star_red_slope = -0.70798041 

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

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

120lum_fct_m_star_red_intcpt = -20.37196157 

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

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

123lum_fct_phi_star_blue_amp = 0.00370253 

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

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

126lum_fct_phi_star_blue_exp = -0.10268436 

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

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

129lum_fct_phi_star_red_amp = 0.0035097 

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

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

132lum_fct_phi_star_red_exp = -0.70596888 

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

134# if the lum_fct_parametrization = truncated_logexp 

135lum_fct_z_const_blue = 4 

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

137# if the lum_fct_parametrization = truncated_logexp 

138lum_fct_z_const_red = 4 

139# Resolution for sampling redshift 

140lum_fct_z_res = 0.001 

141# Maximum redshift of galaxies to sample 

142lum_fct_z_max = 3 

143# Maximum absolute magnitude to be sampled 

144lum_fct_m_max = -5 

145# Resolution for sampling absolute magnitudes 

146lum_fct_m_res = 0.001 

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

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

149# pixelization and the maximum absolute and apparent magnitudes. 

150n_gal_max_blue = np.inf 

151# Same as parameter above for red galaxies. 

152n_gal_max_red = np.inf 

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

154# calculation and continue 

155raise_max_num_gal_error = True 

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

157raise_z_m_interp_error = False 

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

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

160max_memlimit_gal_catalog = 2000 

161# Precision of the catalog. 

162catalog_precision = np.float64 

163 

164 

165# ---------- 

166# Clustering 

167# ---------- 

168apply_clustering_for_galaxy_positions = False 

169 

170 

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

172# Template coefficients 

173# --------------------- 

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

175# blue and red galaxies. 

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

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

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

179# parameters are calculated separately for each galaxy according to 

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

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

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

183# weighted separately along each dimension. 

184 

185# which sampling model to use. 

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

187# 'dirichlet_alpha_sum': enforce sum of alpha 

188# 'dirichlet_alpha_std': enforce standard deviation of alpha 

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

190template_coeff_sampler = "dirichlet" 

191# Redshift z1>0 for blue galaxies 

192template_coeff_z1_blue = 1 

193# Redshift z1>0 for red galaxies 

194template_coeff_z1_red = 1 

195# Dirichlet parameter for blue galaxies at z=0 

196template_coeff_alpha0_blue_0 = 1.9946549 

197# Dirichlet parameter for blue galaxies at z=0 

198template_coeff_alpha0_blue_1 = 1.99469164 

199# Dirichlet parameter for blue galaxies at z=0 

200template_coeff_alpha0_blue_2 = 1.99461187 

201# Dirichlet parameter for blue galaxies at z=0 

202template_coeff_alpha0_blue_3 = 1.9946589 

203# Dirichlet parameter for blue galaxies at z=0 

204template_coeff_alpha0_blue_4 = 1.99463069 

205# Dirichlet parameter for blue galaxies at z=z1 

206template_coeff_alpha1_blue_0 = template_coeff_alpha0_blue_0 

207# Dirichlet parameter for blue galaxies at z=z1 

208template_coeff_alpha1_blue_1 = template_coeff_alpha0_blue_1 

209# Dirichlet parameter for blue galaxies at z=z1 

210template_coeff_alpha1_blue_2 = template_coeff_alpha0_blue_2 

211# Dirichlet parameter for blue galaxies at z=z1 

212template_coeff_alpha1_blue_3 = template_coeff_alpha0_blue_3 

213# Dirichlet parameter for blue galaxies at z=z1 

214template_coeff_alpha1_blue_4 = template_coeff_alpha0_blue_4 

215# Dirichlet parameter for red galaxies at z=0 

216template_coeff_alpha0_red_0 = 1.62158197 

217# Dirichlet parameter for red galaxies at z=0 

218template_coeff_alpha0_red_1 = 1.62137391 

219# Dirichlet parameter for red galaxies at z=0 

220template_coeff_alpha0_red_2 = 1.62175061 

221# Dirichlet parameter for red galaxies at z=0 

222template_coeff_alpha0_red_3 = 1.62159144 

223# Dirichlet parameter for red galaxies at z=0 

224template_coeff_alpha0_red_4 = 1.62165971 

225# Dirichlet parameter for red galaxies at z=z1 

226template_coeff_alpha1_red_0 = template_coeff_alpha0_red_0 

227# Dirichlet parameter for red galaxies at z=z1 

228template_coeff_alpha1_red_1 = template_coeff_alpha0_red_1 

229# Dirichlet parameter for red galaxies at z=z1 

230template_coeff_alpha1_red_2 = template_coeff_alpha0_red_2 

231# Dirichlet parameter for red galaxies at z=z1 

232template_coeff_alpha1_red_3 = template_coeff_alpha0_red_3 

233# Dirichlet parameter for red galaxies at z=z1 

234template_coeff_alpha1_red_4 = template_coeff_alpha0_red_4 

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

236template_coeff_alpha0_blue_std = 0.1 

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

238template_coeff_alpha1_blue_std = 0.1 

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

240template_coeff_alpha0_red_std = 0.1 

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

242template_coeff_alpha1_red_std = 0.1 

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

244template_coeff_weight_blue = np.array( 

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

246) 

247template_coeff_weight_red = np.array( 

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

249) 

250 

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

252# Apparent magnitude calculation 

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

254 

255# The way magnitudes are calculated 

256magnitude_calculation = "table" 

257# File containing filter throughputs 

258filters_file_name = "filters.h5" 

259# File containing template spectra 

260templates_file_name = "template_spectra.h5" 

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

262templates_int_tables_file_name = "template_integrals.h5" 

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

264# (local scratch) 

265copy_template_int_tables_to_cwd = False 

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

267extinction_map_file_name = "extinction.fits" 

268# Minimum galaxy magnitude cutoff 

269gals_mag_min = 16 

270# Maximum galaxy magnitude cutoff 

271gals_mag_max = 27 

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

273# calculation, see ABC for deepfields) 

274noise_const_abs_mag = None 

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

276noise_z_sigma = 0.007 

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

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

279noise_z_outlier_fraction = 0.005 

280 

281# ------------------- 

282# Sersic distribution 

283# ------------------- 

284 

285# Mean sersic n for mag<20 galaxies 

286sersic_n_mean_low = 0.2 

287# RMS sersic n for mag<20 galaxies 

288sersic_n_sigma_low = 1 

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

290sersic_n_mean_1_hi = 0.3 

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

292sersic_n_sigma_1_hi = 0.5 

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

294sersic_n_mean_2_hi = 1.6 

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

296sersic_n_sigma_2_hi = 0.4 

297# Minimum sersic n cutoff 

298sersic_n_offset = 0.2 

299# Switch sampling methods for sersic index 

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

301# sersic_n_mean_1_hi, sersic_n_sigma_1_hi, sersic_n_mean_2_hi, sersic_n_sigma_2_hi, 

302# sersic_n_offset) 

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

304# single = use sersic_single_value for all galaxies 

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

306# (0.2, 10) 

307sersic_sampling_method = "blue_red_betaprime" 

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

309sersic_single_value = 1.0 

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

311sersic_index_blue = 1.0 

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

313sersic_index_red = 4.0 

314# Sersic_betaprime model, peak for blue galaxies 

315sersic_betaprime_blue_mode = 0.8 

316# Sersic_betaprime model, spread for blue galaxies 

317sersic_betaprime_blue_size = 5 

318# Sersic_betaprime model, slope of the redshift dependence 

319sersic_betaprime_blue_mode_alpha = 0 

320# Sersic_betaprime model, peak for red galaxies 

321sersic_betaprime_red_mode = 1.5 

322# Sersic_betaprime model, spread for red galaxies 

323sersic_betaprime_red_size = 50 

324# Sersic_betaprime model, slope of the redshift dependence 

325sersic_betaprime_red_mode_alpha = 0 

326# Sersic_betaprime model, minimum sersic index 

327sersic_n_min = 0.2 

328# Sersic_betaprime model, maximum sersic index 

329sersic_n_max = 10 

330 

331# ---------- 

332# Size model 

333# ---------- 

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

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

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

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

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

339 

340# Method to sample sizes: 

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

342# "red_blue" for separate parameters 

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

344# parameters) 

345logr50_sampling_method = "single" 

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

347logr50_phys_M0 = -20 

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

349# above) 

350logr50_phys_mean_slope = -0.24293465 

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

352# above) 

353logr50_phys_mean_intcpt = 1.2268735 

354# Standard deviation of the log of physical sizes 

355logr50_phys_std = 0.56800081 

356# logr50_phys_mean_slope for red galaxies 

357logr50_phys_mean_slope_red = -0.24293465 

358# logr50_phys_mean_intcpt for red galaxies 

359logr50_phys_mean_intcpt_red = 1.2268735 

360# logr50_phys_std for red galaxies 

361logr50_phys_std_red = 0.56800081 

362# logr50_phys_mean_slope for blue galaxies 

363logr50_phys_mean_slope_blue = -0.24293465 

364# logr50_phys_mean_intcpt for blue galaxies 

365logr50_phys_mean_intcpt_blue = 1.2268735 

366# logr50_phys_std for blue galaxies 

367logr50_phys_std_blue = 0.56800081 

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

369logr50_alpha = 0 

370logr50_alpha_red = 0 

371logr50_alpha_blue = 0 

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

373logr50_sdss_fit_sigma1_red = 0.48 

374logr50_sdss_fit_sigma2_red = 0.25 

375logr50_sdss_fit_M0_red = -20.52 

376logr50_sdss_fit_a_red = 0.6 

377logr50_sdss_fit_b_red = -4.63 

378logr50_sdss_fit_sigma1_blue = 0.48 

379logr50_sdss_fit_sigma2_blue = 0.25 

380logr50_sdss_fit_M0_blue = -20.52 

381logr50_sdss_fit_alpha_blue = 0.21 

382logr50_sdss_fit_beta_blue = 0.53 

383logr50_sdss_fit_gamma_blue = -1.31 

384 

385 

386# ------------------------ 

387# Ellipticity distribution 

388# ------------------------ 

389 

390# Mean galaxy e1 before PSF 

391e1_mean = 0 

392# RMS galaxy e1 before PSF 

393e1_sigma = 0.39 

394# Mean galaxy e2 before PSF 

395e2_mean = 0 

396# RMS galaxy e1 before PSF 

397e2_sigma = 0.39 

398# mean galaxy e1 for blue galaxies 

399e1_mean_blue = 0 

400# mean galaxy e2 for blue galaxies 

401e2_mean_blue = 0 

402# Sigma of a Gaussian for blue galaxies 

403ell_sigma_blue = 0.4600 

404# Sigma of a Gaussian for red galaxies 

405ell_sigma_red = 0.2 

406# Parameters for the ellipticity distribution for the 

407# ellipticity_sampling_method=blue_red_miller2013 

408ell_disc_log_a = -1.3708147902715042 

409ell_disc_emax = 0.8 

410ell_disc_min_e = 0.02 

411ell_disc_pow_alpha = 1 

412 

413ell_bulge_b = 2.368 

414ell_bulge_c = 6.691 

415 

416# Ratio of a and b parameters 

417ell_beta_ab_ratio = 0.57 

418# Mode of the ellipticity distribution 

419ell_beta_mode = 0.2 

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

421ell_beta_ab_sum = 2.9 

422# Maximum ellipticity 

423ell_beta_emax = 0.98 

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

425ell_beta_mode_red = 0.2 

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

427# parameters of the beta distribution 

428ell_beta_ab_sum_red = 2.9 

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

430ell_beta_mode_blue = 0.2 

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

432# parameters of the beta distribution 

433ell_beta_ab_sum_blue = 2.9 

434 

435# Switch sampling methods for ellipticity: 

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

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

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

439# ell_disc_min_e, ell_bulge_b, ell_disc_pow_alpha) 

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

441# ell_beta_emax) 

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

443# ell_beta_emax) 

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

445# for red and blue 

446ellipticity_sampling_method = "beta_mode_red_blue" 

447 

448# ----- 

449# Shear 

450# ----- 

451 

452path_shear_map = None 

453 

454gamma1_sign = -1