Kariba
Loading...
Searching...
No Matches
kariba::Compton Class Reference

Class inverse Compton, inherited from Radiation.hpp. More...

#include <Compton.hpp>

Inheritance diagram for kariba::Compton:
kariba::Radiation

Public Member Functions

 ~Compton ()
 
 Compton (size_t size, size_t seed_size)
 
double comintegral (size_t it, double blim, double ulim, double nu, double numin, double numax, gsl_spline *eldis, gsl_interp_accel *acc_eldis)
 
void compton_spectrum (double gmin, double gmax, gsl_spline *eldis, gsl_interp_accel *acc_eldis)
 
void cyclosyn_seed (const std::vector< double > &seed_arr, const std::vector< double > &seed_lum)
 
void bb_seed_k (const std::vector< double > &seed_arr, double Urad, double Tbb)
 
void bb_seed_kev (const std::vector< double > &seed_energ, double Urad, double Tbb)
 
void shsdisk_seed (const std::vector< double > &seed_arr, double tin, double rin, double rout, double h, double z)
 
void set_frequency (double numin, double numax)
 Method to set up the frequency array over desired range.
 
void set_tau (double n, double gam)
 
void set_tau (double _tau)
 
void set_escape (double escape)
 
void set_niter (double nu0, double Te)
 
void set_niter (size_t n)
 
void seed_freq_array (const std::vector< double > &seed_energ)
 Method to set up seed frequency array.
 
double get_tau () const
 
double get_ypar () const
 
void reset ()
 
void urad_test ()
 
void test ()
 
- Public Member Functions inherited from kariba::Radiation
 Radiation (size_t size)
 
const std::vector< double > & get_energy () const
 
const std::vector< double > & get_nphot () const
 
const std::vector< double > & get_energy_obs () const
 
const std::vector< double > & get_nphot_obs () const
 
size_t get_size () const
 
double get_volume () const
 
double integrated_luminosity (double numin, double numax)
 
void set_beaming (double theta, double speed, double doppler)
 Methods to set viewing angle, beaming and geometry of emission region.
 
void set_inclination (double theta)
 
void set_geometry (const std::string &geom, double l1, double l2)
 
void set_geometry (const std::string &geom, double l1)
 
void set_counterjet (bool flag)
 Method to include a counterjet in cyclosycnchrotron/Compton classes.
 
void test_arrays ()
 Simple method to check arrays; only meant for debugging.
 

Protected Attributes

size_t Niter
 number of IC iterations
 
double tau
 
double ypar
 optical depth/comtpon Y of emitting region
 
double rphot
 photospheric radius when tau > 1, used to renormalize volume
 
double escape_corr
 escape term, used to renormalize our spectra to CompPS
 
std::vector< double > seed_energ
 array of seed frequencies in Hz
 
std::vector< double > seed_urad
 array of seed photon number density in log10(#/erg/cm^3)
 
std::vector< double > iter_urad
 array of iterated photon number density in log10(#/erg/cm^3)
 
gsl_spline * seed_ph
 interpolation of photon field array seed_urad
 
gsl_interp_accel * acc_seed
 accelerator for above spline
 
gsl_spline * iter_ph
 interpolation of photon field for multiple scatters
 
gsl_interp_accel * acc_iter
 accelerator of above spline
 
gsl_spline2d * esc_p_sph
 radiative transfer
 
gsl_spline2d * esc_p_cyl
 radiative transfer
 
gsl_interp_accel * acc_tau
 accelerator of above spline over tau
 
gsl_interp_accel * acc_Te
 accelerator of above spline over Te
 
- Protected Attributes inherited from kariba::Radiation
std::vector< double > en_phot
 array of photon energies
 
std::vector< double > num_phot
 array of number of photons in units of erg/s/Hz
 
std::vector< double > en_phot_obs
 same as above but in observer frame
 
std::vector< double > num_phot_obs
 same as above but in observer frame
 
double r
 
double z
 Dimensions of emitting region.
 
double vol
 Volume of emitting region.
 
double beta
 speed of the emitting region
 
double dopfac
 
double angle
 Viewing angle/Doppler factor of emitting region.
 
double dopnum
 Doppler boosting exponent, depends on geometry.
 
bool counterjet
 boolean switch if user wants to include counterjet emission
 
std::string geometry
 string to track geometry of emitting region
 

Friends

double comfnc (double ein, void *p)
 
double comint (double gam, void *p)
 
double disk_integral (double alfa, void *p)
 

Detailed Description

Class inverse Compton, inherited from Radiation.hpp.

Constructor & Destructor Documentation

◆ ~Compton()

kariba::Compton::~Compton ( )

◆ Compton()

kariba::Compton::Compton ( size_t  size,
size_t  seed_size 
)

Member Function Documentation

◆ bb_seed_k()

void kariba::Compton::bb_seed_k ( const std::vector< double > &  seed_arr,
double  Urad,
double  Tbb 
)

Method to include black body to seed field for IC; Note: Urad and Tbb need to be passed in the co-moving frame, the function does NOT account for beaming

◆ bb_seed_kev()

void kariba::Compton::bb_seed_kev ( const std::vector< double > &  seed_energ,
double  Urad,
double  Tbb 
)

◆ comintegral()

double kariba::Compton::comintegral ( size_t  it,
double  blim,
double  ulim,
double  enphot,
double  enphmin,
double  enphmax,
gsl_spline *  eldis,
gsl_interp_accel *  acc_eldis 
)

This integrates the individual electron spectrum from comint over the total electron distribution

◆ compton_spectrum()

void kariba::Compton::compton_spectrum ( double  gmin,
double  gmax,
gsl_spline *  eldis,
gsl_interp_accel *  acc_eldis 
)

This calculates the final spectrum in all frequency bins, including multiple scatters. Note: the reason the Doppler boosting is a factor of 2 instead of 3 is because the calculations are done for a conical jet in the Lind&BLanford 1985 prescription

◆ cyclosyn_seed()

void kariba::Compton::cyclosyn_seed ( const std::vector< double > &  seed_arr,
const std::vector< double > &  seed_lum 
)

Method to include cyclosynchrotron array from Cyclosyn.hh to the seed field. The two input arrays should be get_energ() and get_nphot() methods from Cyclosyn.hh. If the seed_urad array wasn't empty, the contribution is automatically added to the existing one. note: the second condition has a <= sign to dodge numerical errors when the seed field energy density is extremely low, which can result in negative values/nan for the seed_urad

◆ get_tau()

double kariba::Compton::get_tau ( ) const
inline

◆ get_ypar()

double kariba::Compton::get_ypar ( ) const
inline

◆ reset()

void kariba::Compton::reset ( )

This resets the energy density in case different photon fields want to be calculated separately to see the contribution of each

◆ seed_freq_array()

void kariba::Compton::seed_freq_array ( const std::vector< double > &  seed_energ)

Method to set up seed frequency array.

◆ set_escape()

void kariba::Compton::set_escape ( double  escape)

This method is to hard-code an escape term, e.g. to implement a different geometry

◆ set_frequency()

void kariba::Compton::set_frequency ( double  numin,
double  numax 
)

Method to set up the frequency array over desired range.

◆ set_niter() [1/2]

void kariba::Compton::set_niter ( double  nu0,
double  Te 
)

Method to estimate the number of scatterings the electrons go through; scatters are repeated until the photons reach the same typical energy as the electrons Input parameters are initial scale frequency of photons in Hz and temperature of scattering electrons in erg note: this assumes that a) the final energy of the photons is set only by the electrons and b) that the photons have one scale energy only; it could be incorrect if scattering multiple photon fields (e.g. disk and cyclosynchrotron)

