galsbi package
Subpackages
- galsbi.configs package
- Submodules
- galsbi.configs.config_Fischbacher+24_emulator module
- galsbi.configs.config_Fischbacher+24_image module
- galsbi.configs.config_Fischbacher+24_image+SE module
- galsbi.configs.config_Fischbacher+24_intrinsic module
- galsbi.configs.config_Tortorelli+25_emulator module
- galsbi.configs.config_Tortorelli+25_image module
- galsbi.configs.config_Tortorelli+25_image+SE module
- galsbi.configs.config_Tortorelli+25_intrinsic module
- galsbi.configs.config_Fischbacher+26_emulator module
- galsbi.configs.config_Fischbacher+26_image module
- galsbi.configs.config_Fischbacher+26_image+SE module
- galsbi.configs.config_Fischbacher+26_intrinsic module
- galsbi.configs.config_Moser+24_emulator module
- galsbi.configs.config_Moser+24_image module
- galsbi.configs.config_Moser+24_image+SE module
- galsbi.configs.config_Moser+24_intrinsic module
- Module contents
- galsbi.ucat package
- Subpackages
- galsbi.ucat.config package
- galsbi.ucat.galaxy_population_models package
- Submodules
- galsbi.ucat.galaxy_population_models.galaxy_light_profile module
- galsbi.ucat.galaxy_population_models.galaxy_luminosity_function module
- galsbi.ucat.galaxy_population_models.galaxy_position module
- galsbi.ucat.galaxy_population_models.galaxy_sed module
- galsbi.ucat.galaxy_population_models.galaxy_shape module
- galsbi.ucat.galaxy_population_models.galaxy_size module
- Module contents
- galsbi.ucat.plugins package
- Submodules
- galsbi.ucat.plugins.apply_shear module
- galsbi.ucat.plugins.galaxy_mag_noise module
- galsbi.ucat.plugins.galaxy_z_noise module
- galsbi.ucat.plugins.sample_galaxies module
- galsbi.ucat.plugins.sample_galaxies_morph module
- galsbi.ucat.plugins.sample_galaxies_photo module
- galsbi.ucat.plugins.write_catalog module
- galsbi.ucat.plugins.write_catalog_photo module
- Module contents
- Submodules
- galsbi.ucat.filters_util module
- galsbi.ucat.galaxy_sampling_util module
- galsbi.ucat.lensing_util module
apply_reduced_shear_to_ellipticities()apply_shear_to_ellipticities()calculate_flux_magnification()calculate_size_magnification()distortion_to_moments()distortion_to_shear()fwhm_to_sigma()moments_to_distortion()moments_to_shear()shear_to_distortion()shear_to_moments()shear_to_reduced_shear()sigma_to_fwhm()
- galsbi.ucat.magnitude_calculator module
- galsbi.ucat.sed_templates_util module
- galsbi.ucat.spectrum_util module
- galsbi.ucat.utils module
- Module contents
- Subpackages
- galsbi.ucat_sps package
- Subpackages
- galsbi.ucat_sps.config package
- galsbi.ucat_sps.galaxy_population_models package
- Submodules
- galsbi.ucat_sps.galaxy_population_models.galaxy_agn module
- galsbi.ucat_sps.galaxy_population_models.galaxy_dust_attenuation module
- galsbi.ucat_sps.galaxy_population_models.galaxy_dust_emission module
- galsbi.ucat_sps.galaxy_population_models.galaxy_gas_ionization module
- galsbi.ucat_sps.galaxy_population_models.light_profile module
- galsbi.ucat_sps.galaxy_population_models.galaxy_metallicity_history module
- galsbi.ucat_sps.galaxy_population_models.galaxy_size module
- galsbi.ucat_sps.galaxy_population_models.galaxy_star_formation_history module
- galsbi.ucat_sps.galaxy_population_models.galaxy_stellar_mass_function module
- galsbi.ucat_sps.galaxy_population_models.galaxy_surviving_stellar_massmodule
- galsbi.ucat_sps.galaxy_population_models.galaxy_velocity_dispersion module
- Module contents
- galsbi.ucat_sps.plugins package
- Submodules
- galsbi.ucat_sps.spectrum_util_sps module
- galsbi.ucat_sps.util_sps module
apply_extinction_to_magnitudes()apply_galaxy_observed_magnitude_cut()build_promage_physical_properties()compute_ab_magnitudes()galaxy_property_seed()get_age_of_the_universe_from_redshift()get_lookbacktime_from_redshift()load_promage_models()predict_promage_magnitudes()reorder_prospect_magnitudes_to_filters()stellar_mass_function_seed()validate_recent_burst_properties()
- galsbi.ucat_sps.sps_sed_generator module
- Module contents
- Subpackages
- galsbi.sham_ot package
- Submodules
- galsbi.sham_ot.histograms module
HaloHistogramHaloHistogram.add_halo_catalog()HaloHistogram.add_halo_histogram()HaloHistogram.get_histogram()HaloHistogram.get_mass_bins()HaloHistogram.get_time_bins()HaloHistogram.get_total_counts()HaloHistogram.get_z_bins()HaloHistogram.log_mass_binsHaloHistogram.max_log_massHaloHistogram.min_log_massHaloHistogram.save()
load_halo_histogram()read_pinocchio_config_details()rebin_halo_histogram()
- galsbi.sham_ot.sham_ot module
compute_faintest_absmag()compute_n_halos_given_faintest_absmag()find_ot_solution()generate_galaxy_histogram()get_interpolated_ot_solution()get_regularized_ot_solution()sample_catalog_from_simulation()select_type()select_type_berner()select_type_berner_ext()select_type_peng()solve_ot()z_density()
- galsbi.sham_ot.utils module
- Module contents
Submodules
galsbi.citations module
- galsbi.citations.cite_abc_posterior(name)[source]
Prints the citation for the model with the given name.
- Parameters:
name – model name for which to print the citation
- galsbi.citations.cite_code_release(mode)[source]
Prints the citation for the code release.
- Parameters:
mode – mode of the model
galsbi.galsbi module
- class galsbi.galsbi.GalSBI(name, verbosity='info')[source]
Bases:
objectThis class is the main interface to the model.
It provides methods to generate mock galaxy catalogs and to cite the model.
- generate_catalog(mode='intrinsic', config_file=None, model_index=0, file_name='GalSBI_sim', verbosity=None, **kwargs)[source]
Generates a mock galaxy catalog using the model and configuration specified. The parameter model_index is used to select a specific set of model parameters from the ABC posterior. If a list of model parameters is provided, catalogs are generated for each set of parameters. The saved catalogs and images are named according to the file_name and model_index.
Names of the files
Intrinsic ucat galaxy catalog: f”{file_name}_{index}_{band}_ucat.gal.cat”
Intrinsic ucat star catalog: f”{file_name}_{index}_{band}_ucat.star.cat”
Output catalog: f”{file_name}_{index}_{band}_se.cat”
Output image: f”{file_name}_{index}_{band}_image.fits”
Segmentation map: f”{file_name}_{index}_{band}_se_seg.h5”
Background map: f”{file_name}_{index}_{band}_se_bkg.h5”
SED catalog: f”{file_name}_{index}_sed.cat”
Galaxy-halo relation: f”{file_name}_{index}_galaxy_halo_relation_{{type}}.h5”
- param mode:
mode to use for generating the catalog, either “intrinsic”, “emu”, “image”, “image+SE”, “config_file”
- param config_file:
dictionary or path to a configuration file to use for generating the catalog (only used if mode=”config_file”)
- param model_index:
index of the model parameters to use for generating the catalog
- param file_name:
filename of the catalog and images to generate
- param verbosity:
verbosity level of the logger, either “debug”, “info”, “warning”, “error” or “critical”
- param kwargs:
additional keyword arguments to pass to the workflow (overwrites the values from the model parameters and config file)
- load_catalogs(output_format='rec', model_index=0, combine=False)[source]
Loads the catalogs generated by the model.
- Parameters:
output_format – format of the output, either “rec”, “df” or “fits”
model_index – index of the model parameters to use for loading the catalogs
combine – if True, combines the catalogs from all bands into a single catalog
- Returns:
catalogs in the specified format
galsbi.load module
- galsbi.load.load_abc_posterior(name)[source]
Loads the ABC posterior for the given model.
- Parameters:
name – name of the model
- Returns:
ABC posterior as a structured numpy array
- galsbi.load.load_config(name, mode, config_file=None)[source]
Loads the correct configuration for the given model and mode. If mode is “config_file”, the configuration is loaded from the given file. Otherwise, the configuration is loaded based on the model name and mode.
- Parameters:
name – name of the model
mode – mode for which to load the configuration (either “intrinsic”, “emu”, “image”, “config_file”)
config_file – path to a configuration file to use
- Returns:
module name of the configuration to use
galsbi.models module
Module contents
- class galsbi.GalSBI(name, verbosity='info')[source]
Bases:
objectThis class is the main interface to the model.
It provides methods to generate mock galaxy catalogs and to cite the model.
- generate_catalog(mode='intrinsic', config_file=None, model_index=0, file_name='GalSBI_sim', verbosity=None, **kwargs)[source]
Generates a mock galaxy catalog using the model and configuration specified. The parameter model_index is used to select a specific set of model parameters from the ABC posterior. If a list of model parameters is provided, catalogs are generated for each set of parameters. The saved catalogs and images are named according to the file_name and model_index.
Names of the files
Intrinsic ucat galaxy catalog: f”{file_name}_{index}_{band}_ucat.gal.cat”
Intrinsic ucat star catalog: f”{file_name}_{index}_{band}_ucat.star.cat”
Output catalog: f”{file_name}_{index}_{band}_se.cat”
Output image: f”{file_name}_{index}_{band}_image.fits”
Segmentation map: f”{file_name}_{index}_{band}_se_seg.h5”
Background map: f”{file_name}_{index}_{band}_se_bkg.h5”
SED catalog: f”{file_name}_{index}_sed.cat”
Galaxy-halo relation: f”{file_name}_{index}_galaxy_halo_relation_{{type}}.h5”
- param mode:
mode to use for generating the catalog, either “intrinsic”, “emu”, “image”, “image+SE”, “config_file”
- param config_file:
dictionary or path to a configuration file to use for generating the catalog (only used if mode=”config_file”)
- param model_index:
index of the model parameters to use for generating the catalog
- param file_name:
filename of the catalog and images to generate
- param verbosity:
verbosity level of the logger, either “debug”, “info”, “warning”, “error” or “critical”
- param kwargs:
additional keyword arguments to pass to the workflow (overwrites the values from the model parameters and config file)
- load_catalogs(output_format='rec', model_index=0, combine=False)[source]
Loads the catalogs generated by the model.
- Parameters:
output_format – format of the output, either “rec”, “df” or “fits”
model_index – index of the model parameters to use for loading the catalogs
combine – if True, combines the catalogs from all bands into a single catalog
- Returns:
catalogs in the specified format