synthesizer.components.blackhole

A module for holding blackhole emission models.

The class defined here should never be instantiated directly, there are only ever instantiated by the parametric/particle child classes.

Classes

class synthesizer.components.blackhole.BlackholesComponent(mass=None, accretion_rate=None, epsilon=0.1, accretion_rate_eddington=None, inclination=None, spin=None, bolometric_luminosity=None, metallicity=None, **kwargs)[source]

The parent class for stellar components of a galaxy.

This class contains the attributes and spectra creation methods which are common to both parametric and particle stellar components.

This should never be instantiated directly, instead it provides the common functionality and attributes used by the child parametric and particle BlackHole/s classes.

spectra

A dictionary containing black hole spectra.

Type:

dict, Sed

mass

The mass of each blackhole.

Type:

array-like, float

accretion_rate

The accretion rate of each blackhole.

Type:

array-like, float

epsilon

The radiative efficiency of the blackhole.

Type:

array-like, float

accretion_rate_eddington

The accretion rate expressed as a fraction of the Eddington accretion rate.

Type:

array-like, float

inclination

The inclination of the blackhole disc.

Type:

array-like, float

spin

The dimensionless spin of the blackhole.

Type:

array-like, float

bolometric_luminosity

The bolometric luminosity of the blackhole.

Type:

array-like, float

metallicity

The metallicity of the blackhole which is assumed for the line emitting regions.

Type:

array-like, float

calculate_accretion_rate_eddington()[source]

Calculate the black hole accretion in units of the Eddington rate.

Returns
unyt_array

The black hole accretion rate in units of the Eddington rate.

calculate_bb_temperature()[source]

Calculate the black hole big bump temperature. This is used for the cloudy disc model.

Returns
unyt_array

The black hole bolometric luminosity

calculate_bolometric_luminosity()[source]

Calculate the black hole bolometric luminosity. This is by itself useful but also used for some emission models.

Returns
unyt_array

The black hole bolometric luminosity

calculate_eddington_luminosity()[source]

Calculate the eddington luminosity of the black hole.

Returns
unyt_array

The black hole bolometric luminosity

calculate_eddington_ratio()[source]

Calculate the eddington ratio of the black hole.

Returns
unyt_array

The black hole eddington ratio

generate_lnu(emission_model, grid, spectra_name, line_region, fesc=0.0, mask=None, verbose=False, grid_assignment_method='cic', nthreads=0)[source]

Generate the integrated rest frame spectra for a given grid key spectra.

Parameters:
  • emission_model (synthesizer.blackhole_emission_models.*) – An instance of a blackhole emission model.

  • grid (obj) – Spectral grid object.

  • fesc (float) – Fraction of emission that escapes unattenuated from the birth cloud (defaults to 0.0).

  • spectra_name (string) – The name of the target spectra inside the grid file (e.g. “incident”, “transmitted”, “nebular”).

  • line_region (str) – The specific line region, i.e. ‘nlr’ or ‘blr’.

  • mask (array-like, bool) – If not None this mask will be applied to the inputs to the spectra creation.

  • 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 in the C extension. If -1 then all available threads are used.

get_photo_fluxes(filters, verbose=True)[source]

Calculate flux photometry using a FilterCollection object.

Parameters:
  • filters (object) – A FilterCollection object.

  • verbose (bool) – Are we talking?

Returns:

(dict)

A dictionary of fluxes in each filter in filters.

get_photo_luminosities(filters, verbose=True)[source]

Calculate luminosity photometry using a FilterCollection object.

Parameters:
Returns:

photo_luminosities (dict)

A dictionary of rest frame broadband luminosities.

get_spectra_attenuated(emission_model, verbose=False, grid_assignment_method='cic', tau_v=None, dust_curve=None, dust_emission_model=None, nthreads=0)[source]

Generate blackhole spectra for a given emission_model including dust attenuation and potentially emission.

Parameters:
  • emission_model (blackhole_emission_models.*) – Any instance of a blackhole emission model (e.g. Template or UnifiedAGN)

  • 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.

  • tau_v (float) – The v-band optical depth.

  • dust_curve (object) – A synthesizer dust.attenuation.AttenuationLaw instance.

  • dust_emission_model (object) – A synthesizer dust.emission.DustEmission instance.

  • nthreads (int) – The number of threads to use in the C extension. If -1 then all available threads are used.

Returns:

dict, Sed

A dictionary of Sed instances including the intrinsic and attenuated emission.

get_spectra_intrinsic(emission_model, verbose=False, grid_assignment_method='cic', nthreads=0)[source]

Generate intrinsic blackhole spectra for a given emission_model.

NOTE: any emission model parameters (excluding those fixed on

the emission model) will be temporaily inherited from this object and reset after spectra creation.

Parameters:
  • emission_model (blackhole_emission_models.*) – Any instance of a blackhole emission model (e.g. Template or UnifiedAGN)

  • 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 in the C extension. If -1 then all available threads are used.

Returns:

dict, Sed

A dictionary of Sed instances including the intrinsic emission.

plot_spectra(spectra_to_plot=None, show=False, ylimits=(), xlimits=(), figsize=(3.5, 5), **kwargs)[source]

Plots either specific spectra (specified via spectra_to_plot) or all spectra on the child Stars object.

Parameters:
  • spectra_to_plot (string/list, string) –

    The specific spectra to plot.
    • If None all spectra are plotted.

    • If a list of strings each specifc spectra is plotted.

    • If a single string then only that spectra is plotted.

  • show (bool) – Flag for whether to show the plot or just return the figure and axes.

  • ylimits (tuple) – The limits to apply to the y axis. If not provided the limits will be calculated with the lower limit set to 1000 (100) times less than the peak of the spectrum for rest_frame (observed) spectra.

  • xlimits (tuple) – The limits to apply to the x axis. If not provided the optimal limits are found based on the ylimits.

  • figsize (tuple) – Tuple with size 2 defining the figure size.

  • kwargs (dict) – arguments to the sed.plot_spectra method called from this wrapper

Returns:

fig (matplotlib.pyplot.figure)

The matplotlib figure object for the plot.

ax (matplotlib.axes)

The matplotlib axes object containing the plotted data.