Date: November 25, 2022.

This document is available in PDF format

This package is now under version control at

This cookbook describes the usage of the bwcycl (Becker & Wolff) model, whose application details are reported in C. Ferrigno, P. A. Becker, A. Segreto, T. Mineo & A. Santangelo 2009, A&A, 498, 825 Study of the accreting pulsar 4U 0115+63 using a bulk and thermal Comptonization model. The original model is described in P. A. Becker & M. Wolff 2007, ApJ 654, 435B Thermal and Bulk Comptonization in Accretion-powered X-Ray Pulsars .

The bwcycl model is part of the standard Xspec distrubution since version 12.11 (March 2020) and it exploitis some special function implementation from the GSL library, which is used in the Xspec distribution.

1. Usage guidelines

The bwcycl model has a large set of parameters and not all of them can be constrained in the fit and are shown in Table 1. We suggest here a procedure to use the model.

It is mandatory to:

  1. freeze the model normalization to one;
  2. set the source distance in kpc;
  3. set and freeze the neutron star parameters (default values are a good choice).
  4. select which source terms should be computed.

The computation of the black-body source term is time consuming, because it involves the numerical solution of an integral. Since the contribution of this component is generally negligible, we strongly suggest to set the parameter BBnorm to zero and then to fix it to one for the final runs. The parameters FFnorm and CYCnorm should be fixed to one.1

The mass accretion rate is strongly degenerate with the accretion column radius and the parameter ξ: it is therefore advisable to fix to a suitable value, which can be derived by equaling the X-ray luminosity to the accretion luminosity or a fraction of it. For source in which the magnetic field is well above the plasma temperature and the contribution by the cyclotron emission term is minor, it is suggested to link the magnetic filed of the continuum model to the one derived by the cyclotron scattering absorption feature(s).

For particular combinations of the parameters, the special functions used in the GSL libraries do not provide a finite value and a “Not a number” (NaN) is returned to Xspec. We found that the following parameter constraints avoid most of NaN occurrences:

Finally, large values of r0 > 1000 km should be avoided. When a NaN is returned the program prints out the parameter values for which this occurred and the contraints can be refined.

It is important to limit the parameter ranges in a customary way and maybe tune the mass accretion rate to a value which keeps these parameters in the range suggested by physical considerations. We notice that equaling the accretion and the X-ray luminosities is not granted to yield meaningful results for all sources.

We found that it is possible to define a derived model as:
mdefine newbw bwcycl(Radius,Mass,csi,csiDel/(csi+10.85)**1.63,
in the Xspec prompt or:
xspec.AllModels.mdefine(’newbw bwcycl(Radius,Mass,csi,
csiDel/(csi+10.85)**1.63,B,Mdot,Te,r0,D,BBnorm,CYCnorm,FFnorm)’) in pyXspec, with the parameter csiDel limited between ~ 10-4 and ~ 103 and ξ from 0.01 to 20. However, for ξ >~ 5, the lower limit of csiDel should be increased to about 3.

This complex setting could permit a safe exploration of the parameter space, while avoiding most of NaN in the model computation.

Table 1: Model parameters.

RNS Neutron star radius in km (to be fixed)
MNS Neutron star mass in M (to be fixed)
ξ a parameter linked to the photon escape time (order of some unities)
δ the ratio between bulk and thermal Comptonization importances
B magnetic field in units of 1012 Gauss
Mass accretion rate in units of 1017gs-1
Te Electron temperature in units of keV
r0 column radius in units of m
D source distance in units of kpc (to be fixed)
BBnorm Normalization of the Black body seed photon component (fix it to zero at first)
CYCnormNormalization of the Cyclotron emission seed photon component (fix it to one)
FFnorm Normalization of the Breemstrahlung emission seed photon component (fix it to one)


For any problem and suggestions, please contact
Carlo Ferrigno email: