srcmodel.gabs

ximpol.srcmodel.gabs.main()[source]

Simple test code.

ximpol.srcmodel.gabs.mapped_column_density_HI(ra, dec, map_name='LAB')[source]

Return the mapped H_I column density at a given position in the sky.

The value is read from one of the available input maps. Note that the data in the maps are stored in Galactic coordinates, while we’re giving Celestial coordinates in input, here—the transformation is handled internally.

Parameters:
  • ra (float) – Right ascension of the source (in decimal degrees).
  • dec (float) – Declination of the source (in decimal degrees).
  • map (str) – The HI column density map to use. Can be either ‘LAB’ (LAB survey) or ‘DL’ (Dickey & Lockman).
class ximpol.srcmodel.gabs.xpeInterstellarAbsorptionModel(num_samples=1000)[source]

Class implementing the insterstellar absorption model using the Wisconsin (Morrison and McCammon; ApJ 270, 119) cross-sections.

Here we essentially read the numbers in table 2 from the paper and build an interpolated univariate linear spline with the photoabsorption cross section values. The cross section is parametrized as a set of piecewise quadratic functions fitted to the data in energy bins—see the figure below.

../_images/gabs_xsection.png

Example

>>> from ximpol.srcmodel.gabs import xpeInterstellarAbsorptionModel
>>> model = xpeInterstellarAbsorptionModel()
# Build a spline with the interstellar transmission factor as a function
# of the photon energy
>>> trans = model.transmission_factor(1.e22)
>>> trans.plot()
transmission_factor(column_density)[source]

Return the transmission factor for a given column density.

This is essentially returning

\varepsilon = \exp(-n_H\sigma)

../_images/gabs_trans_samples.png
Parameters:column_density (float) – The column density at which the transmission factor should be calculated.

Warning

We do have an issue with the extrapolation, here, as at the current stage there is no guarantee that the result of the spline evaluation would be <= 1. We could set the ext class member of the spline to 3 before reurning it, but event that would not be right in general. This is probably not a huge issue, but it should be addressed properly.

xsection_ecube()[source]

Return a spline with the values of absorption cross section multiplied by the cube of the energy, as a function of the energy.

This is essentially the same plot in Figure 1 of the original paper, as illustrated in the following figure

../_images/gabs_xsection_ecube.png