Coverage for src/galsbi/ucat/config/common.py: 100%
189 statements
« prev ^ index » next coverage.py v7.17.2, created at 2026-11-09 18:05 +0000
« prev ^ index » next coverage.py v7.17.2, created at 2026-11-09 18:05 +0000
1# Copyright (C) 2018 ETH Zurich, Institute for Particle Physics and Astrophysics
3"""
4Created on Mar 5, 2018
5author: Joerg Herbel
6"""
8import numpy as np
10# ==================================================================
11# G E N E R A L
12# ==================================================================
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"
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
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# max memory limit of the job in Mb, if reached, UCatNumGalError is thrown
64max_mem_hard_limit_mb = 10000
65# if to enrich the catalog by parameters such as bkg, absolute ellipticity, etc.
66enrich_catalog = False
68# ==================================================================
69# I M A G E P R O P E R T I E S
70# ==================================================================
72# Number of pixels on image x-axis
73size_x = 4200
74# Number of pixels on image y-axis
75size_y = 4200
76# Center of field (RA)
77ra0 = 150.24793
78# Center of field (Dec)
79dec0 = 2.23140
80# Pixel scale (arcsec/pixel)
81pixscale = 0.168
83# ==================================================================
84# C O S M O L O G Y
85# ==================================================================
87# Reduced Hubble parameter
88h = 0.678
89# Matter density
90omega_m = 0.308
91# Dark energy density
92omega_l_in = "flat"
94# ==================================================================
95# G A L A X Y C A T A L O G
96# ==================================================================
98# -------------------
99# Luminosity function
100# -------------------
102# Galaxy type, each will have its own luminosity functions (see luminosity_functions.py:
103# GALAXY_TYPES_ALL, initialize_luminosity_functions)
104galaxy_types = ["red", "blue"]
105# Functional forms of M* and phi*, can be linexp (linear and exponential) or
106# logpower (for logarithmic and power law)
107lum_fct_parametrization = "linexp"
108# Filter band in which the luminosity function is valid
109lum_fct_filter_band = "B"
110# Schechter parameter alpha for blue galaxies
111lum_fct_alpha_blue = -1.3
112# Schechter parameter alpha for red galaxies
113lum_fct_alpha_red = -0.5
114# Parameter a in M*(z) = a*z + b for blue galaxies (if linexp),
115# M*(z) = a*log(1+z) + b (if logpower), M*: Schechter parameter
116lum_fct_m_star_blue_slope = -0.9408582
117# Parameter b in M*(z) = a*z + b for blue galaxies (if linexp),
118# M*(z) = a*log(1+z) + b (if logpower), M*: Schechter parameter
119lum_fct_m_star_blue_intcpt = -20.40492365
120# Parameter a in M*(z) = a*z + b for red galaxies (if linexp),
121# M*(z) = a*log(1+z) + b (if logpower), M*: Schechter parameter
122lum_fct_m_star_red_slope = -0.70798041
123# Parameter b in M*(z) = a*z + b for red galaxies (if linexp),
124# M*(z) = a*log(1+z) + b (if logpower), M*: Schechter parameter
125lum_fct_m_star_red_intcpt = -20.37196157
126# Parameter a in phi*(z) = a * exp(bz) for blue galaxies (if linexp),
127# phi*(z) = a*(1+z)**b (if logpower), phi*: Schechter parameter
128lum_fct_phi_star_blue_amp = 0.00370253
129# Parameter b in phi*(z) = a * exp(bz) for blue galaxies (if linexp),
130# phi*(z) = a*(1+z)**b (if logpower), phi*: Schechter parameter
131lum_fct_phi_star_blue_exp = -0.10268436
132# Parameter a in phi*(z) = a * exp(bz) for red galaxies(if linexp),
133# phi*(z) = a*(1+z)**b (if logpower), phi*: Schechter parameter
134lum_fct_phi_star_red_amp = 0.0035097
135# Parameter b in phi*(z) = a * exp(bz) for red galaxies (if linexp),
136# phi*(z) = a*(1+z)**b (if logpower), phi*: Schechter parameter
137lum_fct_phi_star_red_exp = -0.70596888
138# Parameter controlling the redshift after which M* for blue galaxies is constant
139# if the lum_fct_parametrization = truncated_logexp
140lum_fct_z_const_blue = 4
141# Parameter controlling the redshift after which M* for red galaxies is constant
142# if the lum_fct_parametrization = truncated_logexp
143lum_fct_z_const_red = 4
144# Resolution for sampling redshift
145lum_fct_z_res = 0.001
146# Maximum redshift of galaxies to sample
147lum_fct_z_max = 3
148# Maximum absolute magnitude to be sampled
149lum_fct_m_max = -5
150# Resolution for sampling absolute magnitudes
151lum_fct_m_res = 0.001
152# Maximum number of blue galaxies in one healpix pixel. This parameter has the function
153# to limit runtime for ABC runs. A reasonable value critically depends on the healpix
154# pixelization and the maximum absolute and apparent magnitudes.
155n_gal_max_blue = np.inf
156# Same as parameter above for red galaxies.
157n_gal_max_red = np.inf
158# If to raise an exception if the above limits are reached, or just to finish the
159# calculation and continue
160raise_max_num_gal_error = True
161# Raise an error if there are some galaxies that are fainter than specified
162raise_z_m_interp_error = False
163# Memory limit for the size of the catalog in Mb (assuming 10 float64 columns per
164# catalog), if reached, the UCatNumGalError is thrown, prevents jobs from crashing
165max_memlimit_gal_catalog = np.inf
166# Precision of the catalog.
167catalog_precision = np.float64
170# ----------
171# Position assignment
172# ----------
173# model for the spatial distribution of galaxies: "uniform" or "sham-ot"
174position_model = "uniform"
175# filename of the halo histogram (to compute the ot solution)
176halo_histograms_filename = ""
177# pixelization of the halo catalog simulation (used for computing the ot solution)
178# in square radians
179pixarea_of_halo_catalog = 12.566370614359172
180# filename of the halo catalog (to apply the ot solution)
181halo_catalog_filename = ""
182# SHAM model ("Berner+24", "Berner+24_ext", "Peng+10")
183sham_model = "Berner+24"
184# regularization parameter for OT, None for unregularized OT, float for regularized OT
185# if ot_epsilon is set, it overwrites the red and blue ot_epsilons
186# if ot_epsilon is None, the ot_epsilon_red and ot_epsilon_blue are used
187ot_epsilon = None
188ot_epsilon_blue = None
189ot_epsilon_red = None
190# regularizer type for OT, "sinkhorn" or "quadratic"
191ot_regularizer = "sinkhorn"
192# Parameters for Fischbacher+25 cost matrix modification (only used when ot_epsilon is
193# not None)
194ot_mu_0 = 9.94 # halo mass scale parameter
195ot_alpha = -1.7 # exponent for cost matrix scaling
196# if ot solution should be cached for later use
197ot_cache_enable = False
199# Parameters for the Berner et al. 2024 model #
200# Mass limit for red/blue separation of central halos (following Berner+24)
201mlim_sham = 8e12
202# Quenching time for red/blue separation of subhalos (following Berner+24)
203quenching_time_sham = 2 # Gyr
205# additional parameters for the extended Berner model
206# transition width for the mass limit
207mlim_sigma_sham = 0.2
208# Baseline quenched fraction at low mass for subhalos
209initial_quenched_fraction_sham = 0.1
210# transition width for the quenched fraction
211quenching_time_sigma_sham = 0.2
213# Parameters for the Peng et al. 2010 model #
214# (defaults are mean from http://arxiv.org/abs/2501.06169)
215# Mass limit for red/blue separation of subhalos (following Peng+10)
216m_mu_peng = 11.935
217# Transition width from star-forming to quenched (following Peng+10)
218sigma_peng = 0.51
219# Baseline quenched fraction at low mass for subhalos (following Peng+10)
220b_peng = 0.41
222# ------------------------------------
223# Galaxy-halo relation saving options
224# ------------------------------------
225# Whether to save the galaxy-halo relation for each redshift bin
226save_galaxy_halo_relation = False
227# Lower bound of log10(halo mass) for galaxy-halo relation sampling
228galaxy_halo_relation_logmass_min = 10.0
229# Upper bound of log10(halo mass) for galaxy-halo relation sampling
230galaxy_halo_relation_logmass_max = 16.0
231# Number of mass bins to use for galaxy-halo relation
232galaxy_halo_relation_nbins = 100
233# File name format for galaxy-halo relation output
234# (will be formatted with galaxy type: "blue" or "red")
235galaxy_halo_relation_filename_format = "galaxy_halo_relation_{}.h5"
238# ---------------------
239# Template coefficients
240# ---------------------
241# Template coefficients are drawn from Dirichlet distributions of order 5 separately for
242# blue and red galaxies.
243# The parameters alpha of these distributions evolve with redshift. The evolution is
244# parameterized 10 parameters, separately for blue and red galaxies: 5 parameters at
245# redshift 0 and 5 parameters at redshift z1 > 0. Dirichlet
246# parameters are calculated separately for each galaxy according to
247# alpha(z) = (alpha0)^(1-z/z1) * (alpha1)^(z/z1),
248# where alpha is five-dimensional. Thus, alpha(z=0) = alpha0 and alpha(z=z1) = alpha1
249# with a smooth transition in between. Finally, after drawing the coefficients, they are
250# weighted separately along each dimension.
252# which sampling model to use.
253# 'dirichlet': from Herbel et al. 2018,
254# 'dirichlet_alpha_sum': enforce sum of alpha
255# 'dirichlet_alpha_std': enforce standard deviation of alpha
256# 'dirichlet_alpha_mode': use parameterisation with mode and standard deviation
257template_coeff_sampler = "dirichlet"
258# Redshift z1>0 for blue galaxies
259template_coeff_z1_blue = 1
260# Redshift z1>0 for red galaxies
261template_coeff_z1_red = 1
262# Dirichlet parameter for blue galaxies at z=0
263template_coeff_alpha0_blue_0 = 1.9946549
264# Dirichlet parameter for blue galaxies at z=0
265template_coeff_alpha0_blue_1 = 1.99469164
266# Dirichlet parameter for blue galaxies at z=0
267template_coeff_alpha0_blue_2 = 1.99461187
268# Dirichlet parameter for blue galaxies at z=0
269template_coeff_alpha0_blue_3 = 1.9946589
270# Dirichlet parameter for blue galaxies at z=0
271template_coeff_alpha0_blue_4 = 1.99463069
272# Dirichlet parameter for blue galaxies at z=z1
273template_coeff_alpha1_blue_0 = template_coeff_alpha0_blue_0
274# Dirichlet parameter for blue galaxies at z=z1
275template_coeff_alpha1_blue_1 = template_coeff_alpha0_blue_1
276# Dirichlet parameter for blue galaxies at z=z1
277template_coeff_alpha1_blue_2 = template_coeff_alpha0_blue_2
278# Dirichlet parameter for blue galaxies at z=z1
279template_coeff_alpha1_blue_3 = template_coeff_alpha0_blue_3
280# Dirichlet parameter for blue galaxies at z=z1
281template_coeff_alpha1_blue_4 = template_coeff_alpha0_blue_4
282# Dirichlet parameter for red galaxies at z=0
283template_coeff_alpha0_red_0 = 1.62158197
284# Dirichlet parameter for red galaxies at z=0
285template_coeff_alpha0_red_1 = 1.62137391
286# Dirichlet parameter for red galaxies at z=0
287template_coeff_alpha0_red_2 = 1.62175061
288# Dirichlet parameter for red galaxies at z=0
289template_coeff_alpha0_red_3 = 1.62159144
290# Dirichlet parameter for red galaxies at z=0
291template_coeff_alpha0_red_4 = 1.62165971
292# Dirichlet parameter for red galaxies at z=z1
293template_coeff_alpha1_red_0 = template_coeff_alpha0_red_0
294# Dirichlet parameter for red galaxies at z=z1
295template_coeff_alpha1_red_1 = template_coeff_alpha0_red_1
296# Dirichlet parameter for red galaxies at z=z1
297template_coeff_alpha1_red_2 = template_coeff_alpha0_red_2
298# Dirichlet parameter for red galaxies at z=z1
299template_coeff_alpha1_red_3 = template_coeff_alpha0_red_3
300# Dirichlet parameter for red galaxies at z=z1
301template_coeff_alpha1_red_4 = template_coeff_alpha0_red_4
302# std of the Dirichlet distribution for blue galaxies at z=0
303template_coeff_alpha0_blue_std = 0.1
304# std of the Dirichlet distribution for blue galaxies at z=z1
305template_coeff_alpha1_blue_std = 0.1
306# std of the Dirichlet distribution for red galaxies at z=0
307template_coeff_alpha0_red_std = 0.1
308# std of the Dirichlet distribution for red galaxies at z=z1
309template_coeff_alpha1_red_std = 0.1
310# Weights for blue and red galaxies applied after drawing the coefficients
311template_coeff_weight_blue = np.array(
312 [3.47116583e09, 3.31262983e06, 2.13298069e09, 1.63722853e10, 1.01368664e09]
313)
314template_coeff_weight_red = np.array(
315 [3.84729278e09, 1.56768931e06, 3.91242928e08, 4.66363319e10, 3.03275998e07]
316)
317# If to store the SED in the catalog
318save_SEDs = False
320# ------------------------------
321# Apparent magnitude calculation
322# ------------------------------
324# The way magnitudes are calculated
325magnitude_calculation = "table"
326# File containing filter throughputs
327filters_file_name = "filters.h5"
328# File containing template spectra
329templates_file_name = "template_spectra.h5"
330# File containing integration tables of template spectra for different filters
331templates_int_tables_file_name = "template_integrals.h5"
332# If True, copy the template integration table files to the current working directory
333# (local scratch)
334copy_template_int_tables_to_cwd = False
335# Extinction map (expected to be in galactic coordinates)
336extinction_map_file_name = "extinction.fits"
337# Minimum galaxy magnitude cutoff
338gals_mag_min = 16
339# Maximum galaxy magnitude cutoff
340gals_mag_max = 27
341# Noise level corresponding to background flux, constant across bands (for abs mag
342# calculation, see ABC for deepfields)
343noise_const_abs_mag = None
344# Redshift noise, z=sig*(1+z) Leigle et al 2015, doi:10.3847/0067-0049/224/2/24
345noise_z_sigma = 0.007
346# Redshift outlier fraction, from 0 to max_z present in catalog Leigle et al 2015,
347# doi:10.3847/0067-0049/224/2/24
348noise_z_outlier_fraction = 0.005
350# -------------------
351# Sersic distribution
352# -------------------
354# Mean sersic n for mag<20 galaxies
355sersic_n_mean_low = 0.2
356# RMS sersic n for mag<20 galaxies
357sersic_n_sigma_low = 1
358# 1st mean sersic n for mag>20 galaxies
359sersic_n_mean_1_hi = 0.3
360# 1st RMS sersic n for mag>20 galaxies
361sersic_n_sigma_1_hi = 0.5
362# 2nd mean sersic n for mag>20 galaxies
363sersic_n_mean_2_hi = 1.6
364# 2nd RMS sersic n for mag>20 galaxies
365sersic_n_sigma_2_hi = 0.4
366# Minimum sersic n cutoff
367sersic_n_offset = 0.2
368# Switch sampling methods for sersic index
369# default = use default from Berge et al 2012 (sersic_n_mean_low, sersic_n_sigma_low,
370# sersic_n_mean_1_hi, sersic_n_sigma_1_hi, sersic_n_mean_2_hi, sersic_n_sigma_2_hi,
371# sersic_n_offset)
372# blue_red_fixed = use sersic_index_blue for blue and sersic_index_red for red
373# single = use sersic_single_value for all galaxies
374# blue_red_betaprime = use the betaprime distribution with mode and size, limited by
375# (0.2, 10)
376sersic_sampling_method = "blue_red_betaprime"
377# Fixed sersic index all galaxies in case sersic_sampling_method = single
378sersic_single_value = 1.0
379# Fixed sersic index for blue galaxies in case sersic_sampling_method = blue_red_fixed
380sersic_index_blue = 1.0
381# Fixed sersic index for red galaxies in case sersic_sampling_method = blue_red_fixed
382sersic_index_red = 4.0
383# Sersic_betaprime model, peak for blue galaxies
384sersic_betaprime_blue_mode = 0.8
385# Sersic_betaprime model, spread for blue galaxies
386sersic_betaprime_blue_size = 5
387# Sersic_betaprime model, slope of the redshift dependence
388sersic_betaprime_blue_mode_alpha = 0
389# Sersic_betaprime model, peak for red galaxies
390sersic_betaprime_red_mode = 1.5
391# Sersic_betaprime model, spread for red galaxies
392sersic_betaprime_red_size = 50
393# Sersic_betaprime model, slope of the redshift dependence
394sersic_betaprime_red_mode_alpha = 0
395# Sersic_betaprime model, minimum sersic index
396sersic_n_min = 0.2
397# Sersic_betaprime model, maximum sersic index
398sersic_n_max = 10
400# ----------
401# Size model
402# ----------
403# Physical sizes are sampled from a log-normal distribution and then transformed into
404# apparent sizes using redshift and the input cosmology. The mean of the log of physical
405# sizes depends linearly on the absolute magnitude of a galaxy:
406# log(Mean physical sizes) = a * (Abs. mag.) + b
407# The standard deviation of the distribution of the log of physical sizes is constant.
409# Method to sample sizes:
410# "single" - for the same distribution for red and blue, or
411# "red_blue" for separate parameters
412# "sdss_fit" - for the SDSS fit from Shen et al. 2003 (in that case use the sdss_fit
413# parameters)
414logr50_sampling_method = "single"
415# shift to the absolute magnitude for the mean physical size of galaxies
416logr50_phys_M0 = -20
417# Slope of the evolution of the log of the mean physical size of galaxies (a in eq.
418# above)
419logr50_phys_mean_slope = -0.24293465
420# Intercept of the evolution of the log of the mean physical size of galaxies (b in eq.
421# above)
422logr50_phys_mean_intcpt = 1.2268735
423# Standard deviation of the log of physical sizes
424logr50_phys_std = 0.56800081
425# logr50_phys_mean_slope for red galaxies
426logr50_phys_mean_slope_red = -0.24293465
427# logr50_phys_mean_intcpt for red galaxies
428logr50_phys_mean_intcpt_red = 1.2268735
429# logr50_phys_std for red galaxies
430logr50_phys_std_red = 0.56800081
431# logr50_phys_mean_slope for blue galaxies
432logr50_phys_mean_slope_blue = -0.24293465
433# logr50_phys_mean_intcpt for blue galaxies
434logr50_phys_mean_intcpt_blue = 1.2268735
435# logr50_phys_std for blue galaxies
436logr50_phys_std_blue = 0.56800081
437# redshift dependence scaling factor parametrized with (1+z)**alpha, also for sdss_fit
438logr50_alpha = 0
439logr50_alpha_red = 0
440logr50_alpha_blue = 0
441# SDSS fit parameters (defaults to measurements for Fig. 4 of Shen et al. 2003)
442logr50_sdss_fit_sigma1_red = 0.48
443logr50_sdss_fit_sigma2_red = 0.25
444logr50_sdss_fit_M0_red = -20.52
445logr50_sdss_fit_a_red = 0.6
446logr50_sdss_fit_b_red = -4.63
447logr50_sdss_fit_sigma1_blue = 0.48
448logr50_sdss_fit_sigma2_blue = 0.25
449logr50_sdss_fit_M0_blue = -20.52
450logr50_sdss_fit_alpha_blue = 0.21
451logr50_sdss_fit_beta_blue = 0.53
452logr50_sdss_fit_gamma_blue = -1.31
455# ------------------------
456# Ellipticity distribution
457# ------------------------
459# Mean galaxy e1 before PSF
460e1_mean = 0
461# RMS galaxy e1 before PSF
462e1_sigma = 0.39
463# Mean galaxy e2 before PSF
464e2_mean = 0
465# RMS galaxy e1 before PSF
466e2_sigma = 0.39
467# mean galaxy e1 for blue galaxies
468e1_mean_blue = 0
469# mean galaxy e2 for blue galaxies
470e2_mean_blue = 0
471# Sigma of a Gaussian for blue galaxies
472ell_sigma_blue = 0.4600
473# Sigma of a Gaussian for red galaxies
474ell_sigma_red = 0.2
475# Parameters for the ellipticity distribution for the
476# ellipticity_sampling_method=blue_red_miller2013
477ell_disc_log_a = -1.3708147902715042
478ell_disc_emax = 0.8
479ell_disc_min_e = 0.02
480ell_disc_pow_alpha = 1
482ell_bulge_b = 2.368
483ell_bulge_c = 6.691
485# Ratio of a and b parameters
486ell_beta_ab_ratio = 0.57
487# Mode of the ellipticity distribution
488ell_beta_mode = 0.2
489# Sum of a and b parameters of the beta distribution
490ell_beta_ab_sum = 2.9
491# Maximum ellipticity
492ell_beta_emax = 0.98
493# p(e) with beta_function and beta_function_mod for red galaxies: maximum ellipticity
494ell_beta_mode_red = 0.2
495# p(e) with beta_function and beta_function_mod for red galaxies: sum of a and b
496# parameters of the beta distribution
497ell_beta_ab_sum_red = 2.9
498# p(e) with beta_function and beta_function_mode for blue galaxies: maximum ellipticity
499ell_beta_mode_blue = 0.2
500# p(e) with beta_function and beta_function_mode for blue galaxies: sum of a and b
501# parameters of the beta distribution
502ell_beta_ab_sum_blue = 2.9
504# Switch sampling methods for ellipticity:
505# default = use single Gaussian (e*_mean, e*_sigma),
506# blue_red = use separate Gaussians for blue and red (ell_sigma_blue, ell_sigma_red)
507# blue_red_miller2013 = use functions from Miller et al 2013 (ell_disc_log_a,
508# ell_disc_min_e, ell_bulge_b, ell_disc_pow_alpha)
509# beta_ratio = use modified beta function (ell_beta_ab_ratio, ell_beta_ab_sum,
510# ell_beta_emax)
511# beta_mode = use modified beta function (ell_beta_mode, ell_beta_ab_sum,
512# ell_beta_emax)
513# beta_mode_red_blue = same as beta_function_mode, but for different parameters
514# for red and blue
515ellipticity_sampling_method = "beta_mode_red_blue"
517# -----
518# Shear
519# -----
521path_shear_map = None
523gamma1_sign = -1