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
models).

- 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"
command.

- 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 machines.

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

- 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"
command.

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.

Wednesday, December 16, 2009

updated Webspec for Chandra Cycle 12

Replaced the Cycle 11 responses and arfs with those for Cycle 12 and bumped the Chandra mission options to the top of the menu.

Tuesday, December 15, 2009

Snow Leopard

I've upgraded my MacBook Pro from Tiger all the way to Snow Leopard so here are a few observations.

1. Heasoft builds and runs successfully using gcc from Xcode (4.2.1) and gfortran from the R project Mac installer (http://r.research.att.com/tools/ : 4.2.3).

2. Heasoft builds and runs successfully using gcc from Xcode (4.2.1) and gfortran from the fink-installed gcc44 package (4.4.2).

3. Heasoft builds but xspec crashes using gcc and gfortran from the fink-installed gcc44 package. The problem appears to be conflicts in exception handling perhaps involving the system X11 library.

4. The iStat Menus application can be used to monitor usage of individual cores. I find that when running compute-intensive processes (such as xspec) both cores on my laptop get hammered. This implies that Apple, at least, are performing some parallelization in the compiler without specific user directives. This may depend on optimization settings.

Tuesday, November 17, 2009

replaced broken power law model code with C++

Rationalized the broken power law model code. Rewritten in C++ and calls powerLaw to evaluate individual sections of the model.

Friday, November 13, 2009

cflux model

One thing to note about the cflux model which is not clear in the documentation is that the model component(s) to which cflux is applied must integrate to a non-zero flux. For instance, cflux*pow where the pow norm is zero will generate NaNs from a divide-by-zero.

obscure extractor bug

Under some circumstances ROTANG elements in the output region extension could have junk values but only for region types where the rotation angle is irrelevant. This is fixed in extractor v5.14.

Wednesday, November 04, 2009

updated xselect XMM script

Updated the script run by save spectrum in the XMM case since I had assumed that CCDNR was the first DS keyword which appears not to always be the case.

Friday, October 23, 2009

WebSpec diagonal response

In answer to a request from Andy Lawrence I've added a unit diagonal response option to WebSpec. It appears at the bottom of the Mission/Instrument menu.

Thursday, October 08, 2009

bug in addascaspec

The addascaspec perl script in HEAsoft v6.7 does not run. A fixed version is available through the HEAsoft bugs page. Note that addascaspec can be used for spectra from missions other than ASCA.

definition of cemekl model

Paul Nulsen points out that the help for the cemekl (and cevmkl) model is misleading. The actual differential emission measure equation is dEM = (T/T_{max})^{alpha-1} dT/T_{max}. The documentation will be changed to match this.

patches for xspec v12.5.1

Patches 12.5.1a - k are available at the usual place. The most important are 12.5.1c and e which add the Solar abundances from Asplund et al. (2009) to the options and 12.5.1i which modifies the way the recorn model works (following comments from Rick Rothschild).

Thursday, September 03, 2009

max size of GTI arrays in extractor

At Lorella's request I increased the allowed GTI array size to 200,000. This should really be a dynamic array but that would require an extensive rewrite.