Next: About this document ...
Previous: Appendix H: Changes between
Appendix I: Older Release Notes
v12.9.0 Jul 2015
- Mix model components are no longer heavily restricted in their usage.
Previously mix components could only be placed at the start of a model
expression, to operate on the results of the rest of the expression.
Now they can be inserted throughout the expression in the same manner as
- Models with mix components can also be assigned to source numbers
other than 1. A corollary of this is that a mix model is no longer
required to operate on all currently loaded spectra.
- To allow more than one mix model at a time the syntax for XFLT####
keywords has been generalized. These keywords are now strings of form
"key: value" with xspec maintaining an internal database of key, value
pairs which mixing model code can access. Backward compatibility with
the old version of XFLT#### containing only a value is maintained.
- Expanded the types of expressions allowed in parameter linking. It
can now handle the same mathematical functionality supported in mdefine
equations. Related to this, parameters can also be specified as p#
and modelName:p# in link expressions, as well as the old # and
modelName:#. The link expressions are now displayed using the p#
- The output of the plot margin command is now independent of the grid size.
There is a new plot integprob command which also must be run after the margin
command and which plots the integrated probability within the contours shown.
- The data and back commands now handle files with multiple SPECTRUM extensions.
There are a number of ways of specifying a particular extension: filenameN will
use the Nth SPECTRUM extension; filenameSPECTRUM2 will look for an extension
called SPECTRUM2; filenameback will use the first SPECTRUM extension with the
HDUCLAS2 keyword set to ``BKG''; filenamename=value will look for a SPECTRUM
extension with keyword name set to value (in this case there must be no spaces
within the ). If the BACKFILE keyword in a source filename is set to the filename
itself then XSPEC will get the background from the extension with HDUCLAS2 set to
``BKG'' (this, finally, makes Chandra level 3 files work seemlessly in XSPEC).
- The error command now has a nonew option. This determines whether
to repeat the calculation when a new minimum is found. Previously it
was relying on the query setting to make this decision.
- Added grey-scale image as background to to contour plots (to
remove them use the image off command in PLT. plot dem now
displays a histogram. The new plot eqw option shows the distribution of equivalent
width values after running the eqwidth command with the err option.
- New model nlapec. There is also an APECNOLINES xset
option which will turn off lines for all apec models.
- The models using AtomDB files now require the line files to be sorted in
increasing order of energy within each element and ion. This allows a speed-up
in the model calculation.
- Replaced the rescalecov script with the chain rescale command.
- The plot delc command now works for cstat, plotting (obs-mod)/error, however
it is important to remember that this is not plotting contributions to the statistic.
Enhancements previously released as patches to 12.8.2
- A new -udmget64 option has been added to initpackage. This is
intended for Mac platform users with local Fortran models which still
make use of the udmget memory allocation function.
- tclout steppar can now retrieve values of the variable parameters as
well has the fixed parameters which are being stepped through.
All bug fixes to v12.8.2 released as patches are included in v12.9.0.
In addition the following problems have been corrected:
- For the case where counting statistics are not applied,
fakeit now outputs the spectrum in a RATE column rather than
COUNTS. This is to remove bias caused by truncation errors. It
also now outputs a STAT_ERR column and sets the POISSERR flag to
- Special characters have been removed from all model parameter
names and (generally) replaced with underscores. This is to make
their name strings more easily accessible in PyXspec.
- When calculating tclout peakrsid with Cstat, it should not
make use of correction files.
- Redundant model fold calculations have been removed during
certain update contexts.
- Fix to vequil model array assignment error.
- The default filenames for fakeit output should always be in the
current run directory, even when the response file is in a different
- A file-write race condition has been eliminated for the case of
running lmod in parallel XSPEC sessions.
- the vvnei model had the tau and meankT parameters flipped.
- the AtomDB input files were being reopened unnecessarily often.
Changes to PyXSpec
- Local models may now be written in Python and inserted into XSPEC's
models library with new AllModels.addPyMod() function.
- The plot array retrieval interface (ie. Plot.x(), Plot.y()) has been
expanded to allow retrieval from secondary plot panels in a mulit-panel
- New Parameter.index attribute.
- New backscale attribute for Spectrum and Background classes.
- Added new function Fit.stepparResults() for retrieving results of most recent
steppar run. (Previously available as a patch)
- New noWrite option added to AllData.fakeit (Previously available as patch)
- The Model.__call__ function now returns Parameter objects by reference
rather than by value. This is to allow the returned object to retain any
custom attributes the user may have added.
- Improved handling of Ctrl-c breaking in several prompting contexts.
V12.8.2 Jul 2014
- The code underlying the NEI models has been rewritten to
accommodate the new AtomDB 3.0 files, the beta version of which are
included as the default when using any of the NEI models. Older
versions can be recovered using xset NEIVERS. The CEI models (apec
etc) use some of the same code but there should be no change in
their behavior except for a slight speed-up.
- New models:
- agauss - Gaussian model with units in Angstrom and a Gaussian
shape in wavelength space.
- nsx - Neutron star non-magnetic atmosphere model from Wynn Ho
- nsmaxg - Neutron star magnetic atmosphere model.
- rnei - NEI recombination model assuming an initial temperature.
- vrnei - rnei with variable abundances for the common elements.
- vvrnei - rnei with variable abundances for all elements (Z <= 30).
- zagauss - The agauss model with a redshift parameter.
- The goodness command has added options fit|nofit. The fit option
runs a fit on each simulation before calculating the test statistic.
- The cstat fit statistic can be modified by appending an integer
eg. statistic cstat5. In this case the statistic will be evaluated
as if the group min N had been used in grppha. This is not as
efficient because the rebinning has to be done every statistic
evaluation however it is useful for testing using simulations.
model command now checks that parameters are all within a
reasonable order of magnitude () of each other, and issues a
warning if they are not.
- Improved the handling of new-best-fit cases when running the
error command on parallel processes. The global new-best-fit is
now automatically retained. Previously the user was prompted to
re-run error in a single process.
- Models can now store (keyword,value) pairs using loadDbValue
(C++)or PDBVAL (Fortran). These values can be recovered using the
tclout <modkeyval> option. This provides a way to get
internal information from the last invocation of a model. There is
a manual XSFunctions_guide.pdf in
Xspec/src/help describing some of the C++ classes used in
the XSFunctions library. This is intended to make it easier to use
these classes in other models.
Enhancements previously released as patches to 12.8.1
- PyXspec: added Fit.testStatistic attribute for retrieving the test statistic value
from the most recent fit.
- PyXspec: added compiler macros for
switching to <Python/Python.h> include paths when building on Mac
All bug fixes to v12.8.1 released as patches are included in
v12.8.2. In addition the following problems have been corrected:
- Fix for a particular case of non-associative expression
evaluation. Models of the form C((M1*A)M2) or C(M1*A)M2, where C is
a convolution component, were being wrongly evaluated as
- For users with external programs linking to the XSPEC
model library, the FNINIT function now properly initializes the
AtomDB version to v2.0.2.
- Fix for an ignore command syntax
evaluation that was causing a crash on OS X Mavericks.
V12.8.1 Aug 2013
- New models:
- cpflux - a variant of cflux for photon flux.
- heilin - Voigt absorption profiles for the HeI series
- lyman - Voigt absorption profiles for the HI or HeII series
- zbabs - EUV ISM attenuation
- A new statistic, pgstat, has been added for the case of
Poisson-distributed data with a Gaussian-distributed background. The
whittle statistic can now be used when fitting averaged power
density functions by appending an integer (so eg whittle5 is the
statistic to use when fitting a pdf constructed by averaging those
from 5 observations).
- The old CERN Minuit library, which is used for the migrad,
minim, monte, and simplex fitting methods and the
improve command, has been replaced by the new version. The
minim and monte methods are no longer supported and the
new version does not include an improve command. The output
from the migrad and simplex fitting methods now looks
the same as that from the leven method. Note however that the
rules for when to write intermediate fit results are not directly
comparable so do not provide a measure of the relative speed of the
- fakeit now has a <nowrite> option to generate fake spectra
without producing output files. This is also now available in the
multifake.tcl script command.
- Parallel processing capability has been added to the
steppar command and can be invoked using the parallel
- Markov Chain Monte Carlo (the chain command) now uses the
Goodman-Weare algorithm by default. Previously the default was
- After a chain run, the best-fit parameters and statistic are now
displayed with chain info, and are available through the
tclout chain option.
- The default AtomDB version used in apec models may now be
modified with the ATOMDB_VERSION keyword in the user's
- steppar now has a <delta> option for performing grids
centered on the best-fit parameters.
- The setplot delete option has been enhanced to allow
removal of all or a range of commands.
- For external programs calling XSPEC, new wrapper functions have
been added for retrieving XFLT keywords from data files.
- Norm parameters are now set with a default ``soft'' upper limit
below their ``hard'' upper limit.
- In PyXspec, the Fit.statMethod and statTest attributes can now
be set for individual spectra.
Enhancements previously released as patches to 12.8.0
- AtomDB has been upgraded to version 2.0.2.
- The tclout <stat> and <statmethod> options can now
retrieve the test statistic as well as the fit statistic.
- The simftest Tcl script command now takes an optional
filename argument for output.
- Attributes added to PyXspec classes: Xset.parallel, Fit.statTest.
All bug fixes to v12.8.0 released as patches are included in v12.8.1. In addition the following problems have been corrected:
- The command history file xspec.hty (in the user's
/.xspec directory) is now updated when exiting
XSPEC with the quit command. Previously it was only updated
when exiting with exit.
- The chain command can now read/write files in ASCII format
when running in the default Goodman-Weare mode. Previously this
feature was only available for Metropolis-Hastings chains.
- Fix to an array access error in the nthcomp model.
- PyXspec fix removes error messages generated when accessing
response parameters in Python versions 2.6.x.
v12.8.0 Dec 2012
- Parallel-processing capability for specific tasks has been added
by way of the new parallel command. This allows the user to set a
maximum number of processes to spawn when running certain XSPEC
commands. Currently the options for parallel-processing are limited
to use with the fit and error and commands, though we plan to
implement more in the near future. This first implementation is
considered to be a BETA release, and we look forward to hearing your
comments and suggestions.
- XSPEC now distinguishes between the fit statistic and the
test statistic. The fit statistic is used to find the best-fit
parameter values and errors while the test statistic is used to
provide a goodness-of-fit. Consequently, the goodness command now
uses the test statistic. Separating these two classes of statistic
has allowed us to add a number of new test statistics. These include
Kolmogorov-Smirnov and the related Anderson-Darling and Cramer-von
Mises. Also new are the runs statistic, based on the number of runs
of consecutive positive (or negative) residuals, and the Pearson
Chi-Square (pchi) statistic, Pearson's original test statistic.
- The basic Levenberg-Marquardt fit algorithm has undergone a
number of changes. The most visible is an additional column in the
output during the fit. |beta|/N is the norm of the vector of
derivatives of the statistic with respect to the parameters divided
by the number of parameters. At the best fit this should be zero so
provides another measure of how well the fit is converging. |beta|/N
can also be used as the criterion to stop the fit instead of the
statistic delta although this is still considered experimental.
- Other internal changes to the fit algorithm are to treat the
first iteration as a special case where only normalizations are
allowed to change and to add the option of using delayed
gratification, which can speed up convergence.
- New models: compmag, comptb, rgsxsrc. The latter is reinstated
from it use in XSPEC v11.
- New plotting command plot goodness, for plotting a
histogram of the most recent goodness simulation.
- New tclout option <goodness sims>.
- Added the option of using the Goodman-Weare algorithm instead of
Metropolis-Hastings when using the chains command to run MCMC.
- Added the Whittle statistic for fitting models to power density spectra.
- If a data file is read which has RESPFILE='''' then the response
extensions (MATRIX, EBOUNDS) are read from the same file.
- Added support for a new type of model component: a mixing
component which operates on the model pre-multiplied by the
effective area. This is similar to the pile-up model type but allows
for a models which require mixing between multiple spectra.
- Table model files can now have interpolated and additional
parameters intermixed provided that additional parameters are
indicated by METHOD=-1 in the PARAMETERS extension.
Enhancements previously released as patches to 12.7.1
- The "plot chain" has a new "thin" option for thinning the display of chain points.
- Added a "tclout ignore" option for easy retrieval of currently ignored channels. Similar capability added to PyXspec's Spectrum class.
All bug fixes to v12.7.1 released as patches are included in
v12.8.0. In addition the following problems have been corrected:
- The eqpair model used wrongly-sized arrays when multiple spectra
were used with RMFs having varying numbers of photon energy bins.
Eqpair (plus eqtherm and compth) also needed a new default value for
its optical depth parameter, which fixes the problem if parameter 4
- A fit parameter which started close to the minimum/maximum could
under some circumstances be incorrectly pegged at the
- When the error command was run on a model with soft limits
(ie. soft limits for some parameters set to a narrower range than
hard limits), and the best fit value fell within the soft limit
region, the displayed differences (in parentheses) were not
consistent with the reported limits.
- Problem occurred in apec model when zero width lines were in the
final energy bin.
- Fix to a potential normalization problem occurring in lorentz
model with low-energy large-width lines.
- When running initpackage and lmod from PyXspec on certain Linux
builds, local models calling functions in XSPEC's xslib library
producing unresolved symbol link errors.
v12.7.1 March 2012
- New models: gadem, vgadem, eplogpar, logpar, optxagn, optxagnf, and pexmon.
- The convolution models rdblur, rdblur2, kdblur and kerrconv have
been sped up. They are now O(N) instead of O(N) where N is the
number of energy bins in the response.
- Continued rationalization of Compton reflection
routines. eqpair, eqtherm, compth, compps, ntee now all use the same
routines as reflect and ireflct. For models with ionized reflector
there may be changes in results because the new code uses the actual
input spectrum to calculate the ionization fractions while the old
code assumed a power-law.
- The parameter simulation arrays used for the calculation of
eqwidth and flux error are now accessible through tclout.
- initpackage now works on Cygwin. The static_initpackage
work-around is no longer needed and has been removed.
- New Fortran interface wrapper function RFLABD, for reading new
abundance tables into external programs using the XSPEC models
- Added an xsetbl function for use in external programs. This
provides access to XSPEC's internal exponential table model
routines, similar to what xsatbl and xsmtbl do for additive and
multiplicative table models.
- bayes command is now supported for response parameters (ie. gain).
- New show version option.
- Improved error command output messaging. The error
results now have lower chatter level (5) than most of the warning
messages (10), thus making it easier to filter out the warnings.
- PyXspec beta version upgraded to v1.0. See the PyXspec release
notes for details.
Enhancements previously released as patches to 12.7.0
- New tclout options: <nullhyp>, <rerror>.
All bug fixes to v12.7.0 released as patches a-u are included in
v12.7.1. In addition the following problems have been corrected:
- Program aborted when attempting to fit with gain parameters
attched to dummy responses.
- Program aborted when removing a spectrum with a response
containing gain parameters, AND while that response was temporarily
replaced with a dummy response.
- The save command did not add the default .xcm
extension for file names that included a path.
- A crash could occur if the EBOUNDS array wasn't the right size.
- It was not possible to plot 2 or more models in a multi-panel
plot model display.
v12.7.0 May 2011
- The primary new feature of 12.7.0 is the addition of the Python
module, PyXspec v0.9 beta. PyXspec is built and installed by
default on most platforms along with the regular XSPEC build, and
simply requires an import xspec statement to load into
Python. XSPEC can now be run from object-oriented Python scripts, or
interactively from a Python shell prompt. Detailed instructions can
be found in PyXspec.pdf. While most features of standard XSPEC are
already supported in this beta release, some still remain to be
implemented. Please let us know if any missing feature is of
particular importance to you, or if you have suggestions and ideas
- New models:
- cplinear: Piecewise linear non-physical background model for
low-count spectra developed for Chandra by Patrick Broos.
- eqpair, eqtherm, compth: Paolo Coppi's hybrid hot plasma emission models.
- vvapec, bvvapec: APEC models allowing all 30 elemental
abundances to vary (for use with AtomDB 2.0).
- zigm: Multiplicative model, computes the mean attenuation of
the optical/UV spectrum by the intergalactic medium.
- zashift, zmshift: Convolution models for applying redshifts to
additive and multiplicative models respectively.
- Also note that the default APEC model data files have been
updated to AtomDB 2.0. This version of AtomDB includes contributions
from more elements than earlier versions. When using the apec and
vapec models these extra elements have Solar abundance by
default. To change this use xset APEC_TRACE_ABUND.
- The statistic command may now be applied to individual
spectra. This makes it possible to simultaneously fit spectra which
require different fit statistics.
- Added the pgstat option to the statistic
command. This is similar to using cstat with a background file
except that the background is assumed to have Gaussian statistics
(not Poisson) read from a STAT_ERR (and optionally SYS_ERR) column.
- Modified the pileup model for consistency with Sherpa and ISIS.
A new parameter fracexpo is added which should be set to the
FRACEXPO keyword value in the ARF.
- It is now possible to choose proportional or fixed fit deltas
from the startup Xspec.init file. The initial default setting is
now proportional deltas rather than fixed deltas.
- Improvements made to the output generated during a fit. The
parameter names are listed at the top of columns, not just their
numbers. Column alignment has been improved, and is no longer
limited to a maximum width of 5 columns.
- Added reporting of the Bayesian contribution (if any) to the fit
Enhancements previously released as patches to 12.6.0
- Initpackage now recognizes and builds files with .f03 extensions
for Fortran 2003, and .f90 extensions for Fortran 90.
- Added a new fakeit option for setting the fake background
- Added a new tclout version option for returning the XSPEC
- Improved XSPEC's internal update mechanism to reduce the number
of model calculations.
All bug fixes to v12.6.0 released as patches a - ab are included in
v12.7.0. In addition the following problems have been corrected:
- A crash occurred if tclout notice energies was performed
on a spectrum containing only a dummy response with no channels.
- The 5 redundant xset options (those which merely duplicate
other existing XSPEC commands) weren't passing their arguments to
the command handlers correctly.
- Fit error messages were misleading for the case where the data
was missing a suitable response, or when the only existing models
- A fatal error could occur in fakeit when attempting to
generate a background file while only a dummy was used for the
- The bayes command handler was not properly handling the
case where the prior type option string was abbreviated.
- A crash occurred when flux was run in error mode and the
specified energy was entirely outside the range of one or more
v12.6.0 March 2010
- The main improvements in version 12.6.0 are to XSPEC's plotting
- 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 <z> option for
shifting displayed energies to the source frame.
- 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
- 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
Additional enhancements previously released as patches to
- Added the solar abundance data set of Asplund, Grevesse, and
Sauval (2006) to the list of available tables accessed with the
- New tclout nchan option for returning the number of
channels in a spectrum. The save command now stores relative
rather than absolute paths to allow easier porting to other
- 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
- Bug in plot ratio when using setplot wave with Hz units. Y-axis model values
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 to
v12.5.1 Aug. 2009
- Gain parameters can now be used in the error,
freeze, newpar, thaw, and untie commands by
prefixing the command name with the letter ``r'' (for ``response
parameter'', the more general category to which gain parameters
belong). steppar can now also handle gain parameters. Gain
parameters can be displayed either with show parameters or the
new show rparameters option.
- The gain command syntax has changed when using multiple
sources. To better conform with the rest of XSPEC, it now requires
<source number>:<spectrum number> rather than the reverse.
- Gain parameter limit values can be stored in response files,
using the keywords GSLOP_MIN, GSLOP_MAX, GOFFS_MIN, and
- All input and output data filenames can now include
CFITSIO/FTOOLS extended-syntax for specifying particular HDUs. As a
result, XSPEC can now handle files which contain spectra, ARFs and
RMFs in multiple extensions.
- Partial derivative calculations during fitting can now be
performed numerically rather than with an approximated analytical
expression. This option is chosen in the Xspec.init initialization
- If a new minimum is found during a steppar run,
steppar now prompts the user for acceptance of the new values.
Also the delta statistic column of a steppar run is now obtainable
with the tclout steppar delstat option.
- The output warning message has been improved in the case where
Levenberg-Marquardt fitting runs into a zero diagonal element in the
second derivative matrix. Similarly, the more frequent
pegged-parameter messages (due to running into hard limits) is now
output at higher chatter levels only.
- All calls to the xanlib dynamic memory allocation function
udmget have been removed from the Fortran models in XSPEC's models
library. The relevant code has been converted to C++. If a user's
local models library still requires the udmget code, they'll need to
run initpackage with the new -udmget option.
Additional enhancements previously released as patches to
- Setplot wave x-axis units can be toggled from Hz to angstroms
through WAVE_PLOT_UNITS entry in Xspec.init file.
- New tclout gain and tclout sigma options.
- New xs_getVersion function available for those linking their
own programs to the XSPEC models library.
- The show parameters option can now take a range of
parameters for displaying subsets.
All bug fixes to v12.5.0 released as patches a - an are included in
v12.5.1. In addition the following problems have been corrected.
- After running the arf command, any gain previously applied to
the associated RMF will be removed. Previously it was erroneously
applying the gain to the new ARF.
- Additional header file inclusions needed in code files to
compile with g++-4.4.0
- Extra line-feed characters removed from Ascii text files in the
modelData directory. These were causing problems on
Solaris 10 w/f90.
- The nthcomp model's internal arrays were hardcoded to a maximum
size of 5000 energy bins. The size is now dynamically allocated.
(This also affects the diskir model.)
- A Levenberg-Marquardt fit now immediately stops if the fit
statistic becomes NaN due to an erroneous model calculation.
- C++-style comments have been removed from xsFortran.h for the
benefit of users compiling their own C programs with the models
- Plotting fix for case where setplot area is selected and
no models are currently loaded.
- Model parsing fix for case of nested parentheses with no '+'
operator, ie. A(B(C*D)).
Next: About this document ...
Previous: Appendix H: Changes between