rail.creation.engines.dsps_photometry_creator module

class rail.creation.engines.dsps_photometry_creator.DSPSPhotometryCreator

Bases: Creator

Derived class of Creator that generate synthetic absolute and apparent magnitudes from one or more SED models generated with the DSPSSingleSedModeler or DSPSPopulationSedModeler classes. It accepts as input Hdf5Handles containing the rest-frame SEDs in units of Lsun/Hz and outputs an Hdf5Handle containing sequential indices, absolute and apparent magnitudes for each galaxy. Photometric quantities are computed for the filters defined in the configuration file.

jax serially execute the computations on CPU on single core, for CPU parallelization you need MPI. If GPU is used, jax natively and automatically parallelize the execution.

Parameters:
  • output_mode ([str] default=default) – What to do with the outputs. The options are ‘default’, where outputs will be written to files and some returned, and ‘return’, where outputs will only be returned and not written.

  • redshift_key ([str] default=redshifts) – Redshift keyword name of the hdf5 dataset containing rest-frame SEDs

  • restframe_sed_key ([str] default=restframe_seds) – Rest-frame SED keyword name of the hdf5 dataset containing rest-frame SEDs

  • absolute_mags_key ([str] default=rest_frame_absolute_mags) – Absolute magnitudes keyword name of the output hdf5 dataset

  • apparent_mags_key ([str] default=apparent_mags) – Apparent magnitudes keyword name of the output hdf5 dataset

  • filter_folder ([str] default=/home/docs/checkouts/readthedocs.org/user_builds/rail-hub/conda/stable/lib/python3.14/site-packages/rail/examples_data/creation_data/data/dsps_default_data/filters) – Folder containing filter transmissions

  • instrument_name ([str] default=lsst) – Instrument name as prefix to filter transmission files

  • wavebands ([str] default=u,g,r,i,z,y) – Comma-separated list of wavebands

  • min_wavelength ([float] default=250) – Minimum input rest-frame wavelength SEDs

  • max_wavelength ([float] default=12000) – Maximum input rest-frame wavelength SEDs

  • ssp_templates_file ([str] default=/home/docs/checkouts/readthedocs.org/user_builds/rail-hub/conda/stable/lib/python3.14/site-packages/rail/examples_data/creation_data/data/dsps_default_data/ssp_data_fsps_v3.2_lgmet_age.h5) – hdf5 file storing the SSP libraries used to create SEDs

  • default_cosmology ([bool] default=True) – True to use default DSPS cosmology. If False,Om0, w0, wa, h need to be supplied in the sample function

  • model (Hdf5Handle (INPUT))

  • output (Hdf5Handle (OUTPUT))

__init__(args, **kwargs)

Initialize DSPSPhotometryCreator class. If the SSP templates are not provided by the user, they are automatically downloaded from the public NERSC directory. These default templates are created with default FSPS values, with gas emission at fixed gas solar metallicity value. The _b and _c tuples for jax are composed of None or 0, depending on whether you don’t or do want the array axis to map over for all arguments.

Parameters:
  • args

  • comm

default_files_folder = '/home/docs/checkouts/readthedocs.org/user_builds/rail-hub/conda/stable/lib/python3.14/site-packages/rail/examples_data/creation_data/data/dsps_default_data'
entrypoint_function: str | None = 'sample'
inputs = [('model', <class 'rail.core.data.Hdf5Handle'>)]
interactive_function: str | None = 'dsps_photometry_creator'
name = 'DSPSPhotometryCreator'
outputs = [('output', <class 'rail.core.data.Hdf5Handle'>)]
run()

This function computes rest-frame absolute magnitudes in the provided wavebands for all the galaxies in the population by calling _calc_rest_mag_vmap from DSPS. It does the same for the observed magnitudes in the AB system by calling _calc_obs_mag_vmap from DSPS. It then stores both kind of magnitudes and the galaxy indices into an Hdf5Handle.

sample(model, seed=None, Om0=0.3075, w0=-1.0, wa=0.0, h=0.6774, **kwargs)

Creates observed and absolute magnitudes for the population of galaxy rest-frame SEDs and stores them into an Hdf5Handle.

Parameters:
  • model (str) – Filepath to the hdf5 table containing the galaxy rest-frame SEDs.

  • seed (int) – The random seed to control sampling

  • Om0 (float) – Omega matter: density of non-relativistic matter in units of the critical density at z=0.

  • w0 (float) – Dark energy equation of state at z=0 (a=1). This is pressure/density for dark energy in units where c=1.

  • wa (float) – Negative derivative of the dark energy equation of state with respect to the scale factor. A cosmological constant has w0=-1.0 and wa=0.0.

  • h (float) – dimensionless Hubble constant at z=0.

Returns:

Hdf5Handle storing the absolute and apparent magnitudes.

Return type:

Hdf5Handle

Notes

This method puts seed into the stage configuration data, which makes them available to other methods. It then calls the run method. Finally, the Hdf5Handle associated to the output tag is returned.