synthesizer.parametric.galaxy¶
A submodule defining a parametric galaxy object.
This module defines a parametric galaxy object, which is a subclass of the BaseGalaxy class. The parametric galaxy object is used to represent a galaxy comprised of parametric components.
Example usage:
from synthesizer.parametric import Galaxy
# Create a parametric galaxy object galaxy = Galaxy(stars=stars, black_holes=black_holes, redshift=0.1)
# Get the galaxies spectra spectra = galaxy.get_spectra(model)
# Get the ionising photon luminosity for a given SFZH ionising_photon_luminosity = galaxy.get_Q(grid)
# Create a spectral cube from the galaxy’s spectra spectral_cube = galaxy.get_data_cube(resolution=0.1, fov=10, lam=lam)
# Add two parametric galaxies together new_galaxy = galaxy1 + galaxy2
Classes
- class synthesizer.parametric.galaxy.Galaxy(stars=None, name='parametric galaxy', black_holes=None, redshift=None, centre=None, **kwargs)[source]¶
A class defining parametric galaxy objects.
This class is a subclass of the BaseGalaxy class and is used to represent a galaxy comprised of parametric components. The class provides methods for creating and manipulating parametric galaxies, including adding galaxies together, getting spectra, and creating spectral cubes.
- stars¶
An instance of Stars containing the combined star formation and metallicity history of this galaxy.
- Type:
- name¶
A name to identify the galaxy. Only used for external labelling, has no internal use.
- Type:
str
- redshift¶
The redshift of the galaxy.
- Type:
float
- centre¶
The centre of the galaxy.
- Type:
unyt_array
- get_data_cube(resolution, fov, lam, stellar_spectra=None, blackhole_spectra=None, quantity='lnu')[source]¶
Make a SpectralCube from an Sed.
Data cubes are calculated by smoothing spectra over the component morphology. The Sed used is defined by <component>_spectra.
If multiple components are requested they will be combined into a single output data cube.
NOTE: Either npix or fov must be defined.
- Parameters:
resolution (unyt_quantity of float) – The size of a pixel. (Ignoring any supersampling defined by psf_resample_factor)
fov (unyt_quantity of float) – The width of the image in image coordinates.
lam (unyt_array, float) – The wavelength array to use for the data cube.
stellar_spectra (str) – The stellar spectra key to make into a data cube.
blackhole_spectra (str) – The black hole spectra key to make into a data cube.
quantity (str) – The Sed attribute/quantity to sort into the data cube, i.e. “lnu”, “llam”, “luminosity”, “fnu”, “flam” or “flux”.
- Returns:
- SpectralCube
The spectral data cube object containing the derived data cube.