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.

Wednesday, August 19, 2009

Solar abundances in xspec

Jeremy Sanders provided Solar abundances from Asplund, Grevesse & Sauval (2005) which I have added to abundances.dat in the develop version of xspec.

Update 9/8/09: Martin Asplund supplied values from his 2009 ARAA paper so I used them instead for the aspl abundance option.

light curves with extractor

Alex requested a way of better controlling the start time of a light curve created using extractor. I've added a new parameter lcstart which sets the time of the first bin (in spacecraft time units). This is checked into the development version as extractor v5.12.

cleansis

We have seen a few cases of observations of bright sources using Suzaku where running cleansis creates a hole in the image. Part of the problem is running with too high a log probability parameter but there is also a subtle error when iterating. Pixels which are already identified as bad and have their counts set to zero are still included when calculating the local background. This artificially lowers the estimated background hence increases the probability that a pixel will be flagged as bad.

I changed the algorithm so that pixels flagged as bad in previous iterations are ignored when calculating the local background. This change has been checked into the development version.

New release

HEAsoft 6.7 is now available. This includes XSPEC v12.5.1. The biggest change is in gain fitting which has been reworked as the preliminary step towards allowing the creation of response models. Response models will be created analogously to spectral models and will be used to either replace or augment response matrices.

This release is also the first which does not include XSPEC v11. This version has in practice not been supported for some time and it is getting increasingly difficult to ensure that it builds and runs on all systems.

Friday, June 12, 2009

XSPEC bug fixes update

12.5.0af The zredden multiplicative model component is calling the same function as redden, and therefore its redshift parameter has no effect. Our thanks to Brian Refsdal for pointing this out. Report added on May 05, 2009.

12.5.0ag When in setplot wave mode and the user's Xspec.init file entry for WAVE_PLOT_UNITS is set to angstrom, plot efficiency and plot icounts don't display due to a missing plot label error. Our thanks to Maurice Leutenegger for pointing this out. Report added on May 08, 2009.

12.5.0ah Fix to sqrt(2) error in the definition of the thermal broadening used in APEC models. Our thanks to Irina Zhuravleva for pointing this out. Report added on May 21, 2009.

12.5.0ai This adds a new C-callable function to provide access to the version string for users linking the XSPEC models library into their own programs. The function is declared in src/XSUtil/FunctionUtils/xsFortran.h, and has the prototype:

int xs_getVersion(char* buffer, int buffSize);

Report added on May 22, 2009.

12.5.0aj The model command fails to parse expressions that are explicitly of the form: M(M1(A1)+M2(A2)+M3(A3)). Our thanks to Jeremy Sanders for pointing this out. Report added on May 22, 2009.

12.5.0ak When soft limits are in use during fitting, the pegged parameter test should be comparing the actual value against the hard limits, not the adjusted value. Otherwise the parameter may in some cases peg too soon. Report added on June 08, 2009.

12.5.0al The same sqrt(2) fix mentioned in patch 12.5.0ah is needed when thermal broadening is turned on for v2.0 NEI models. Our thanks to Richard Sturm for pointing this out. Report added on June 08, 2009.