As light travels from an astrophysical source to its observer, it often encounters grains of interstellar dust. This dust can scatter light out of the line of sight. For X-ray wavelengths, this scattering occurs at small (<1°) angles, thereby creating a diffuse glow, or halo, around the source. These halos can be used to interrogate various properties of the dust between the observer and light source, such as composition, grain size, and physical position. This is done by comparing the observed halo to a predicted halo, which is associated with a specific dust model and scattering model. Unfortunately, modeling these halos requires one to complete fairly complex calculations while juggling a multitude of properties for each dust component. In order to simplify this process, we have engineered an object oriented python package called xhalo, which allows one to generate halo models without hassle. This was done in anticipation of an increase in halo observations, which will arise from The X-Ray Imaging and Spectroscopy Mission (XRISM), which has already begun to collect useful data. The package is equipped with many pre-programmed dust components and scatter models, and it provides intuitive methods for modifying them and creating new ones. Users can also use this package to create useful visualization, and to compare dust and scatter models against one another. The computational routines employed in this package are largely based on S-lang code that has been informally distributed for many years, and will therefore feel familiar and reliable to those who will most benefit from its use. This work is open source and continues to be maintained and update
For a demo, see src/xhalo/xhalo.ipynb.