lsst_inaf_agile.catalog_agn

Create Galaxy+AGN mocks for the LSST Italian AGN in-kind contribution.

Attributes

logger

formatter

handler

LOG_LAMBDA_EDD

EBV_MAX

FLUXES

QPODI

Classes

QsogenPosteriorDistribution

CatalogAGN

AGN catalog class.

Module Contents

logger[source]
formatter[source]
handler[source]
LOG_LAMBDA_EDD[source]
EBV_MAX = 9.0[source]
FLUXES: dict[tuple[int, str, bool], float][source]
class QsogenPosteriorDistribution[source]
filename: str = 'data/posteriors/posterior_frozen.dat'[source]
posterior_distribution = None[source]
parameter_names[source]
QPODI[source]
class CatalogAGN(dirname: str, catalog_galaxy: lsst_inaf_agile.catalog_galaxy.CatalogGalaxy, type_plambda: str, save_sed: bool, seed: int, merloni2014: lsst_inaf_agile.merloni2014.Merloni2014, filter_db: str = 'data/egg/share/filter-db/db.dat', qsogen_posterior_distribution: QsogenPosteriorDistribution = QPODI, overwrite: bool = False)[source]

AGN catalog class.

Parameters:
  • dirname (str) – directory name to write the catalog to

  • catalog_galaxy (CatalogGalaxy) – underlying galaxy catalog

  • type_plambda (str) – assumed p(lambda)

  • save_sed (bool) – save AGN SEDs to file

  • seed (int) – random number seed

  • merloni2014 (Merloni2014) – assumed Merloni2014 obscuration model

  • filter_db (str, optional) – filename of the EGG filter database (db.dat)

  • overwrite (bool, optional) – overwrite an existing AGN catalog

dirname[source]
catalog_galaxy[source]
type_plambda[source]
save_sed[source]
seed[source]
merloni2014[source]
filter_db = 'data/egg/share/filter-db/db.dat'[source]
qsogen_posterior_distribution[source]
catalog = None[source]
__getitem__(key)[source]

Return AGN catalog column corresponding to key.

static get_columns(bands: list[str], rfbands: list[str])[source]

Return the names, types, descriptions, and units of each column.

Parameters:
  • bands (list) – egg-style list of apparent magnitude bands

  • rfbands (list) – egg-style list of absolute magnitude bands

Return type:

List of 4-tuples of column names, types, descriptions, and units.

get_dtype() numpy.dtype[source]

Return the numpy dtype corresponding to the column names and types.

get_catalog(overwrite)[source]

Build the catalog column-by-column and write to FITS.

static _get_seed(key)[source]

Set the random number seed.

The random number seed is generated programmatically from the name of the column.

Examples

>>> CatalogAGN._get_seed("foo")
33048
>>> CatalogAGN._get_seed("bar")
30282
>>> CatalogAGN._get_seed("baz")
31066
get_agn(key)[source]

Get AGN attribute corresponding to the column ‘key’.

get_log_lambda_SAR(add_ctk=True) numpy.ndarray[source]

Return log10 of the specific black hole accretion rate in erg/s/Msun.

get_log_LX_2_10()[source]

Return log10 of the intrinsic 2-10 keV X-ray luminosity in erg/s.

get_log_FX_2_10(Gamma=1.9)[source]

Return log10 of the intrinsic 2-10 keV X-ray flux in erg/s/cm2 in the observer frame.

get_log_FX_2_7(Gamma=1.9)[source]

Return log10 of the intrinsic 2-7 keV X-ray flux in erg/s/cm2 in the observer frame.

Band conversion is done from the 2-10 keV assuming power-law index ‘Gamma’.

Parameters:

Gamma (float) – Assumed power-law index for the band conversion.

get_log_L_2_keV(Gamma=1.9, wavelength=6.2)[source]

Return monochromatic X-ray luminosity at lambda = wavelength in erg/s/Hz.

To be used for the alpha_ox Lx = restframe 2-10 kev luminosity. maybe we can work directly with frequencies and have it in one line

get_log_L_2500(alpha=0.952, beta=2.138, scatter=0.4)[source]

Return the 2500 angstrom° monochromatic luminosity (in erg/s).

Uses Lusso+10 Eq. 5 (inverted) assuming Lx = alpha L_opt - beta

get_is_optical_type2(func_get_f_obs=None, use_f_obs_for_ctk_agn=False)[source]

Return boolean vector selecting optical type2 AGN.

The optical type2 AGN fraction is evaluated based on Merloni+2014 assuming obscured fraction as a function of intrinsic X-ray luminosity and redshift.

get_E_BV(alpha_1=7.93483055, n_1=2.97565676, alpha_2=11.6133635, n_2=1.42972, mu_type_2=0.3, ebv_ctk=EBV_MAX)[source]

