This is a simple class to read 3ML models and compute the spectral width as defined in Axelsson et al. (2015) and Yu et al. 2015.
$> git clone https://github.com/grburgess/width_calculator
$> cd width_calculator
$> python setup.py install
The width calculator works on either 3ML models from spectral catalogs or from fits.
from threeML import *
from width_calculator import *
# create a toy model
band = Band()
model = Model( PointSource('test',0,0,spectral_shape=band))
wc = WidthCalculator(model=model)
wc.angle
wc.width
If you find this code useful in your research, please consider citing the authors of the original work linked above as well as Burgess 2017