synthesizer.particle.blackholes¶
A module for working with arrays of black holes.
Contains the BlackHoles class for use with particle based systems. This houses all the data detailing collections of black hole particles. Each property is stored in (N_bh, ) shaped arrays for efficiency.
When instantiate a BlackHoles object a myriad of extra optional properties can be set by providing them as keyword arguments.
Example usages:
- bhs = BlackHoles(masses, metallicities,
redshift=redshift, accretion_rate=accretion_rate, …)
Classes
- class synthesizer.particle.blackholes.BlackHoles(masses, accretion_rates, epsilons=0.1, inclinations=None, spins=None, metallicities=None, redshift=None, coordinates=None, velocities=None, softening_lengths=None, smoothing_lengths=None, centre=None, ionisation_parameter_blr=0.1, hydrogen_density_blr=unyt_quantity(1.e+09, 'cm**(-3)'), covering_fraction_blr=0.1, velocity_dispersion_blr=unyt_quantity(2000, 'km/s'), ionisation_parameter_nlr=0.01, hydrogen_density_nlr=unyt_quantity(10000., 'cm**(-3)'), covering_fraction_nlr=0.1, velocity_dispersion_nlr=unyt_quantity(500, 'km/s'), theta_torus=unyt_quantity(10, 'degree'), tau_v=None, **kwargs)[source]¶
The base BlackHoles class. This contains all data a collection of black holes could contain. It inherits from the base Particles class holding attributes and methods common to all particle types.
The BlackHoles class can be handed to methods elsewhere to pass information about the stars needed in other computations. For example a Galaxy object can be initialised with a BlackHoles object for use with any of the Galaxy helper methods.
Note that due to the many possible operations, this class has a large number ofoptional attributes which are set to None if not provided.
- nbh¶
The number of black hole particles in the object.
- Type:
int
- smoothing_lengths¶
The smoothing length describing the black holes neighbour kernel.
- Type:
array-like, float
- particle_spectra¶
A dictionary of Sed objects containing any of the generated particle spectra.
- Type:
dict
- generate_particle_line(grid, line_id, line_type, fesc, mask=None, method='cic', nthreads=0, verbose=False)[source]¶
Calculate rest frame line luminosity and continuum from an AGN Grid.
This is a flexible base method which extracts the rest frame line luminosity of this blackhole population based on the passed arguments and calculate the luminosity and continuum for each individual particle.
- Parameters:
grid (Grid) – A Grid object.
line_id (list/str) – A list of line_ids or a str denoting a single line. Doublets can be specified as a nested list or using a comma (e.g. ‘OIII4363,OIII4959’).
line_type (str) – The type of line to extract from the grid. Must match the spectra/line type in the grid file.
fesc (float/array-like, float) – Fraction of blackhole emission that escapes unattenuated from the birth cloud. Can either be a single value or an value per star (defaults to 0.0).
mask (array) – A mask to apply to the particles (only applicable to particle)
method (str) – The method to use for the interpolation. Options are: ‘cic’ - Cloud in cell ‘ngp’ - Nearest grid point
nthreads (int) – The number of threads to use in the C extension. If -1 then all available threads are used.
- Returns:
- Line
An instance of Line contain this lines wavelenth, luminosity, and continuum.
- generate_particle_lnu(grid, spectra_name, fesc=0.0, mask=None, lam_mask=None, verbose=False, grid_assignment_method='cic', nthreads=0)[source]¶
Generate per particle rest frame spectra for a given key.
- Parameters:
grid (obj) – Spectral grid object.
spectra_name (string) – The name of the target spectra inside the grid file (e.g. “incident”, “transmitted”, “nebular”).
fesc (float) – Fraction of emission that escapes unattenuated from the birth cloud (defaults to 0.0).
mask (array-like, bool) – If not None this mask will be applied to the inputs to the spectra creation.
lam_mask (array, bool) – A mask to apply to the wavelength array of the grid. This allows for the extraction of specific wavelength ranges.
verbose (bool) – Are we talking?
grid_assignment_method (string) – The type of method used to assign particles to a SPS grid point. Allowed methods are cic (cloud in cell) or nearest grid point (ngp) or there uppercase equivalents (CIC, NGP). Defaults to cic.
nthreads (int) – The number of threads to use for the computation. If -1 then all available threads are used.