Coverage for src/galsbi/configs/config_Moser+24_image.py: 100%

58 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2024-12-13 03:24 +0000

1# Copyright (C) 2024 ETH Zurich 

2# Institute for Particle Physics and Astrophysics 

3# Author: Silvan Fischbacher 

4# created: Thu Aug 08 2024 

5 

6import os 

7 

8import numpy as np 

9import ufig.config.common 

10from cosmo_torrent import data_path 

11from ivy.loop import Loop 

12from ufig.workflow_util import FiltersStopCriteria 

13 

14import galsbi.ucat.config.common 

15 

16 

17# Import all common settings from ucat and ufig as default 

18def _update_globals(module, globals_): 

19 globals_.update( 

20 {k: v for k, v in module.__dict__.items() if not k.startswith("__")} 

21 ) 

22 

23 

24_update_globals(galsbi.ucat.config.common, globals()) 

25_update_globals(ufig.config.common, globals()) 

26 

27# Default size of the image 

28sampling_mode = "wcs" 

29ra0 = 0 

30dec0 = 0 

31pixscale = 0.168 

32size_x = 1000 

33size_y = 1000 

34 

35 

36# Define the filters 

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

38filters_full_names = { 

39 "B": "SuprimeCam_B", 

40 "g": "HSC_g", 

41 "r": "HSC_r2", 

42 "i": "HSC_i2", 

43 "z": "HSC_z", 

44 "y": "HSC_y", 

45} 

46reference_band = "i" 

47magzero_dict = {"g": 27.0, "r": 27.0, "i": 27.0, "z": 27.0, "y": 27.0} 

48 

49# Define the plugins that should be used 

50plugins = [ 

51 "ufig.plugins.multi_band_setup", 

52 "galsbi.ucat.plugins.sample_galaxies", 

53 # "ufig.plugins.draw_stars_besancon_map", 

54 Loop( 

55 [ 

56 "ufig.plugins.single_band_setup", 

57 "ufig.plugins.background_noise", 

58 "ufig.plugins.resample", 

59 "ufig.plugins.add_psf", 

60 "ufig.plugins.gamma_interpolation_table", 

61 "ufig.plugins.render_galaxies_flexion", 

62 "ufig.plugins.convert_photons_to_adu", 

63 # because from the image we see single spike in the x direction 

64 "ufig.plugins.saturate_pixels_x", 

65 "ufig.plugins.write_catalog", 

66 "ufig.plugins.write_image", 

67 ], 

68 stop=FiltersStopCriteria(), 

69 ), 

70 "ivy.plugin.show_stats", 

71] 

72 

73# Background noise (corresponding roughly to a HSC deep field image) 

74background_type = "gaussian" 

75background_sigma_dict = {"g": 1.2, "r": 1.5, "i": 2.6, "z": 6.4, "y": 8.6} 

76bkg_noise_amp_dict = {"g": 0.005, "r": 0.005, "i": 0.01, "z": 0.01, "y": 0.02} 

77bkg_noise_multiply_gain = False 

78gain_dict = { 

79 "g": 70, 

80 "r": 60, 

81 "i": 80, 

82 "z": 105, 

83 "y": 70, 

84} 

85n_exp_dict = { 

86 "g": 20, 

87 "r": 16, 

88 "i": 22, 

89 "z": 30, 

90 "y": 20, 

91} 

92 

93# PSF (corresponding roughly to a HSC deep field image) 

94psf_type = "constant_moffat" # constant PSF defined by Moffat profile 

95psf_e1 = 0.0 # PSF e1 

96psf_e2 = 0.0 # PSF e2 

97psf_beta = [2.0, 5.0] # Moffat beta parameter 

98seeing = 0.6 # mean seeing in arcsec 

99 

100# Luminosity function 

101lum_fct_z_res = 0.001 

102lum_fct_m_max = -4 

103lum_fct_z_max = 6 

104 

105# Sampling methods ucat 

106nside_sampling = 4096 

107 

108# Magnitude limits 

109stars_mag_max = 26 

110gals_mag_max = 28 

111stars_mag_min = 12 

112gals_mag_min = 14 

113 

114# Filter throughputs 

115filters_file_name = os.path.join( 

116 data_path("HSC_tables"), "HSC_filters_collection_yfix.h5" 

117) 

118 

119# Template spectra & integration tables 

120n_templates = 5 

121templates_file_name = os.path.join( 

122 data_path("template_BlantonRoweis07"), "template_spectra_BlantonRoweis07.h5" 

123) 

124 

125# Extinction 

126extinction_map_file_name = os.path.join( 

127 data_path("lambda_sfd_ebv"), "lambda_sfd_ebv.fits" 

128) 

129 

130# magnitude table 

131magnitude_calculation = "table" 

132templates_int_tables_file_name = os.path.join( 

133 data_path("HSC_tables"), "HSC_template_integrals_yfix.h5" 

134) 

135 

136# Catalog precision 

137catalog_precision = np.float32 

138 

139# Seed 

140seed = 1996 

141 

142 

143# Parameters that are specific to the Moser+24 model 

144# Mainly the different parametrizations of the galaxy population model. 

145# DO NOT CHANGE THESE VALUES IF YOU WANT TO USE THE GALAXY POPULATION MODEL OF MOSER+24 

146# CHANGING THESE VALUES WILL LEAD TO A DIFFERENT MEANING OF SOME OF THE PARAMETERS 

147lum_fct_parametrization = "logpower" 

148ellipticity_sampling_method = "beta_mode_red_blue" 

149sersic_sampling_method = "blue_red_betaprime" 

150logr50_sampling_method = "red_blue" 

151template_coeff_sampler = "dirichlet_alpha_mode" 

152template_coeff_weight_blue = np.array([1.0, 1.0, 1.0, 1.0, 1.0]) 

153template_coeff_weight_red = np.array([1.0, 1.0, 1.0, 1.0, 1.0]) 

154template_coeff_z1_blue = 3 

155template_coeff_z1_red = 3