Return AGN reddening E(B-V) in ABmag.

The E(B-V) is assumed to be different for type1 and type2 AGN, while CTK AGN are assumed to be all type2.

get_is_agn_ctn()[source]

Render a random sample of AGN “active” according to the duty cycle.

get_is_agn_ctk()[source]

Assign CTK AGN fraction randomly.

get_is_agn()[source]

Return boolean vector selecting CTN or CTK AGN.

get_sed(i)[source]

Return an AGN SED.

Parameters:

i (int) – ID of AGN for which SED is returned.

Returns:

  • lambda (array_like) – Wavelength in microns.

  • flux (array_like) – observer frame flux in microjanskies.

_get_sed(i, ratio_max: float = 0.9, dlog_wav: float = 0.000765)[source]

Generate an AGN SED.

Parameters:
  • i (int) – ID of AGN for which SED is returned.

  • ratio_max (float, optional) – Maximum allowed ratio flux_agn / flux_total for type2 AGN.

  • dlog_wav (float, optional) – SED wavelength resolution in dex.

_get_flux_single(my_sed, band, rest_frame, redshift, distance)[source]

Return a single bandbass flux by integrating the SED.

Take a rest-frame intrinsic SED and integrate it along a filter passband. The SED is shifted to either rest-frame (10pc) or observer frame in accordance with the parameters.

Parameters:
  • my_sed (QSOGEN SED object) – Input QSOGEN SED.

  • band (str) – EGG-style passband name.

  • rest_frame (bool) – Is rest_frame (else observer frame).

  • redshift (float) – Redshift of the SED

  • distance (float) – Distance at which to evaluate the flux.

get_flux_agn(band, rest_frame, idxs=None)[source]

Return vector of AGN pass-band fluxes.

Parameters:
  • band (str) – Band to estimate the flux in e.g. ‘lsst-r’.

  • rest_frame (bool) – Return rest-frame absolute magnitude instead of observed flux.

  • idxs (List[int] or None) – If defined, return a vector containing the fluxes for the given indices. Otherwise returns the fluxes for the full catalog including zero fluxes for non-AGN galaxies.

Returns:

flux_or_magabs – Estimated AGN flux(es) or absolute magnitude(s) based on the given flags.

Return type:

float

get_log_L_bol()[source]

Return log10 of the AGN bolometric luminosity in erg/s.

get_MBH(sigma_total=0.5, offset=0.0, sigma_intrinsic=False, sigma_observational=None, select=None, *args, **kwargs)[source]

Return log10 of the supermassive black hole mass in Msun.

The MBH is assigned in accordance with the continuity equation after which log-normal scatter is added to the final value of the MBH.

get_log_L_AGN_5_GHz(scatter=True)[source]

Return AGN radio luminosity according to the fundamental plane Gultekin+19.

get_log_lambda_Edd(log_l_edd=LOG_LAMBDA_EDD)[source]

Get the accretion ratio with respect to Eddington.

static get_magnitude_agn_dereddened(key, mag, ebv)[source]

Return a band-dependent dereddened optical/UV magnitude.

If a different key is given, simply return the value corresponding to the key.

Parameters:
  • key (str) – band e.g. “mock-4400” for the B-band

  • mag (float or array_like) – vector of magnitudes to be dereddened

  • ebv (float or array_like) – vector of E(B-V) values for the dereddening

get_occupation_fraction()[source]

Return black hole occupation fraction.

The black hole occupation fraction corresponds to the probability that a host galaxy with mass Mstar hosts a (super)massive black hole. This could especially prevalent in the dwarf galaxy (<1e9 Msun) regime.

The black hole occupation fraction applied here is based on Zou+2025 (accepted).

get_has_bh()[source]

Return whether the galaxy contains a SMBH according to the occupation fraction.

get_lightcurve(i, band, *args, **kwargs)[source]

Return an AGN lightcurve.

The lightcurve for an AGN is returned for the given band and MJD.

Parameters:
  • i (int) – ID of AGN for which SED is returned.

  • band (str) – EGG-style passband name.

get_lightcurve_mjd(i, band, mjd, mjd0)[source]

Return an AGN lightcurve at given MJD.

The lightcurve is first estimated assuming the timespan starting from 0. The lightcurve is then evaluated at MJD - MJD0 to return the final value of the lightcurve.

Parameters:
  • i (int) – ID of AGN for which SED is returned.

  • band (str) – EGG-style passband name.

  • mjd (float or array_like) – MJD of observation.

  • mjd0 (float) – MJD offset corresponding to the first light of the survey.

Return type:

The value of the lightcurve at given MJD in microjanskies.

Raises:

ValueError – If mjd + mjd0 is not within [0, ten years].