Spectral model for the calculation of AGN SEDs, ranging from the Optical/UV (outer accretion disc) to the Hard X-ray (Innermost X-ray Corona), including a fully relativistic treatment. If this code is useful to your work, then please reference: Hagen & Done (2023b) (https://ui.adsabs.harvard.edu/abs/2023MNRAS.tmp.2391H/abstract)
This model is based off the physically motivated broad-band SED model AGNSED (Kubota & Done 2018), however with the addition of a fully relativistic treatment. The emissivity of the accretion flow is calculated following the relativistic treatment of Novikov & Thorne (1973) (This is also done in AGNSED), while the ray tracing from the point of emission to the observer is performed using the relativistic convolution code KYCONV (Dociak, Karas & Yaqoob 2004.) For a detailed description of the model please see Hagen & Done (2023b, submitted)
There are currently two version of the code: one in Python and another in Fortran. The Fortran version is written to be used with the spectral fitting software XSPEC. If you intend to use the model to analyse X-ray spectral data, then this will probably be the prefered version to use. The Python version, on the other hand, provides more flexibility for modelling purposes. Where the Fortran version will only produce a spectrum, the python version can be used to easily extract the physical properties of the system (e.g physical mass accretion rate, disc size, efficiency parameters, etc..) since these are all stored as attributes within the model (it's written in an object oriented manner). This would be more appropriate for working outside of XSPEC. Both versions have the same input parameters, and are detailed below.
It is also important to note, that both versions require a working installation of HEASOFT, since we use the XSPEC convolution model KYCONV to apply the relativistic effects. If you do not already have HEASOFT installed, it can be found here: https://heasarc.gsfc.nasa.gov/docs/software/heasoft/
-
Working installation of HEASOFT, since we use the XSPEC convolution model KYCONV to apply the relativistic effects this is required for both the Python and Fortran versions. If you do not already have HEASOFT installed, it can be found here: https://heasarc.gsfc.nasa.gov/docs/software/heasoft/. The code has been tested for HEASOFT versions: 6.29, 6.30, and 6.31; with XSPEC versions 12.12.0, 12.12.1, and 12.13.0
(If you have succesfully installed HEASOFT then you will have everything you need to run the Fortran version - seeing as HEASOFT won't build without the necessary compilers...) -
Numpy (ONLY for Python version - Tested for v.1.21.5)
-
Scipy (ONLY for Python version - Tested for v.1.9.3)
-
Astropy (ONLY for Python version - Tested for v.5.1)
Note: The Python version will ONLY run in Python 3! - We have been using v.3.9.12
- Download the source code files
relagn.f
andlmod_relagn.dat
, found within~/src/fortran_version
- Place in a directory of your choice, and open XSPEC
- Whthin XSPEC type:
initpackage relagn lmod_relagn.dat .
This will compile the code. Note, this assumes you are currently within the directory containing the source code files... - Still within XSPEC type:
lmod relagn .
This will load RELAGN as a local model in XSPEC (call as relagn). Again, this assumes you are currently within the directory containing the source code. If you wish to load it from a different location, replace.
with the explicit path to the relagn directory (i.e/path/to/relagn
) - (OPTIONAL) By default you will have to repeat step 4. every-time you open XSPEC. This is tedeous. Instead you can put the line
lmod relagn /path/to/relagn
in yourxspec.rc
file; located within your~/.xspec
directory. Ifxspec.rc
does not exist within~/.xspec
, you can simply make one! - (ALTERNATIVE) Instead of manully performing steps 3 to 5, you can simply excecute the shell scripts
compile_to_xspec.sh
andinit_autoLoad_xspec.sh
, which will perform steps 3-4 and 5 respectively
Currently the easiest way is to either clone this repository, or directly download the source code (i.e ALL the files within the ~/src/python_version
directory). Then add the source code file to your PYTHONPATH (or use sys.append() within your own scripts if you do not wish to directly edit the
PYTHONPATH...). Turning this into a package you can pip install is on the to-do list!!!
Par 1.
▸ Units:
▸ Description: Mass of the central Black Hole
Par 2.
▸ Units: Mpc
▸ Description: Co-Moving distance from the observer to the Black Hole
Par 3.
▸ Units:
▸ Descripton: Log Mass-accretion rate, scaled by the Eddington mass accretion-rate.
(i.e
Par 4.
▸ Units: Dimensionless
▸ Description: Black hole spin parameter. 0 implies non-spinning, while 1 is maximally spinning (with prograde rotation).
Note, the code will limit you to max 0.998 - This is the theoretical maximum assuming the presence of a disc
Par 5.
▸ Units: Dimensionless
▸ Description: Cosine of the inclination of the observer with respect to the disc, as measured from the z-axis with
the disc in the x-y plane
Par 6.
▸ Units: keV
▸ Description: Electron temperature for the hot Comptonising corona.
This sets the high-energy roll-over for the hot Comptonisation region
Par 7.
▸ Units keV
▸ Description: Electron temperature for the warm Comptonising region.
Par 8.
▸ Units: Dimensionless
▸ Description: Spectral index for the hot Comptonisation component
Par 9.
▸ Units: Dimensionless
▸ Description: Spectral index for the warm Comptonisation component
Par 10.
▸ Units:
▸ Description: Outer radius of the hot Corona.
If this is negative, then the code will set it to the innermost stable cirbular orbit,
Par 11.
▸ Units:
▸ Description: Outer radius of the warm Comptonisation region.
If this is negative, then the code will set it to
Par 12.
▸ Units:
▸ Description: Log of the outermost disc radius.
If this is negative, then the code will use the self-gravity radius from Laor & Netzer (1989)
Par 13.
▸ Units: Dimensionless
▸ Description: Colour-temperature correction to be applied to the standard *outer disc.
If this is negative, then the code follows the relation in Done et al. (2012). Otherwise treated as a constant correction
Par 14.
▸ Units:
▸ Description: Maximum scale-height of the inner-corona
Par 15.
▸ Units: Dimensionless
▸ Description: Redshift of the source
For more details, see Hagen & Done (2023b, submitted)
If you use RELAGN in your work, please cite Hagen & Done (2023b) (https://ui.adsabs.harvard.edu/abs/2023arXiv230401253H/abstract). You can use the following bibtex:
@ARTICLE{2023MNRAS.tmp.2391H,
author = {{Hagen}, Scott and {Done}, Chris},
title = "{Estimating black hole spin from AGN SED fitting: The impact of general-relativistic ray tracing}",
journal = {\mnras},
keywords = {accretion, accretion discs, black hole physics, galaxies: active, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Astrophysics of Galaxies},
year = 2023,
month = aug,
doi = {10.1093/mnras/stad2499},
archivePrefix = {arXiv},
eprint = {2304.01253},
primaryClass = {astro-ph.HE},
adsurl = {https://ui.adsabs.harvard.edu/abs/2023MNRAS.tmp.2391H},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}