Wednesday, November 03, 2010

xspec in python testers wanted

We have an alpha release of xspec for python available. This only supports a subset of commands as yet but we would like some volunteers to try it out and provide feedback on what they like and don't like as well as priorities for what to add next. Please e-mail us at the usual xspec12 address.

Friday, October 22, 2010

Minor fixes for MCMC code and new tclout version option

12.6.0t Various improvements made to the chain (MCMC) command: Removed misleading multiple chain output from the chain stat command when only 1 chain is loaded. Clarification added to the 1-D plot margin label. If chains are loaded, tclout simpar may now be used without a valid fit and even if no spectra are loaded. Bug fix to the definition of the Rubin-Gelman convergence measure. Our thanks to Simon Vaughan for pointing these issues out. This patch also fixes a bug wherein a "Chain IO" error may appear due to the selection of row 0 when internally accessing random rows in chains. Report added on Oct 22, 2010.

12.6.0u This adds a new tclout version option, making it easier to access the XSPEC version string from inside of Tcl scripts. Our thanks to Stefano Bianchi for this suggestion. Report added on Oct 22, 2010.

Wednesday, September 29, 2010

HEAsoft 6.10 available

The latest version of HEAsoft is available from the usual place. The only change to xspec is to include bug patches up to 12.6.0q. However, this release includes an update to QDP/PLT which fixes a problem when saving xspec plots to qdp files.

Tuesday, September 28, 2010


I've added a link on the xspec additional models page to Jörn Wilms' high-resolution ISM absorption model. This should be used by anyone analyzing grating spectra.

Wednesday, July 28, 2010

A note on the pileup model

It is easy to misinterpret the "PSF fraction" parameter in the pileup model. A natural reading is to suppose that this means the fraction of the PSF which is included in the source extraction region. This is not correct. For the pileup model to work well the extraction region should be large enough to include essentially all the PSF. The "PSF fraction" parameter is actually the fraction of counts detected which should not be included in the pileup calculation. The manual will be modified to make this clearer. My thanks to Pat Broos for pointing out this potential confusion.

Tuesday, July 27, 2010

cplinear model

I have added Pat Broos' cplinear model to the additional models page. This is a non-physical model developed within the AE package to handle background in the low count case.

Monday, July 12, 2010

Yaqoob & Murphy toroidal reprocessor model

I've added a link to the additional models page for the Yaqoob & Murphy model for X-ray obscuration and reflection by a toroidal reprocessor, valid in the Compton-thick regime.

Thursday, July 08, 2010

Wednesday, May 26, 2010

xspec patches from May

12.6.0i When running an XSPEC script, if a call to a user-defined Tcl procedure immediately follows a call to an XSPEC multi-line command (such as model, fakeit, or editmod), the procedure is not executed if its definition is in a nested script called from the current script file. Our thanks to Paul Nulsen for pointing this out. Report added on May 11, 2010.

12.6.0j A crash occurs when a delcomp operation is performed AND one or more parameters are linked to multiple parameters. Our thanks to Jeremy Sanders for pointing this out. Report added on May 19, 2010.

12.6.0k The tclout modval option should output a model's flux array even when no spectra are loaded. (In this case XSPEC will ignore the spectrum number parameter.) Our thanks to Veronica Biffi for pointing this out. Report added on May 26, 2010.

Tuesday, May 04, 2010

xspec patches from April

A few problems in 12.6 have been identified and patched. Information and patches are available on the xspec bugs page.

12.6.0c The setplot rebin option does not work properly when used in energy/wavelength mode AND channel energies are listed in descending order in the response EBOUNDS extension. Our thanks to Roderick Johnstone for pointing this out. Report added on Apr 01, 2010.

12.6.0d The chi-square does not change when running steppar on the redshift z parameter of a table model. Our thanks to Jeremy Sanders for pointing this out. Report added on Apr 08, 2010.

