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_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
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.galsbi module
- class galsbi.galsbi.GalSBI(name, verbosity='info')[source]
Bases:
object
This 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”
- 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:
object
This 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”
- 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