Giter Club home page Giter Club logo

qsosed's Introduction

Disclaimer [This has not been mantained for a while, please review the code before using for your research.]

QSOSED

This Python module handles various calculations involving the accretion physics of AGNs. In particular, it implements the qsosed model of Xspec, explained in Kubota & Done (2018) to create the flux energy distribution in the UV/X-Ray band of an AGN.

the SED model has three characteristic regions: the outer standard disc region; the warm Comptonising region; and the inner hot Comptonising region.

For the warm Comptonising region, this model adopts the passive disc scenario tested by Petrucci et al. 2018 (https://ui.adsabs.harvard.edu//#abs/2018A&A...611A..59P/abstract). Here, the flow is assumed to be completely radially stratified, emitting as a standard disc blackbody from Rout to Rwarm, as warm Comptonisation from Rwarm to Rhot and then makes a transition to the hard X-ray emitting hot Comptonisation component from Rhot to RISCO. The warm Comptonisation component is optically thick, so is associated with material in the disc. Nonetheless, the energy does not thermalise to even a modified blackbody, perhaps indicating that significant dissipation takes place within the vertical structure of the disc, rather than being predominantly released in the midplane.

At a radius below Rhot, the energy is emitted in the hot Comptonisation component. This has much lower optical depth, so it is not the disc itself. In the model, the albedo is fixed at a = 0.3, and the seed photon temperature for the hot Comptonisation component is calculated internally. In contrast to optxagnf, this model does not take the color temperature correction into account.

Table of contents

Setup

The easiest install method is

pip install pyagn

Requirements

Requirements are installed automatically if the package is installed via pip, otherwise they can also be install through

pip install -r requirements.txt

The specific requirements are:

numpy
scipy
matplotlib
astropy

Parameters for the SED class

parameter type description default
M float Black Hole mass in solar masses. 1e8
mdot float Black Hole accretion rate in Eddington units. 0.5
astar float Black Hole dimensionless spin absolute value. 0
astar_sign int +1 for prograde rotation, -1 for retrograde. +1
reprocessing boolean True to include reprocessing, False otherwise. True
hard_xray_fraction float Dissipated corona luminosity in Eddington units. 0.02
corona_electron_energy float Electron temperature for the hot Comptonisation component in keV 100
warm_electron_energy float Electron temperature for the warm Comptonisation component in keV. 0.2
warm_photon_index float The spectral index $\Gamma$ of the warm Comptonisation component. 2.5
reflection_albedo float reflection albedo for the reprocessed flux 0.3

Example usage

from pyagn import SED
from astropy import units as u

# initialize class
M = 1e8
mdot = 0.5
a = 0
sed_test = SED(M=M, mdot = mdot, astar = 0)

# choose a distance in cm.
distance = 100 * u.Mpc
distance_cm = distance.to(u.cm).value

# compute total flux
total_flux = sed_test.total_flux( distance = distance_cm)

# we can also easily plot the results

fig, ax = plt.subplots(9,6)
sed_test.plot_total_flux(distance, ax=ax)

Total_flux_plot

Comparison with Xspec

We can test that our Python implementation gives the same results as the Xspec code. Note that in order to recreate Xspec results, the innner disk radius has to be multiplied by a factor of 0.85. This is an artifact of the energy binning in Xspec.

M = 1e8
mdot = 0.5

xspec_comparison1 xspec_comparison2

qsosed's People

Contributors

arnauqb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

qsosed's Issues

Could not find SED module with pip install

Hi, I install the package by pip install pyagn, it seems success and could import pyagn as well. But when I test your example, it seems that could not load SED from pyagn package "ImportError: cannot import name 'SED' from 'pyagn' ".
I also try to download the package in github, but there exists anther error when I use the commmend "python setup.py install", it says "Project name qsosed was given, but was not able to be found".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.