12.6.0e This improves the initpackage local models tool so that it now recognizes *.f03 file extensions for Fortran 2003 code, and it also now allows *.f90 extensions. Our thanks to Pablo Cassatella for bringing this issue to our attention. Report added on Apr 15, 2010.

12.6.0f For better compatibility with previous XSPEC releases, when multi-panel plots are performed interactively with iplot, the first panel should be designated PLT's currently active window rather than the last panel. Our thanks to Maria Caballero-Garcia for pointing this out. Report added on Apr 21, 2010.

12.6.0g This increases an internal buffer for handling PLT command strings. A larger size is now necessary when producing multi-panel plots which happen to contain a large number of plot vectors. Our thanks to Lijun Gou for pointing this out. Report added on Apr 30, 2010.

12.6.0h A couple of modifications to the behavior of steppar when not starting from a best fit: The delta fit statistic column will now show values relative to the original fit statistic, not the value it has after steppar performs an initial renormalization. Also when steppar detects a new best fit, it will now prompt the user only when the improvement exceeds the current setting of the fit's critical delta parameter. Our thanks to Jeremy Sanders for this suggestion. Report added on Apr 30, 2010.

Thursday, April 01, 2010

xselect bug in new release

Aargh ! There is an error in xselect in the new HEAsoft release. It has been fixed this morning but anyone who has already downloaded the distribution will need to replace the xselect.mdb by one available on the bugs page.

Wednesday, March 31, 2010

First two patches for xspec 12.6

We received two xspec bug reports whose fixes were too late to include in the latest release. Patches are in the usual place.

12.6.0a XSPEC issues a fatal error if the swind1 and zxipcf models are both used within the same session. Our thanks to Matteo Cerruti for pointing this out. Report added on Mar 29, 2010.

12.6.0b When applying fractional systematic errors to multiple channels grouped into a single bin, XSPEC should multiply by the square of the sum of the binned channels rather than the sum of the squares of the individual channels. Our thanks to Mike Nowak for pointing this out. Report added on Mar 31, 2010.

Tuesday, March 30, 2010

xspec 12.6 released

HEAsoft 6.9 is out including xspec v12.6. The release notes are below.

One point to note is that there have been internal changes to the models using the Magzdiarz & Zdziarski Compton reflection code. If there are local models out there which use internals from the xspec models they may break. Let us know and we will fix them.

New features in v12.6.0:

The main improvements in version 12.6.0 are to XSPEC's plotting capabilities:

- Multi-panel plotting is now supported for all combinations except
contour plots. For example, "plot data model resid ratio" will
produce a 4-panel plot on a single page. Up to 6 panels can be
plotted in this manner.

- There are many choices for axis units. These can be selected
using the "setplot energy" and "setplot wave" commands. For
example, "setplot energy GeV" uses GeV on the x- and y-axes.
"setplot wave" also has a new "perhz" option for displaying
the Y-axis in 1/Hz units.

- The "setplot" command has a new "redshift " option for shifting
displayed energies to the source frame.

Other new features:

- New models :
ireflect is a convolution model based on the pexriv code.
sirf is a multiblackbody self-irradiated funnel

- The normalizations on all power-law models (ie. powerlaw,
bknpow, bkn2pow, cutoffpl)can be changed to a flux over an
energy range by setting POW_EMIN and POW_EMAX keywords in "xset".
The powerlaw model then becomes equivalent to the pegpwlw model.

- The Compton reflection models (b/p)exr(a/i)v and (i)reflect have
been restructured to use adaptive Gauss-Kronrod quadrature for
the Greens' function integrals. The precision to which the
integrals are calculated can be set allowing a trade-off between
speed and precision.

