Commit c82236f2 authored by Guang's avatar Guang
Browse files

create xray module (not finished yet)

parent c9bcd4b5
......@@ -6,3 +6,4 @@ pcigale/data/data.db
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Centre de données Astrophysiques de Marseille
# Copyright (C) 2013 Institute of Astronomy, University of Cambridge
# Copyright (C) 2014 University of Crete
# Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt
# Author: Guang Yang
X-ray module
This module implements the intrinsic (unobscured) X-ray emission from
AGN corona.
from collections import OrderedDict
import numpy as np
import scipy.constants as cst
from . import SedModule
class Xray(SedModule):
"""X-ray emission
This module computes the X-ray emission from AGN corona.
parameter_list = OrderedDict([
("gam", (
"The photon index (Gamma) of intrinsic X-ray spectrum.",
("k_bol", (
"The AGN bolometric correction for 2-10 keV. Possible values are above 5.",
def _init_code(self):
"""Build the model for a given set of parameters."""
self.gam = float(self.parameters["gam"])
self.k_bol = float(self.parameters["k_bol"])
# We define various constants necessary to compute the model. For
# consistency, we define the speed of light in nm s¯¹ rather than in
# m s¯¹.
c = cst.c * 1e9
# We define the wavelength range for the non thermal emission
self.wave = np.logspace(5., 9., 1000.)
# We compute the synchrotron emission normalised at 21cm
self.lumin_nonthermal = ((1./self.wave)**(-self.alpha + 2.) /
(1./2.1e8)**(-self.alpha + 2.))
# Normalisation factor from the FIR/radio correlation to apply to the
# IR luminosity
S21cm = (1. / (10.**self.qir*3.75e12)) * (c/(2.1e8)**2)
self.lumin_nonthermal *= S21cm
def process(self, sed):
"""Add the radio contribution.
sed: pcigale.sed.SED object
if 'dust.luminosity' not in
sed.add_info('dust.luminosity', 1., True)
luminosity =['dust.luminosity']
sed.add_module(, self.parameters)
sed.add_info("radio.qir", self.qir)
sed.add_info("radio.alpha", self.alpha)
sed.add_contribution('radio_nonthermal', self.wave,
self.lumin_nonthermal * luminosity)
# SedModule to be returned by get_module
Module = Radio
......@@ -98,6 +98,7 @@ class Configuration(object):
"dustatt_2powerlaws"] +
["Dust emission: casey2012, dale2014, dl2007, dl2014, themis"] +
["AGN: dale2014, fritz2006"] +
["X-ray: xray"] +
["Radio: radio"] +
["Restframe parameters: restframe_parameters"] +
["Redshift: redshifting (mandatory!)"])
......@@ -269,6 +270,7 @@ class Configuration(object):
'dl2007', 'dl2014',
('AGN', ['dale2014', 'fritz2006']),
('X-ray', ['xray']),
('radio', ['radio']),
......@@ -282,6 +284,7 @@ class Configuration(object):
'dust attenuation': "No dust attenuation module found.",
'dust emission': "No dust emission module found.",
'AGN': "No AGN module found.",
'X-ray': "No X-ray module found.",
'radio': "No radio module found.",
'restframe_parameters': "No restframe parameters module "
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment