Friday, October 31, 2008

Suzaku AO4 on WebSpec

I've updated WebSpec with Suzaku AO4 files. The HXD background files supplied had a total exposure of 3e6 seconds. The recommended procedure is to have a background file with the same exposure as the source file. This assumes that statistical errors on the background are Poisson and the systematic error can be represented by changing the total normalization (using corfile). I modified the standard background files to change them from COUNTS to RATE so an input background file could be created for a given exposure time just by changing the EXPOSURE keyword.

Note that fakeit with a background file creates a simulated source spectrum with the exposure requested and a simulated background spectrum with the same exposure as that of the input background file. A useful enhancement for fakeit would be to control the exposure of the simulated background file - one possibility would be to allow commands such as
XSPEC12> fakeit inbackground.pha 50000

UPDATE 11/04/08: Fixed an error on the energy ranges for the PIN. The input background spectrum is only valid up to 75 keV. Also, use an background exposure time of 10 x that of the source for the PIN as recommended by the HXD team.

Thursday, October 30, 2008

latest xspec bug fixes

Three patches have been put out in the last couple of weeks. Two of these deal with the case when parameters differ by very large amounts. This is not recommended - xspec will work best if all the parameters are scaled to O(1).

12.4.0ap In a Levenberg-Marquardt fit, the zero threshold for the diagonals of the second-derivatives matrix needs to be reduced. This is relevant for cases where fit parameters may differ by enormously large (~10^20) magnitudes. Our thanks to Roderick Johnstone for pointing this out. Report added on Oct 21, 2008.

12.4.0aq The tclout model command no longer appends a newline character to the model name. This allows its output value to be used more easily as an argument to another XSPEC command. Our thanks to Jeremy Sanders for pointing this out. Report added on Oct 23, 2008.

12.4.0ar This adds automatic normalization to the covariance calculation performed at the end of a Levenberg-Marquardt fit, which makes it more robust when dealing with large differences in magnitude among the fit parameters. Report added on Oct 29, 2008.

Redshifts in models

Here is a possible generic way to handle redshifts in model components. Allow any component to have a "z" prepended to its name eg pow-> zpow. The model parser strips off the z while setting a has-redshift flag. Any model component with the has-redshift flag set gets a redshift parameter added (after all the other parameters and before any normalization). When evaluating the model the function is passed a redshifted energy array if has-redshift is set. The output flux array could also be corrected for the (1+z) normalization factors although we would have to be careful to make this consistent with the flux and luminosity commands.

The only type of model where this would not work is one which uses the redshift for something in addition to the energy shift - I think the only such case is the cooling flow which needs the luminosity distance to convert the Mdot parameter to an amount of flux to add.

Wednesday, October 29, 2008

Partial covering convolution model

The new release will include a partial covering convolution model (partcov) which can be used to turn any absorption model into a partially covered version. This depends on the new model parsing that takes into account the non-associative nature of convolution models. So, if P is the partial covering model, M the multiplicative absorption model and A the additive model then (PM)A turns M into a partial covering absorption. However PMA or P(MA) applies the partial covering the product of M and A which does not give the desired result.

Monday, October 27, 2008

CHANTYPE problems

The Suzaku HXD PIN files use a CHANTYPE of PI_PIN. Strictly speaking this is a violation of the standard however it seems too limiting to just allow CHANTYPE the values of PHA or PI. xspec currently generates a spurious error message about mismatched CHANTYPE when reading the HXD spectrum and response. I've put a temporary workaround in RealResponse.cxx which suppresses the spurious warning however we need a more general solution.

Friday, October 24, 2008

update to Jeremy's spex python script

Jeremy Sanders pointed out that files created by his python script using SPEX have no pseudo-continuum causing a seg fault in sumape.f. I've checked in a fix to sumape and Jeremy has also supplied an updated version of the script which avoids the problem (by creating a zero pseudo-continuum).

Tuesday, October 21, 2008

recorn model

I've worked out how to implement the v11 recornrm model in v12 and allow the correction file norm to be a free parameter. This is done through a new model recorn which has parameters the spectrum number and the correction norm. It is implemented as a mixing model though it doesn't actually do anything to the model spectrum - just changes the correction norm stored in the dataset object. It has to be done as a mixing model to ensure that the XSFunctions library stays free of symbol references to xspec internals - mixing models are not included in XSFunctions but have their own library. This model will be included in the release planned for early November.

Saturday, October 18, 2008

Fixed bug in new extractor

Pre-release testing on the Swift pipeline showed up an embarrassing bug in extractor v5 - the BACKSCAL keyword was not written correctly. This is now fixed in v5.02.

There was also a problem writing out the ROTBOX shape in the REGION extension. Further, Swift software does not recognize ROTBOX at present so I changed this to BOX even when there is a rotation angle. This may produce problems with other missions. These changes are v5.03.

And another bug this time when writing the REGION extension in the case when the input event file already has one and further region filtering is performed by extractor. v5.04.

More minor fixes. Removed the reference to number of events rejected because they fall outside the region (which extractor can no longer no). Eliminated duplication of identical regions in the same component being written to the REGION extension. v5.05.

Wednesday, October 08, 2008

new Comptonization model

Jack Steiner, Ramesh Narayan, Jeff McClintock (CfA) and Ken Ebisawa (ISAS) have supplied a new comptonization convolution model for xspec. This is available under the additional models website and will be included in the next xspec release.

Monday, October 06, 2008

xselect bug in save time

Roderick Johnstone reported that the command "save time cursor" ignores the final argument and always then prompts for it. Triggering this bug depended on which commands had been used earlier. Fixed xsel_save.f.

Thursday, October 02, 2008

Fortran compiler notes

I've been working on building heasoft distributions using both gfortran and g95. This under Tiger with Xcode 2.4.1 (which is gcc 4.0.1).

g95 is the current snapshot binary from www.g95.org which is v0.92. It is installed under /usr/local. To build I had to edit the hmakerc files after configure to remove -fno-f2c from the FFLAGS macro.

gfortran is from "fink install gcc42" and is v4.2.2. To build requires editing hmakerc to change -O2 to -O in the FOPT macro and to add at the beginning of the F77LIBS4C the directories -L/usr/lib -L/usr/lib/i686-apple-darwin8/4.0.1 and -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin8/4.2.2. Note that it is vital they be in this order and at the beginning of the macro or else the loader will link in gcc v4.2.2 libraries instead of gcc v4.0.1.