◆ set_niter() [2/2]

void kariba::Compton::set_niter ( size_t  n)

◆ set_tau() [1/2]

void kariba::Compton::set_tau ( double  _tau)

◆ set_tau() [2/2]

void kariba::Compton::set_tau ( double  n,
double  Te 
)

Sets optical depth for given number density of emitting region (assuming radius is set correctly), and compton-Y for a given electron average Lorentz factor. In some cases not covered by the radiative transfer tables, escape_corr reverts to the constructor default value of 1.

◆ shsdisk_seed()

void kariba::Compton::shsdisk_seed ( const std::vector< double > &  seed_arr,
double  tin,
double  rin,
double  rout,
double  h,
double  z 
)

◆ test()

void kariba::Compton::test ( )

◆ urad_test()

void kariba::Compton::urad_test ( )

Friends And Related Symbol Documentation

◆ comfnc

double comfnc ( double  ein,
void *  p 
)
friend

This function is the kernel of eq 2.48 in Blumenthal & Gould(1970), represents the scattered photon spectrum for a given electron and includes the Klein-Nishina cross section.

◆ comint

double comint ( double  gam,
void *  p 
)
friend

This function is the integral of comfnc above over the total seed photon distribution

◆ disk_integral

double disk_integral ( double  alfa,
void *  p 
)
friend

Calculates incident photon field for a Shakura-Sunyaev disk with aspect ratio H, inner temperature Tin, inner radius Rin, at a distance z from the disk, taking beaming into account

Member Data Documentation

◆ acc_iter

gsl_interp_accel* kariba::Compton::acc_iter
protected

accelerator of above spline

◆ acc_seed

gsl_interp_accel* kariba::Compton::acc_seed
protected

accelerator for above spline

◆ acc_tau

gsl_interp_accel* kariba::Compton::acc_tau
protected

accelerator of above spline over tau

◆ acc_Te

gsl_interp_accel* kariba::Compton::acc_Te
protected

accelerator of above spline over Te

◆ esc_p_cyl

gsl_spline2d* kariba::Compton::esc_p_cyl
protected

radiative transfer

interpolation for escape calculation to mimic

◆ esc_p_sph

gsl_spline2d* kariba::Compton::esc_p_sph
protected

radiative transfer

interpolation for escape calculation to mimic

◆ escape_corr

double kariba::Compton::escape_corr
protected

escape term, used to renormalize our spectra to CompPS

◆ iter_ph

gsl_spline* kariba::Compton::iter_ph
protected

interpolation of photon field for multiple scatters

◆ iter_urad

std::vector<double> kariba::Compton::iter_urad
protected

array of iterated photon number density in log10(#/erg/cm^3)

◆ Niter

size_t kariba::Compton::Niter
protected

number of IC iterations

◆ rphot

double kariba::Compton::rphot
protected

photospheric radius when tau > 1, used to renormalize volume

◆ seed_energ

std::vector<double> kariba::Compton::seed_energ
protected

array of seed frequencies in Hz

◆ seed_ph

gsl_spline* kariba::Compton::seed_ph
protected

interpolation of photon field array seed_urad

◆ seed_urad

std::vector<double> kariba::Compton::seed_urad
protected

array of seed photon number density in log10(#/erg/cm^3)

◆ tau

double kariba::Compton::tau
protected

◆ ypar

double kariba::Compton::ypar
protected

optical depth/comtpon Y of emitting region


The documentation for this class was generated from the following files: