lightcurvelynx.models.agn
A model for an AGN.
Adapted from https://github.com/RickKessler/SNANA/blob/master/src/gensed_AGN.py with the authors’ permission.
Classes
A model for an AGN. |
Functions
|
Sample a damped random walk. |
Module Contents
- sample_damped_random_walk(times, tau_v, sf_inf, t0, rng=None)[source]
Sample a damped random walk.
- Parameters:
times (np.ndarray) – A length T array with the times at which to sample the damped random walk (in MJD).
tau_v (np.ndarray) – A length W array with timescale of the damped random walk (in s).
sf_inf (np.ndarray) – A length W array with structure function at infinity time in magnitude.
t0 (float) – The initial time moment (in MJD).
rng (np.random.Generator, optional) – The random number generator to use. Default: None
- Returns:
samples – The sampled value of the damped random walk.
- Return type:
float
- class AGN(t0, blackhole_mass, edd_ratio, *, inclination_rad=None, node_label=None, seed=None, **kwargs)[source]
Bases:
lightcurvelynx.models.physical_model.SEDModelA model for an AGN.
Parameterized values include:
accretion_rate - The accretion rate (ME_dot) at Eddington luminosity in g/s.
blackhole_accretion_rate - The accretion rate of the black hole in g/s.
blackhole_mass - The black hole mass in solar mass.
edd_ratio - The Eddington ratio.
dec - The object’s declination in degrees. [from BasePhysicalModel]
distance - The object’s luminosity distance in pc. [from BasePhysicalModel]
inclination - The inclination of the accretion disk in radians (sampled uniformly between 0 and pi/2).
L_bol - The bolometric luminosity in erg/s.
mag_i - The i band absolute magnitude.
ra - The object’s right ascension in degrees. [from BasePhysicalModel]
redshift - The object’s redshift. [from BasePhysicalModel]
t0 - The t0 of the zero phase, date. [from BasePhysicalModel]
- Parameters:
t0 (float) – initial time moment in days.
blackhole_mass (float) – The black hole mass in solar masses.
edd_ratio (float) – Eddington ratio
inclination_rad (float or None) – The inclination of the accretion disk in radians. If None then the value is sampled uniformly between 0 and pi/2. Default = None
node_label (str, optional) – The label for the node in the model graph. Default: None
seed (int, optional) – The seed to use for the random number generator. Default: None
**kwargs (dict) – Additional keyword arguments.
- static compute_critical_accretion_rate(blackhole_mass)[source]
Compute the critical accretion rate at Eddington luminosity.
- Parameters:
blackhole_mass (float) – The black hole mass in g.
- Returns:
accretion_rate – The accretion rate (ME_dot) at Eddington luminosity in g/s.
- Return type:
float
- static compute_blackhole_accretion_rate(accretion_rate, edd_ratio)[source]
Compute the accretion rate of the blackhole.
- Parameters:
accretion_rate (float) – The accretion rate (ME_dot) at Eddington luminosity in g/s.
edd_ratio (float) – The Eddington ratio.
- Returns:
bh_accretion_rate – The accretion rate of the black hole in g/s.
- Return type:
float
- static compute_bolometric_luminosity(edd_ratio, blackhole_mass)[source]
Compute the bolometric luminosity of an AGN.
- Parameters:
edd_ratio (float) – The Eddington ratio.
blackhole_mass (float) – The black hole mass in g.
- Returns:
bolometric_luminosity – The bolometric luminosity in erg/s.
- Return type:
float
- static compute_sed_standard_disk(*, Mdot, nu, rin_to_rg, i, d, M)[source]
Compute the flux based on a standard disk model.
References
Lipunova, G., Malanchev, K., Shakura, N. (2018) https://doi.org/10.1007/978-3-319-93009-1_1
All inputs are in CGS.
- Parameters:
Mdot (float or np.ndarray) – The accretion rate at the previous time step.
nu (float or np.ndarray) – The frequency.
rin_to_rg (float or np.ndarray) – The inner radius of the accretion disk to gravitation radius ratio.
i (float or np.ndarray) – The inclination in radians.
d (float or np.ndarray) – The distance.
M (float or np.ndarray) – The mass of the gravitating center.
- Returns:
flux – The flux at the given time step.
- Return type:
float
- static compute_mag_i(bolometric_luminosity)[source]
Compute the i band magnitude from the bolometric luminosity.
References
Shen et al., 2013 - https://adsabs.harvard.edu/full/2013BASI…41…61S
- Parameters:
bolometric_luminosity (float) – The bolometric luminosity in erg/s.
- Returns:
mag_i – The i band magnitude.
- Return type:
float
- static compute_r_0(r_in)[source]
Compute the initial radius of the ring (r_0) in a standard disk model given the inner radius.
References
Lipunova, G., Malanchev, K., Shakura, N. (2018) https://doi.org/10.1007/978-3-319-93009-1_1
- Parameters:
r_in (float) – The inner radius of the accretion disk.
- Returns:
r_0 – The initial radius of the ring.
- Return type:
float
- static compute_structure_function_at_inf(sf_inf_4000aa, wavelength)[source]
Adjust the structure function at infinity time for given wavelengths
References
Suberlak et al. 2021 - DOI 10.3847/1538-4357/abc698
- Parameters:
sf_inf_4000aa (float) – The structure function at infinity time for 4000 angstroms
wavelength (np.ndarray) – A length W array with wavelength in cm.
- Returns:
result – A length W array with structure function at infinity time in magnitude.
- Return type:
np.ndarray
- static compute_sf_inf_4000aa(mag_i=-23, blackhole_mass=1000000000.0 * M_SUN_G)[source]
Compute the structure function at infinity time in magnitude, for 4000 A
References
Suberlak et al. 2021 - DOI 10.3847/1538-4357/abc698
- Parameters:
mag_i (float, optional) – The i band magnitude. Default: -23
blackhole_mass (float, optional) – The black hole mass in g. Default: 1e9 * M_SUN_G
- Returns:
result – A length W array with structure function at infinity time in magnitude for 4000 angstroms.
- Return type:
np.ndarray
- static compute_tau_4000aa(mag_i=-23, blackhole_mass=1000000000.0 * M_SUN_G)[source]
Compute the timescale (tau_v) at 4000 angstroms.
References
Suberlak et al. 2021 - DOI 10.3847/1538-4357/abc698
- Parameters:
mag_i (float, optional) – The i band magnitude. Default: -23
blackhole_mass (float, optional) – The black hole mass in g. Default: 1e9 * M_SUN_G
- Returns:
tau_v – A length W array with the timescale for 4000 angstroms.
- Return type:
np.ndarray
- static compute_tau(tau_4000aa, wavelength)[source]
Adjust the timescale (tau_v) for given wavelengths
References
Suberlak et al. 2021 - DOI 10.3847/1538-4357/abc698
- Parameters:
tau_4000aa (float) – The timescale for 4000 angstroms.
wavelength (np.ndarray) – A length W array with wavelength in cm.
- static compute_temp_at_r_0(M, Mdot, r_in)[source]
Compute the effective temperature at r0. This is the same as the maximum effective temperature at the disc surface (Tmax).
References
Lipunova, G., Malanchev, K., Shakura, N. (2018) https://doi.org/10.1007/978-3-319-93009-1_1
- Parameters:
M (float) – The mass of the gravitating centre.
Mdot (float) – The accretion rate at the previous time step.
r_in (float) – The inner radius of the accretion disk.
- Returns:
T_0 – The effective temperature at r0.
- Return type:
float
- compute_sed(times, wavelengths, graph_state, **kwargs)[source]
Draw effect-free observations for this object.
- Parameters:
times (numpy.ndarray) – A length T array of rest frame timestamps.
wavelengths (numpy.ndarray, optional) – A length N array of wavelengths (in angstroms).
graph_state (GraphState) – An object mapping graph parameters to their values.
**kwargs (dict, optional) – Any additional keyword arguments.
- Returns:
flux_density – A length T x N matrix of SED values (in nJy).
- Return type:
numpy.ndarray