- The wrapper functions additiveTable and multiplicativeTable
give external C++ models access to XSPEC's table model interpolation
routines (equivalent to the xsatbl and xsmtbl functions for Fortran

- The display of link expressions has been simplified to show only the
parameter numbers and not the extraneous component information.
Also "show model" will now only display the model components and
not the individual parameters. The parameters can be seen with
"show par".

Additional enhancements previously released as patches to 12.5.1:

- Added the solar abundance data set of Asplund, Grevesse, and Sauval
(2006) to the list of available tables accessed with the "abund"

- New "tclout nchan" option for returning the number of channels in a

- The "save" command now stores relative rather than absolute paths to
allow easier porting to other machines.

- The recorn model component has been converted from a mixing to a
multiplicative type. This allows a model to define multiple recorn

- A warning message is now issued if a user attempts to load a
response for a source n when there are still slots to fill for
source n-1. This is intended to catch cases where a user mistakenly
reverses the source and spectrum number input to the "response"

All bug fixes to v12.5.1 released as patches a - o are included in
v12.6.0. In addition the following problems have been corrected:

- It was possible for the addition of a systematic model error to
actually decrease the overall variance, when it was applied to a
zero-variance bin that was artificially increased by XSPEC for chi-
square fitting.

- Bug in "plot ratio" when using "setplot wave" with Hz units. Y-axis
model values < 10^-20 were not displayed in plot.

- The comptt model no longer stops and prompts the user when it fails
during its incomplete gamma calculation.

- The powerlaw model has been modified to avoid a numerical
instability that could occur if the index were within 10^-12 to
10^-15 of 1.0.

Friday, February 26, 2010

Plotting updates

The plotting in xspec has been restructured for greater flexibility. The main changes are as follows:

1. Up to six plots can be put on a single page. eg "plot data resid ratio model"

2. There are options for the units on both x- and y-axis. "setplot energy" can now be used to plot the x-axis in keV, MeV, GeV, or Hz. "setplot wave" as the unit options angstrom, cm, micron, or nm. y-axis units are mostly modified in the obvious way depending on the x-axis choice. For setplot energy options any energies in the y-axis unit will be the same as chosen for the y-axis. The exception is for the choice of Hz when emodel/eufspec is in Jy and eemodel/eeufspec in ergs/cm^2/s. For setplot wave options energies in the y-axis unit are in ergs. An additional choice is available for setplot wave : the command "setplot wave perhz" will put y-axis units in /Hz. In this case the emodel/eufspec and eemodel/eeufspec units are the same as for setplot energy hz. The option can be turned off by "setplot wave perhz off".

3. "setplot redshift" can be used to shift energies in plots to the source frame assuming the redshift given. Note that this is not connected in any way to redshift parameters in the model and should only be used for illustrative purposes.

These changes are available in the Goddard development version and will be included in the next HEAsoft release.

xspec power-law models

Added option to peg all the power-law models (ie powerlaw, bknpow, bkn2pow, cutoffpl) in the same way that the pegged power-law operates. If POW_EMIN and POW_EMAX are set (using xset) then all these models will have their normalizations adjusted to be the flux in (POW_EMIN,POW_EMAX) in units of 1e-12 erg/cm2/s or, if POW_EMIN=POW_EMAX, the flux density at POW_EMIN in units of micro-Jy.

A couple of things to watch out for are : POW_EMIN and POW_EMAX should lie within the energy range being calculated; the xset command doesn't automatically update the model so either POW_EMIN or POW_EMAX should be set before defining the model or a parameter value should be changed immediately after the xset.

These changes will be included in the next heasoft release.

Thursday, January 28, 2010

xspec bugs update

Not much activity in xspec bug reporting and fixing. The only recent patch is

12.5.1o Small fix to calculation of plot emodel/eemodel and eufspec/eeufspec when in setplot wave mode. This correction is only noticeable for very wide bins (bin widths approximately the size as the bin energy).

Tuesday, January 19, 2010

xselect and Einstein IPC data

Rich Mushotzky reported that xselect doesn't work on Einstein IPC event files. This was due to a bug in reading data from the MDB which only appears to be triggered in this specific case. I've checked in a fix. A workaround is to run extractor on its own and specify the xfkey, yfkey, xhkey, yhkey, and phamax hidden parameters.