slsim.Sources.SourceCatalogues.QuasarCatalog.qsogen package¶
Submodules¶
slsim.Sources.SourceCatalogues.QuasarCatalog.qsogen.config module¶
Configuration file with parameters for qsosed.py Parameters derived from SDSS DR16Q x UKIDSS LAS x unWISE as described in Temple, Hewett & Banerji (2021).
Idea is to load emission line templates, host galaxy template, and extinction curve once to minimise i/o.
@author: Matthew Temple Edit 2021 July: v20210625 emline_templates and associated model params Edit 2022 May: update reference to published paper 2021MNRAS.508..737T
slsim.Sources.SourceCatalogues.QuasarCatalog.qsogen.qsosed module¶
Code to produce model quasar SEDs. See accompanying README file for further details.
Need accompanying config.py file and three additional input files: qsosed_emlines_20210625.dat Emission line templates S0_template_norm.sed Host galaxy template pl_ext_comp_03.sph Quasar extinction curve
@author: Matthew Temple
This version first created 2019 Feb 07; last updated 2021 Mar 13.
- class slsim.Sources.SourceCatalogues.QuasarCatalog.qsogen.qsosed.Quasar_sed(z=2.0, LogL3000=46.0, wavlen=array([891.25093813, 891.40794382, 891.56497716, ..., 30188.87992327, 30194.19809521, 30199.51720402]), ebv=0.0, params={'M_i': None, 'bbnorm': 2.94, 'bcnorm': False, 'benorm': -27.0, 'beslope': 0.183, 'emline_template': array([[9.79293876e+02, 9.80421997e+02, 9.81551339e+02, ..., 2.89473684e+04, 2.94736842e+04, 3.00000000e+04], [4.64096341e-04, -2.85561605e-03, 3.02818941e-03, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [1.21593599e+00, 1.21534654e+00, 1.21475741e+00, ..., 3.26770586e-02, 3.25653794e-02, 3.24560486e-02], [-1.05298952e-02, -2.12181954e-02, -1.24047760e-02, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [1.14580878e-02, 1.55069633e-02, 1.84611548e-02, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00]]), 'emline_type': None, 'fragal': 0.0, 'galaxy_template': array([[1.00500e+03, 1.01500e+03, 1.02500e+03, ..., 4.06400e+07, 4.62400e+07, 5.26100e+07], [8.97489e-02, 8.63186e-02, 5.15279e-02, ..., 1.30440e-11, 6.17798e-12, 2.92272e-12]]), 'gflag': False, 'gplind': 0.0, 'lyForest': True, 'lylim': 912.0, 'plbrk1': 3900.97, 'plbrk3': 500.0, 'plslp1': -0.43, 'plslp2': -0.05, 'plstep': -1.0, 'reddening_curve': array([[5.00000e+02, 5.05000e+02, 5.10000e+02, ..., 5.99900e+04, 5.99950e+04, 6.00000e+04], [2.60623e+01, 2.58231e+01, 2.55883e+01, ..., -2.55656e+00, -2.55656e+00, -2.55656e+00]]), 'scal_emline': -0.9936, 'scal_halpha': 1.0, 'scal_lya': 1.0, 'scal_nlr': 1.0, 'tbb': 1391.09, 'zlum_lumval': array([[0.23, 0.34, 0.6, 1., 1.4, 1.8, 2.2, 2.6, 3., 3.3, 3.7, 4.13, 4.5], [-21.76, -22.9, -24.1, -25.4, -26., -26.6, -27.1, -27.6, -27.9, -28.1, -28.4, -28.6, -28.9]])}, cosmo=None, **kwargs)[source]¶
Bases:
objectConstruct an instance of the quasar SED model.
Attributes¶
- fluxndarray
Flux per unit wavelength from total SED, i.e. quasar plus host galaxy.
- host_galaxy_fluxndarray
Flux p.u.w. from host galaxy component of the model SED.
- wavlenndarray
Wavelength array in the rest frame.
- wavredndarray
Wavelength array in the observed frame.
Examples¶
Create and plot quasar models using default params at redshifts z=2 and z=4 >>> Quasar2 = Quasar_sed(z=2) >>> Quasar4 = Quasar_sed(z=4) >>> import matplotlib.pyplot as plt >>> plt.plot(Quasar2.wavred, Quasar2.flux, label=’$z=2$ quasar model’) >>> plt.plot(Quasar4.wavred, Quasar4.flux, label=’$z=4$ quasar model’)
- add_balmer_continuum(tbc=15000.0, taube=1.0, wavbe=3646.0, wnorm=3000.0, vfwhm=5000.0)[source]¶
Add Balmer continuum emission to the model.
Prescription from Grandi 1982ApJ…255…25G.
Parameters¶
- tbc
BC temperature in Kelvin.
- taube
The optical depth at wavelength wavbe, the Balmer edge.
- bcnorm
Normalisation of the BC at wavelength wnorm Angstroms.
- add_emission_lines(wavnrm=5500, wmin=6000, wmax=7000)[source]¶
Add emission lines to the model SED.
Emission-lines are included via 4 emission-line templates, which are packaged with a reference continuum. One of these templates gives the average line emission for a M_i=-27 SDSS DR16 quasar at z~2. The narrow optical lines have been isolated in a separate template to allow them to be re-scaled if necesssary. Two templates represent the observed extrema of the high- ionisation UV lines, with self.emline_type controlling the balance between strong, peaky, systemic emission and weak, highly skewed emission. Default is to let this vary as a function of redshift using self.beslope, which represents the Baldwin effect. The template scaling is specified by self.scal_emline, with positive values producing a scaling by intensity, whereas negative values give a scaling that preserves the equivalent-width of the lines relative to the reference continuum template. The facility to scale the H-alpha line by a multiple of the overall emission-line scaling is included through the parameter scal_halpha, and the ability to rescale the narrow [OIII], Hbeta, etc emission is included through scal_nlr.
- convert_fnu_flambda(flxnrm=1.0, wavnrm=5100)[source]¶
Convert f_nu to f_lamda, using c/lambda^2 conversion.
Normalise such that f_lambda(wavnrm) is equal to flxnrm.
- host_galaxy(gwnmin=4000.0, gwnmax=5000.0)[source]¶
Correctly normalise the host galaxy contribution.
- lyman_forest()[source]¶
Suppress flux due to incomplete transmission through the IGM.
Include suppression due to Ly alpha, Ly beta, Ly gamma, using parameterisation of Becker+ 2013MNRAS.430.2067B: tau_eff(z) = 0.751*((1+z)/(1+3.5))**2.90-0.132 for z > 1.45, and assuming tau_Lyb = 0.16*tau_Lya tau_Lyg = 0.056*tau_Lya from ratio of oscillator strengths (e.g. Keating+ 2020MNRAS.497..906K).
- set_continuum(flxnrm=1.0, wavnrm=5500)[source]¶
Set multi-powerlaw continuum in flux density per unit frequency.
- wav2flux(wav)[source]¶
Convert a wavelength to a flux.
Different from self.flux[wav2num(wav)], as wav2flux interpolates in an attempt to avoid problems when wavlen has gaps. This mitigation only works before the emission lines are added to the model, and so wav2flux should only be used with a reasonably dense wavelength array.
- slsim.Sources.SourceCatalogues.QuasarCatalog.qsogen.qsosed.bb(tbb, wav)[source]¶
Blackbody shape in flux per unit frequency.
Parameters¶
- tbb
Temperature in Kelvin.
- wavfloat or ndarray of floats
Wavelength in Angstroms.
Returns¶
- Fluxfloat or ndarray of floats
(Non-normalised) Blackbody flux density per unit frequency.
Notes¶
h*c/k_b = 1.43877735e8 KelvinAngstrom
- slsim.Sources.SourceCatalogues.QuasarCatalog.qsogen.qsosed.four_pi_dL_sq(z, cosmo)[source]¶
Compute luminosity distance factor for flux-luminosity conversion.
Returns log10(4 * pi * dL^2) in cgs units (cm^2).
Module contents¶
- class slsim.Sources.SourceCatalogues.QuasarCatalog.qsogen.Quasar_sed(z=2.0, LogL3000=46.0, wavlen=array([891.25093813, 891.40794382, 891.56497716, ..., 30188.87992327, 30194.19809521, 30199.51720402]), ebv=0.0, params={'M_i': None, 'bbnorm': 2.94, 'bcnorm': False, 'benorm': -27.0, 'beslope': 0.183, 'emline_template': array([[9.79293876e+02, 9.80421997e+02, 9.81551339e+02, ..., 2.89473684e+04, 2.94736842e+04, 3.00000000e+04], [4.64096341e-04, -2.85561605e-03, 3.02818941e-03, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [1.21593599e+00, 1.21534654e+00, 1.21475741e+00, ..., 3.26770586e-02, 3.25653794e-02, 3.24560486e-02], [-1.05298952e-02, -2.12181954e-02, -1.24047760e-02, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [1.14580878e-02, 1.55069633e-02, 1.84611548e-02, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00]]), 'emline_type': None, 'fragal': 0.0, 'galaxy_template': array([[1.00500e+03, 1.01500e+03, 1.02500e+03, ..., 4.06400e+07, 4.62400e+07, 5.26100e+07], [8.97489e-02, 8.63186e-02, 5.15279e-02, ..., 1.30440e-11, 6.17798e-12, 2.92272e-12]]), 'gflag': False, 'gplind': 0.0, 'lyForest': True, 'lylim': 912.0, 'plbrk1': 3900.97, 'plbrk3': 500.0, 'plslp1': -0.43, 'plslp2': -0.05, 'plstep': -1.0, 'reddening_curve': array([[5.00000e+02, 5.05000e+02, 5.10000e+02, ..., 5.99900e+04, 5.99950e+04, 6.00000e+04], [2.60623e+01, 2.58231e+01, 2.55883e+01, ..., -2.55656e+00, -2.55656e+00, -2.55656e+00]]), 'scal_emline': -0.9936, 'scal_halpha': 1.0, 'scal_lya': 1.0, 'scal_nlr': 1.0, 'tbb': 1391.09, 'zlum_lumval': array([[0.23, 0.34, 0.6, 1., 1.4, 1.8, 2.2, 2.6, 3., 3.3, 3.7, 4.13, 4.5], [-21.76, -22.9, -24.1, -25.4, -26., -26.6, -27.1, -27.6, -27.9, -28.1, -28.4, -28.6, -28.9]])}, cosmo=None, **kwargs)[source]¶
Bases:
objectConstruct an instance of the quasar SED model.
Attributes¶
- fluxndarray
Flux per unit wavelength from total SED, i.e. quasar plus host galaxy.
- host_galaxy_fluxndarray
Flux p.u.w. from host galaxy component of the model SED.
- wavlenndarray
Wavelength array in the rest frame.
- wavredndarray
Wavelength array in the observed frame.
Examples¶
Create and plot quasar models using default params at redshifts z=2 and z=4 >>> Quasar2 = Quasar_sed(z=2) >>> Quasar4 = Quasar_sed(z=4) >>> import matplotlib.pyplot as plt >>> plt.plot(Quasar2.wavred, Quasar2.flux, label=’$z=2$ quasar model’) >>> plt.plot(Quasar4.wavred, Quasar4.flux, label=’$z=4$ quasar model’)
- add_balmer_continuum(tbc=15000.0, taube=1.0, wavbe=3646.0, wnorm=3000.0, vfwhm=5000.0)[source]¶
Add Balmer continuum emission to the model.
Prescription from Grandi 1982ApJ…255…25G.
Parameters¶
- tbc
BC temperature in Kelvin.
- taube
The optical depth at wavelength wavbe, the Balmer edge.
- bcnorm
Normalisation of the BC at wavelength wnorm Angstroms.
- add_emission_lines(wavnrm=5500, wmin=6000, wmax=7000)[source]¶
Add emission lines to the model SED.
Emission-lines are included via 4 emission-line templates, which are packaged with a reference continuum. One of these templates gives the average line emission for a M_i=-27 SDSS DR16 quasar at z~2. The narrow optical lines have been isolated in a separate template to allow them to be re-scaled if necesssary. Two templates represent the observed extrema of the high- ionisation UV lines, with self.emline_type controlling the balance between strong, peaky, systemic emission and weak, highly skewed emission. Default is to let this vary as a function of redshift using self.beslope, which represents the Baldwin effect. The template scaling is specified by self.scal_emline, with positive values producing a scaling by intensity, whereas negative values give a scaling that preserves the equivalent-width of the lines relative to the reference continuum template. The facility to scale the H-alpha line by a multiple of the overall emission-line scaling is included through the parameter scal_halpha, and the ability to rescale the narrow [OIII], Hbeta, etc emission is included through scal_nlr.
- convert_fnu_flambda(flxnrm=1.0, wavnrm=5100)[source]¶
Convert f_nu to f_lamda, using c/lambda^2 conversion.
Normalise such that f_lambda(wavnrm) is equal to flxnrm.
- host_galaxy(gwnmin=4000.0, gwnmax=5000.0)[source]¶
Correctly normalise the host galaxy contribution.
- lyman_forest()[source]¶
Suppress flux due to incomplete transmission through the IGM.
Include suppression due to Ly alpha, Ly beta, Ly gamma, using parameterisation of Becker+ 2013MNRAS.430.2067B: tau_eff(z) = 0.751*((1+z)/(1+3.5))**2.90-0.132 for z > 1.45, and assuming tau_Lyb = 0.16*tau_Lya tau_Lyg = 0.056*tau_Lya from ratio of oscillator strengths (e.g. Keating+ 2020MNRAS.497..906K).
- set_continuum(flxnrm=1.0, wavnrm=5500)[source]¶
Set multi-powerlaw continuum in flux density per unit frequency.
- wav2flux(wav)[source]¶
Convert a wavelength to a flux.
Different from self.flux[wav2num(wav)], as wav2flux interpolates in an attempt to avoid problems when wavlen has gaps. This mitigation only works before the emission lines are added to the model, and so wav2flux should only be used with a reasonably dense wavelength array.