Coverage for src/galsbi/configs/config_Fischbacher+24_emulator.py: 100%
49 statements
« prev ^ index » next coverage.py v7.10.4, created at 2025-08-18 15:15 +0000
« prev ^ index » next coverage.py v7.10.4, created at 2025-08-18 15:15 +0000
1# Copyright (C) 2024 ETH Zurich
2# Institute for Particle Physics and Astrophysics
3# Author: Silvan Fischbacher
4# created: Thu Nov 28 2024
6import os
8import numpy as np
9import ufig.config.common
10from cosmic_toolbox import file_utils
11from cosmo_torrent import data_path
12from edelweiss.emulator import load_emulator
13from ivy.loop import Loop
14from ufig.workflow_util import FiltersStopCriteria
16import galsbi.ucat.config.common
19# Import all common settings from ucat and ufig as default
20def _update_globals(module, globals_):
21 globals_.update(
22 {k: v for k, v in module.__dict__.items() if not k.startswith("__")}
23 )
26_update_globals(galsbi.ucat.config.common, globals())
27_update_globals(ufig.config.common, globals())
29# Default size of the image
30sampling_mode = "healpix"
31healpix_map = np.zeros(12 * 64**2)
32healpix_map[0] = 1
34# Define the filters
35filters = ["g", "r", "i", "z", "y"]
36filters_full_names = {
37 "B": "SuprimeCam_B",
38 "g": "HSC_g",
39 "r": "HSC_r2",
40 "i": "HSC_i2",
41 "z": "HSC_z",
42 "y": "HSC_y",
43}
44reference_band = "i"
46# Define the plugins that should be used
47plugins = [
48 "ufig.plugins.multi_band_setup",
49 "galsbi.ucat.plugins.sample_galaxies",
50 Loop(
51 [
52 "ufig.plugins.single_band_setup_intrinsic_only",
53 "ufig.plugins.write_catalog_for_emu",
54 "galsbi.ucat.plugins.write_catalog",
55 ],
56 stop=FiltersStopCriteria(),
57 ),
58 "ufig.plugins.run_emulator",
59 "ufig.plugins.cleanup_catalogs",
60 "ivy.plugin.show_stats",
61]
63# Luminosity function
64lum_fct_z_res = 0.001
65lum_fct_m_max = -4
66lum_fct_z_max = 6
68# Sampling methods ucat
69nside_sampling = 64
71# Magnitude limits
72stars_mag_max = 26
73gals_mag_max = 28
74stars_mag_min = 12
75gals_mag_min = 14
77# Filter throughputs
78filters_file_name = os.path.join(
79 data_path("HSC_tables"), "HSC_filters_collection_yfix.h5"
80)
82# Template spectra & integration tables
83n_templates = 5
84templates_file_name = os.path.join(
85 data_path("template_BlantonRoweis07"), "template_spectra_BlantonRoweis07.h5"
86)
88# Extinction
89extinction_map_file_name = os.path.join(
90 data_path("lambda_sfd_ebv"), "lambda_sfd_ebv.fits"
91)
93# magnitude table
94magnitude_calculation = "table"
95templates_int_tables_file_name = os.path.join(
96 data_path("HSC_tables"), "HSC_template_integrals_yfix.h5"
97)
99# Catalog precision
100catalog_precision = np.float32
102# Seed
103seed = 1996
105# emulator
106path2emu = data_path("emulator_fischbacher24")
107clf, nflow = load_emulator(
108 path2emu,
109 bands=None,
110)
111emu_conf = file_utils.read_yaml(os.path.join(path2emu, "config_emu.yaml"))
112emu_mini = True
115# Parameters that are specific to the Fischbacher+24 model
116# Mainly the different parametrizations of the galaxy population model.
117# DO NOT CHANGE THESE VALUES IF YOU WANT TO USE THE MODEL OF FISCHBACHER+24
118# CHANGING THESE VALUES WILL LEAD TO A DIFFERENT MEANING OF SOME OF THE PARAMETERS
119lum_fct_parametrization = "truncated_logexp"
120ellipticity_sampling_method = "beta_mode_red_blue"
121sersic_sampling_method = "blue_red_betaprime"
122logr50_sampling_method = "sdss_fit"
123template_coeff_sampler = "dirichlet_alpha_mode"
124template_coeff_weight_blue = np.array([1.0, 1.0, 1.0, 1.0, 1.0])
125template_coeff_weight_red = np.array([1.0, 1.0, 1.0, 1.0, 1.0])
126template_coeff_z1_blue = 3
127template_coeff_z1_red = 3