BagpipesSampler#

class niriss_tools.grism.BagpipesSampler(fit_instructions, veldisp=500.0)[source]#

Bases: object

Bagpipes model galaxy sampler.

Parameters:
fit_instructionsdict

A dictionary containing information about the model to be generated.

veldispfloat, optional

The velocity dispersion of the model galaxy in km/s. By default veldisp=500.

Methods Summary

sample(param_vector[, cont_only, rm_line, ...])

Regenerate a model spectrum from a sampled parameter vector.

update_model_components(param)

Generate a model object with the current parameters.

Methods Documentation

sample(param_vector, cont_only=False, rm_line=None, return_line_flux=False, **model_kwargs)[source]#

Regenerate a model spectrum from a sampled parameter vector.

Parameters:
param_vectorArrayLike

The array of parameters to be updated.

cont_onlybool, optional

If True, the model spectrum will be generated without any nebular emission. By default False.

rm_linelist[str] | None, optional

The names of one or more lines to exclude from the model spectrum, based on the Cloudy naming convention (see here for more details). By default None.

return_line_fluxbool, optional

If True, return the total line flux for all lines named in rm_line. By default False.

**model_kwargsdict, optional

Any additional keyword arguments to pass to ExtendedModelGalaxy.

Returns:
ArrayLike

A 2D array, containing the wavelengths and corresponding fluxes of the modelled galaxy spectrum.

update_model_components(param)[source]#

Generate a model object with the current parameters.

Originally from bagpipes.fitting.fitted_model, modified to allow for running in parallel (no attributes overwritten).

Parameters:
paramArrayLike

The array of parameters to be updated.

Returns:
dict

The updated components for a model galaxy.