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.

Tuesday, September 30, 2008

compbb documentation

Ken Ebisawa pointed out that the v12 description of the compbb model did not include a change made to the v11 help. I've corrected this and updated the on-line page.

Saturday, September 27, 2008

gfortran on the mac

To get gfortran using fink get the package gcc42 or gcc43.

Wednesday, September 24, 2008

plot delchi

Jeremy Sanders points out that the label for delchi plots is wrong or at least misleading. Fixed this by changing the entry in plotLabels.dat. Note that the label is now hardwired for the chi-squared statistic however the delchi plot doesn't make any sense for other statistics.

Jeremy also noted that the y-axis label is a long way to the left and this looks strange. The reason for the position is that with LAB ROT we need to leave space to write numbers of the form
A x 10^(-B). Curiously, we are defaulting to rotated labels for 2-panel plots but unrotated labels for 1-panel plots. I've no idea why. Note that the easy way to move around the position of the y-axis label is
PLT> lab pos y 3.0

Monday, September 22, 2008

log files in xspec

Fixed bug that was adding a "#" to the next line instead of the current line of log file output. This is a partial fix to issue 1024. Input when setting parameter values (in model or newpar) is still not echoed to the log file - problem is in ModelContainer::setParameterFromPrompt.

Update: had to back this change out because it doesn't work with tcerr, which is not buffered and hence passes one character at a time to TclIO::write. Craig worked out how to fix xsLog.cxx to fix the problem.

Changing NOMAD password

Since I now have to change this every 60 days these notes are to help me remember what to change so that my Thunderbird e-mail keeps working.

1. Change NOMAD password on the webmail.nasa.gov site
2. Using Firefox Preferences remove saved password for webmail.nasa.gov
3. Using Thunderbird Preferences remove saved password for smtp://gsfc...
4. Click on NOMAD inbox and when prompted enter new password. Check the Password Manager box.
5. Restart Thunderbird.
6. Send an e-mail and when prompted enter new password. Check the Password Manager box.

Also need to fix CNE wireless connection. Open Internet Connect, go to 802.1X then "staff CNE wireless" in the configuration menu. Enter the new password in the appropriate box.

Wednesday, September 17, 2008

xspec priorities

I've created a Wiki page with a list of xspec priority enhancements. These are divided into large and small projects. At the moment they are not priority-ordered but I will add that along with additional information on the large projects.

xspec issue fixes

Updated documentation to match recent enhancements and additional models. Note that the description of the bvapec model is now included along with the bapec model, not in a separate file.

Fixed a plotting bug. The green line marking 0 or 1 in the res, ratio, chi etc. plots did not go all the way across the plot if a rescale was done so that only part of the x-range of the data was included. Note that a rescale to start at an x-value below the initial data will not draw the green line for the x values below the start of the data.

Friday, September 05, 2008

XMM ao8 webspec files

I've replaced the XMM rmfs and arfs in WebSpec with the appropriate ones for AO8.

Thursday, September 04, 2008

super-exponential cutoff absorption

At the request of Jean Ballet added a super-exponential cutoff absorption model to the additional models page. This is useful for fitting gamma-ray observations of pulsars (eg Nel & de Jager 1995).

Also added model to the development version so it will be included in the next release.

Wednesday, September 03, 2008

energies command and table models

Roderick Johnstone pointed out that recent bug fixes have broken use of the energies command for table models. This is fixed in patch 12.4.0an.

Monday, September 01, 2008

added new models to development version

Added the following contributed additional models to the development version so they become standard in the next release : diskir, cflux, nsmax, zxipcf, swind1, kerrdisk, kerrconv, nthcomp.

Thursday, August 28, 2008

latest xspec patches

12.4.0ak The cutoffpl model can show a distortion for very low energies (E/B approx. less than 10^-3). The incomplete gamma function calculation which this is based on needs to be improved in this region. Our thanks to Joern Wilms, Moritz Boeck, and Manfred Hanke for pointing this out. Report added on Aug 28, 2008.

12.4.0al This adds the Fortran wrapper function xgtcht(console,log) for those wishing to retrieve XSPEC's console and log chatter level settings from inside their own Fortran local models. The function is equivalent to the xgtcht contained in the xanlib library used by XSPEC11. Report added on Aug 28, 2008.

12.4.0am Enhancement patch required for reading data sets and responses in the new format used by GLAST GBM files. The modifications include the removal of the SPEC_NUM column for type-II data files, and the storing of multiple response matrix extensions into one response file. XSPEC will now distinguish among multiple response extensions by appending a curly-bracket specifier to the response file name: myResponse.rsp{n} where n is the EXTVER keyword value of the extension. Report added on Aug 28, 2008.

Friday, August 22, 2008

parallelizing xspec

Craig has been experimenting with openMP which is included in gcc v4.2 and above. Since openMP uses a shared memory model the trick is to find places where multiple threads can be used which do not trash each others' memory. A valid case is the loop over responses in Model::fold. This speeds up the code if there are multiple datasets in the same datagroup. It involves changes to Model.cxx as well as MultiResponse.cxx and RealResponse.cxx.

Test was with a dual-processor machine running Solaris. Note that the -xopenmp compiler flag required either no optimization or -O3.

Thursday, August 21, 2008

calculating fluxes and errors

Prompted by a question from Jeremy Sanders I have developed a new way of calculating fluxes and errors for models and parts of models. The trick is to provide a new convolution model called cflux whose first two parameters are the minimum and maximum energy over which the flux is calculated. The final parameter is the flux. The component is placed in front of the model component(s) whose flux is being calculated and one of the additive components has its normalization frozen. The standard fit and error command on the flux parameter will then provide the best fit flux and confidence region. This model is available through the extra models web page.

Thursday, August 07, 2008

xselect and XMM-Newton spectra

The current version of xselect/extractor writes spectra with region extensions having the EXTNAME keyword set to REGION. This is required by CIAO. However, SAS requires EXTNAME to be REG00101 so added a command to xsl_xmm_epic_makeresp to change EXTNAME before calling the response and arf generation tools.

Tuesday, August 05, 2008

genrsp and LO_THRES

Allyn Tennant pointed out that genrsp writes a keyword LO_THRESH which should actually be LO_THRES. I fixed this as v2.04 by adding the new keyword while leaving the old just in case there is other s/w that expects it.

Friday, July 18, 2008

LISA xspec stuff current status

strain2xspectime.pl creates input file correctly for time series data and this is fit using the mbht model. However, residuals show high frequency correlations presumably because noise is being
applied in frequency space in synthlisa. The strain2xspec.pl and mbh model which work in frequency space are not working correctly - the model doesn't match the data when it should. All current changes are checked into the repository.

I'm not clear how and why the postBuffer is used - need to check this with Sean or Ira.

Larger question is how should the noise be generated ? Is it correct to do this in the frequency domain ? A better detector model may be required.

Monday, July 14, 2008

xspec patches

Some recent patches from the bugs page :

12.4.0ae When using the gsmooth or swind1 models, certain combinations of parameters can cause an invalid array access. On 64-bit Linux systems this will cause a crash. Our thanks to Curtis McCully for pointing this out. Report added on Jul 08, 2008.

12.4.0af When settings have changed through either the xsect or cosmo commands, the model calculations should be immediately updated. (This patch also improves the cosmo command-line parser.) Our thanks to Stefano Bianchi for pointing this out. Report added on Jul 08, 2008.

12.4.0ag The kerrd and nsa additive models will cause XSPEC to crash in certain cases, the latter primarily on Intel/Mac platforms. Report added on Jul 14, 2008.

Wednesday, July 09, 2008

bug in genrsp

Allyn Tennant spotted a bug in genrsp when making a response for a grating. I'd missed a case when the channel boundaries are in decreasing energy order and the result was the center bin of the gaussian response was chopped out. This is fixed in v2.03.

Friday, July 04, 2008

extractor and filenames with "+"

Kim Page at Leicester reported that the HEAsoft 6.5 version of extractor dies when using a time filter if the filename contains a "+". It was interpreting this as an HDU number. Fixed this and checked in a change which will be included in extractor v5.0.

Wednesday, July 02, 2008

xspec model library

At the request mainly of the ISIS folks I've managed to make a stripped-down HEAsoft 6.5 distribution which only includes the Xspec model library files to build only libXSFunctions, libXSUtil and libXS. I assume that the user has a cfitsio library already. Some minor hacks of the top level and Xspec configure files were necessary to make sure that hmake didn't try to build any heacore libraries. Also, moved some include files into Xspec/src/include from directories that otherwise aren't needed.

Monday, June 23, 2008

documentation errors for table files

Mike Corcoran spotted a couple of minor problems. The ogip_92_009 memo refers to the incorrect location for the wftbmd.f and .c files. It should be $HEADAS/../ftools/spectral/tables/. Also the onepar and twopar Makefile don't work because they need to refer to the correct version numbers of xanlib and cfitsio - I fixed this by switching to standard HEADAS Makefiles so running hmake will automatically pick up current versions of libraries. These changes are checked in but won't make the imminent HEAsoft 6.5 release.

Friday, June 13, 2008

tclout goodness

goodness was listed as an option for the tclout command but we had forgotten to actually implement it. This is fixed as patch 12.4.0ab after Phil Evans pointed out the discrepancy.

Thursday, June 05, 2008

Bug fix in xselect for suzaku

When I added the support for 5x5 to 3x3 conversion I missed the case of the user already having done an extract events. If this has happened then the event file to be used has a different name. Checked in a fix to this and was a bit cleverer about jumping out of the 5x5to3x3 routine if we don't need to run it.

Friday, May 09, 2008

modification to lrt.tcl

The likelihood-ratio test script doesn't work when there are multiple datagroups. The reason is that switching between models by making them active/inactive loses information on the parameters for groups > 1 when the model becomes inactive. We perhaps should modify the model inactive command to track multiple datagroups however as a workaround I modified lrt.tcl to use command files to store the model definitions. Each time the model is switched the appropriate command file is read.

Monday, May 05, 2008

started work on extractor v5

Started work on the new version of extractor which will use cfitsio internal filtering as much as possible.

In the course of switching the region filtering to cfitsio I found an obscure bug. If the image and wmap coordinates are the same but have different binning and wtmapfix is set then the WMAP bins with -1 are not quite correct. Several bins at the edge of the selected region can have counts in them when the value should be -1.

Saturday, May 03, 2008

xselect and ROSAT

Dave Pooley reports that xselect has problems under Mac OS 10.4 but not 10.3 when using ROSAT data. I confirmed the error under 10.4. The error message is something like

Could not find keyword for Instrument for ROSAT
NONE
Got new mission: ?4????AF?'?AF?AF?AF??
'7????P???? R??????D???51

I don't know why this occurs but the fix is to edit xselect.mdb to use the new wildcard facility to deal with the PSPCB and PSPCC instrument variant names instead of using the instkey specification to only read the first four characters of the INSTRUME keyword.

Wednesday, April 30, 2008

xspec patches

A few new patches have been added recently. 12.4.0x fixes a number of problems that showed up when using the new g++-4.3.0 compiler and when using gcc on Solaris platforms. This patch level is released as part of HEAsoft 6.4.1. 12.4.0y improves the handling of cases when the L-M algorithm pegs a parameter due to a zero or negative pivot value in the Hessian. 12.4.0z keeps the fit valid when the fit method is changed. This allows the improve command to be run after an L-M fit. 12.4.0aa is a fix to allow filenames prompted for by the fakeit command to being with a / ie to be absolute paths. Patches available from the usual place.

Thursday, April 24, 2008

xselect: Chandra response generation

Overhauled the response generation option on "save spec" for Chandra ACIS data. I added an extended? parameter to specify whether the source is a point source or not. For a point source the arf is created using mkarf, and for an extended source mkwarf is used. The rmf is generated using mkrmf or mkacisrmf depending on whether CTI correction has been performed. The script checks keywords in the spectrum to determine which is appropriate. Note that to find some of the auxiliary files required xselect should be being run in either main directory for the dataset or in a directory one level down (eg secondary).

Note that I also modified the FITS region extension written by extractor so that the EXTNAME is REGION and EXTVER is used to track multiple extensions. This is a change from an EXTNAME of REG001## and is made to conform with the CXC standard defined by McDowell & Rots. There may be an issue here is XMM-Newton SAS routines are expecting the REG001## names.

Tuesday, April 22, 2008

Science 2.0

SciAm has a brief survey of Web 2.0 applications in science. In particular, it argues that putting scientists working notes on-line will foster greater communication and collaboration.

Monday, April 14, 2008

reading old RMFs

Tahir points out that the BeppoSAX RMFs don't work in rbnrmf. The problem is that these files have only RMFVERSN='1992a' and do not have the HDUVERS keyword that the software now requires. The workaround is to add HDUVERS='1.0.0' to the MATRIX extension. I've updated the relevant subroutines to check for RMFVERSN if HDUVERS is not found.

Tuesday, April 08, 2008

setplot wave units in xspec

Changed the plotting units for the setplot wave option. Now showing f_nu and variants instead of f_lambda. The model and ufspec y-axis is photons/cm^2/s/Hz; emodel and eufspec are in Jansky (1e-23 erg/cm^2/s/Hz); eemodel and eeufspec in keV Jy. The latter is a bizarre mixed unit but it isn't clear to me what to use here. It might be an idea to have an option for the user to switch between f_lambda and f_nu.

Updated: decided that for the eemodel/eeufspec plots the units should be erg/cm^2/s corresponding to standard nu F_nu plots.

Independently, I fixed an error in setting the y-axis range for eufspec and eeufspec under setplot wave.

Wednesday, April 02, 2008

genrsp v2.02

Added an option for the resolution varying linearly with either the energy or the wavelength.

Friday, March 28, 2008

xspec updates

A number of updates and bug fixes, mainly minor.

12.4.0p This is the fix for suzpsf alluded to earlier.

12.4.0q CHANTYPE was not being set correctly after fakeit none leading to confusing warning messages.

12.4.0r A generalization of fakeit to work correctly with multiple models as requested by K.D. Kuntz.

12.4.0s A couple of patches for plot eff bizarreness that I ran across.

12.4.0t Fix for a seg fault in data when the user gives the filename as empty double quotes.

12.4.0u A fix for unusual compiler configurations.

12.4.0v Allow the unnamed model to be turned on and off.

12.4.0w Correction for a bug when using non-standard weighting and toggling between chi and cstat statistics.

Patches are available from the usual place.

Monday, March 24, 2008

likelihood-ratio test

Added a new Tcl script, lrt.tcl, to calibrate the likelihood ratio test. Currently only works with one data set. The user defines two models (by default model0 and model1) then the script generates a user-specified number of simulated data sets based on model0 and for each one evaluates the log(likelihood ratio) between model1 and model0. The script returns the fraction of simulations with a smaller log(LR) than the data.

I will then use lrt.tcl as the basis for a script to calculate F-test probabilities for
adding an additional model component.

Friday, March 14, 2008

fakeit with multiple sources

We now have the patch out for fakeit to simulate data from the case where there are multiple sources (with their own responses). This is xspec v12.4.0r and is available from the usual place.

Thursday, March 13, 2008

suzaku xis response generation

Enabled the automated response generation in xselect for Suzaku XIS spectra. I'm still waiting for a decision from the XIS team on what default energy and channel binning to use in the response matrix. Ishisaki-san has suggested that the correct estepfile option for xissimarfgen is "medium" so the response generation uses this.

Currently using a "medium" binning scheme which produces 2048 channels. Spectra extracted from xselect are binned using this scheme whether or not the automated response generation is used.

Note that I also modified the MDB code to allow trailing wild cards eg XIS* will match to any of XIS0, XIS1, XIS2, or XIS3.

Also, updated addascaspec so it runs correctly if there is no ARF used.

suzaku xis 5x5 and 3x3 files

Checked in a change to xselect so that when there is a mix of 5x5 and 3x3 suzaku xis files read in then, when doing an extract, xis5x5to3x3 is used to create a temporary 3x3 file. This was requested by the xis team and ensures that doing an extract event creates a correct output 3x3 file. At the moment we aren't doing anything with the extra information in the 5x5 file.

Tuesday, March 11, 2008

local models in xspec v11 on the Mac OS X

Bryan points out that the documentation for local models in v11 doesn't include the special instructions required for the Mac OS X ie because we can't make a shared library the xspec11 executable must be rebuilt with the new local model library. I've added this to the relevant manual page although hopefully most people are using v12 now anyway.

Friday, March 07, 2008

grade strings in xselect/extractor

The specifications rules for grade strings in the xselect "filter grade" command do seem lead to a little confusion so made them a but more lenient. Now allow spaces in between individual elements. eg "0:0 2:4 6:6" is now allowed as well as "0:0,2:4,6:6". This change is in extractor v4.83.

twittering

There is now an xspector twitter. I'm not sure whether I will keep this up or where it will go - it's an experiment.

suzpsf model in xspec

As noted yesterday the current version of suzpsf assumes the WMAP is in sky coordinates, which is no longer true. I've now fixed this. There are two changes required. Firstly, extractor has been modified (v4.83) to write the REF* keywords which XMM files use to record the original sky WCS keywords. Secondly, the suzpsf model has been modified to use these keywords (as the xmmpsf model already did).

To fix spectra that were created using older versions of extractor add the following keywords to the primary header with the values of the corresponding keywords from the EVENTS extension of the input event file.
REFXCRVL <- TRCVL10 from events files
REFXCRPX <- TCRPX10 from events files
REFXCDLT <- TCDLT10 from events files
REFYCRVL <- TRCVL11 from events files
REFYCRPX <- TCRPX11 from events files
REFYCDLT <- TCDLT11 from events files

Thursday, March 06, 2008

more minor xspec patches

12.4.0m The start-up statistic, method, and weight settings in the user's Xspec.init file are effectively ignored. Instead these always start with Xspec's hardcoded default settings (chisq, leven, and standard respectively). Our thanks to Maurice Leutenegger for pointing this out. Report added on Mar 05, 2008.

12.4.0n If the precise best-fit values are input as starting parameter values to a Levenberg-Marquardt fit, for certain data sets and models the fit may run through a large number of redundant loop iterations and produce "SVDCMP" warning messages. Our thanks to Jeremy Sanders for pointing this out. Report added on Mar 06, 2008.

12.4.0o For xmmpsf and suzpsf mixing components, Xspec is unable to parse RA and DEC strings with colon delimiters (entered with the xset command). Report added on Mar 06, 2008.

Note also the there is a problem with suzpsf for all options except that of assuming the surface brightness distribution is centered on the middle of the WMAP. This issue arises because the model was written when the Suzaku XIS spectra used sky coordinates in their WMAP. Since late 2006 we have used detector coordinates but due to an oversight the suzpsf model was not updated.

Tuesday, March 04, 2008

minor patch for error and named models.

Once the error command is run for a parameter belonging to a named model, it does not allow the user to specify unnamed-model parameters during future error runs. Our thanks to Kip Kuntz for pointing this out. Bug fix 12.4.0l.

Sunday, March 02, 2008

background in xspec

I've started a wiki page on how to deal with background in xspec. At the moment it gives an example on how to deal with the case when the background requires a different response matrix to the source.

Monday, February 25, 2008

photos from COSPAR workshop in Alexandria

A selection of my photos from the COSPAR Capacity Building Workshop on X-ray Astronomy held at the New Library of Alexandria are now up on Flickr.

A couple of fakeit notes

Kip has pointed out that fakeit doesn't handle multiple sources correctly. If you set up with two sources with their own responses modelling a dataset then do a fakeit only the first source and response contribute to the simulated spectrum. This will take a bit of work to fix.

Jennifer Donley at Arizona e-mailed to worry about the warning message about incompatible CHANTYPE after simulating Chandra ACIS spectra for CY10. This is a minor bug in xspec which fails to pick up the CHANTYPE value from the response matrix when doing a "fakeit none".

Friday, February 22, 2008

xspec bug fixes 12.4.0d - k

While I was away on my travels, Craig put up xspec bug fixes 12.4.0d - k.

seg fault in rgsrmfsmooth and NUMGRP in rbnrmf

Fabio Pizzolato reported a seg fault using rgsrmfsmooth in the case when the spectrum had been binned up by a factor of 4. The fix was to increase the space allocated for response groups in the output response.

In the course of diagnosing this I realized that rbnrmf was not setting the NUMGRP keyword in output response matrices correctly - it was the number of response groups from the input file that was being written. This shouldn't have made any practical difference but was confusing.

Wednesday, February 20, 2008

xspec11 mdefine seg fault

Chris Mountford at Leicester reports and provides the fix for a v11 seg fault in mdefine when running on an x86_64 using gfortran.

Monday, February 18, 2008

extractor and filenames containing '+'

Alex Padgett points out that extractor doesn't handle filenames containing a '+' because it assumes that everything following the '+' is an extension number. Fixed this by checking whether the '+' comes before a '.' (v4.82).

Monday, January 28, 2008

started an XSPECwiki page on low count spectra

I've started an XSPECwiki page on fitting low count spectra.

https://astrophysics.gsfc.nasa.gov/XSPECwiki/low_count_spectra

Monday, January 14, 2008

xselect failing to find event files

xselect gives a really misleading message when the event file cannot be found :
The input file is neither a FITS file nor an ASCII file
containing a list of FITS files
I've improved this to make it clear that the file is not being found.

Thursday, January 03, 2008

xspec fix for DOS-mode scripts

12.4.0c DOS-mode scripts (with their extra carriage-return characters) are not properly handled for multi-line commands. Our thanks to Laura Brenneman for pointing this out. This also fixes another scripting bug in which a line with 'n' followed by blank spaces is wrongly interpreted as 'newpar' rather than 'no'. Report added on Dec 27, 2007.

This patch modifies headas/Xspec/src/XSUser/UserInterface/ execscript.cxx, XSUtil/Parse/ XSparse.cxx

Saturday, December 29, 2007

Webspec for Chandra Cycle 10

Updated Webspec with the Chandra cycle 10 responses.

Wednesday, December 19, 2007

Suzaku XIS response generator

Checked in xsl_suzaku_xis_makeresp, an automated script to build the XIS rmf and arf by calling xisrmfgen and xissimarfgen. Three speed options (fast, medium, slow) use different channel and energy binning schemes as well as different accuracies in the xissimarfgen run. The accuracies probably need a little more tweaking.

The point source option assumes that the source is in the center of the WMAP. Other possibilities here are to use ftstat on the WMAP to get the pixel with the highest value or the centroid of the map. It's not clear which is the best thing to do.

I would like to be able to use the algorithm found by Randall and implemented in xissmooth. This requires turning xissmooth into a general purpose ftool.

first xspec v12.4 patches

A couple of minor patches are now up

12.4.0a This fixes some cases where invalid input leads to segmentation faults: The model command crashes for certain forms of invalid model syntax. The tclout command crashes for some of its options when the invalid spectrum number 0 is specified while there are data sets loaded. Our thanks to Jeremy Sanders for pointing this out. Report added on Dec 10, 2007.

This patch modifies headas/Xspec/src/XSUser/Handler/HandlerUtils.cxx, XSUtil/Parse/Expression.cxx, and XSPlot/Plot/Plot.cxx

12.4.0b For the model command, entering the abbreviated name bkn should select the bknpower component and not the bkn2pow component. Our thanks to Davide Donato for pointing this out. Report added on Dec 18, 2007.

This patch modifies headas/Xspec/src/manager/model.dat

Wednesday, December 12, 2007

MJDREF precision and time filter file in extractor

Craig Markwardt spotted that when extractor writes out MJDREF it is only in single precision while it can be read in at double precision. Modified this to preserve precision as v4.80.

Craig also noted that the time filter file can be specified as just the filename or the filename with a numerical HDU specifier but not with a named HDU eg filename[STDGTI]). This is now fixed in v4.81.

Monday, December 10, 2007

XSPEC wiki and some notes for Suzaku

I've added notes for the Suzaku meeting in San Diego to the new XSPEC wiki.

Friday, December 07, 2007

Friday, November 30, 2007

running xspec as a shell

John Baker just came up with a way of running xspec which hadn't occurred to me. Create a file of xspec commands with the first line as

#!/path-to-executable/xspec

This has the advantage that arguments can be used eg

cat > testscript.xcm
#!/path-to-executable/xspec
data $argv
^D

chmod +x testscript.xcm

testscript.xcm file.pha

Thursday, November 29, 2007

model.dat entry for refsch in xspec v12

The refsch model.dat entry has a unit on one parameter of "erg cm/s". This is not interpreted correctly by xspec v12 with the result that the default input parameter values end up strange. The fix is to change the unit definition to ergcm/s.

Monday, November 26, 2007

bad error in gabs model

Takao Kitaguchi and colleagues at the University of Tokyo point out that the gabs, gaussian absorption, model gives a result dependent on the energy bin size. This has been fixed in v11.3.2aj and v12.4.0.

Wednesday, November 14, 2007

rescalecov.tcl

Wrote a handy XSPEC Tcl procedure to multiply the covariance matrix used in an MCMC chain proposal distribution by a factor. Use after defining a proposal distribution by eg
 XSPEC12>chain proposal cauchy fit
XSPEC12>source rescalecov.tcl
XSPEC12>rescalecov 0.5
which divides all elements in the covariance matrix by 2.

rgsrmfsmooth

Created a new ftool to correct the XMM RGS response for an extended source. This uses Andy Rasmussen's code included in the xspec v11 model rgsxsrc. Since that model has no free parameters it seems easier just to modify the response matrix before reading it into xspec and that is what this new tool does. This replaces the need to add rgsxsrc to xspec v12.

Preprints

Flegal et al. discuss error estimation methods for MCMC computations.

Clifford Will notes that if there are stars in highly eccentric short period orbits (<~0.1 year) around Sgr A* they could be used to test the no-hair theorem. Cen & Fang show that GRBs may be biased tracers of star formation.

Eckert et al. use Integral IBIS imaging of the Coma cluster to find a hard X-ray source extending in the direction of the sub-cluster and co-incident with 1.4 GHz emission.

Ajith et al. construct a template bank for the GW signal from coalescing non-spinning BHs.

Ishak et al. show that gravitational lensing has a dependence on the cosmological constant and that current observations place an upper limit which is competitive with values determined from cosmology.

Davison & Sartori present their approach to the "Banff Challenge" of finding a signal in noisy particle physics data.

Dimopoulos et al. propose GW detection using atom interferometry which has the potential to be more sensitive than LIGO from the ground and LISA from space.

Tuesday, November 13, 2007

xspec plot contour

The contour information being passed from xspec to PLT was not at a high enough precision leading to problems when there are many (>10000) data channels and hence a large value of chi-squared. Fixed this for the 12.4 release.

Thursday, November 08, 2007

fluxerror and linked parameters

Robert Dunn pointed out that fluxerror.tcl doesn't work correctly if there are linked parameters. I made a simple fix to correct that. It does require the xspec 12.3.1an patch.

Friday, November 02, 2007

Preprints

Jasra et al. present a population-based Reversible Jump MCMC method and argue that it works better than other MCMC methods on high dimension problems.

Hardcastle et al. report on an accumulated 700ksec observation of the Cen A jet which shows that the outer part of the jet requires an as yet unknown distributed acceleration mechanism.

Gierlinski et al. argue that the high frequency end of the power density spectrum in the hard states of BH sources is invariant in shape and the amplitude provides an estimate of the mass.

Snowden et al. present a catolog of 70 XMM cluster observations with a detailed description of their handling of background.

Lang & Hughes investigate the ability of GW observations to localize a SMBH-SMBH merger.

Narayan et al. fit Novikov-Thorne thin disk models to X-ray transients in the thermal state and estimate black hole rotation rates.

Mahdavi et al. compare weak lensing and X-ray measures of mass and find evidence for non-thermal pressure support.

Bianchi et al. use XMM and optical observations of NGC3147 to show that it has no intrinsic X-ray absorption but also no optical broad lines.

Thursday, November 01, 2007

XSPEC bug fixes for tclout plink and fakeit

A couple of recent minor bug fixes...

12.3.1an For the tclout plink option, it is more useful to output the link string in a format which can be used as input for other parameter commands, such as newpar. Our thanks to Jeremy Sanders for pointing this out. Report added on Oct 15, 2007.

The fix is to replace headas/Xspec/src/XSUser/Handler/xsTclout.cxx, and rebuild xspec.

12.3.1ao When a fakeit run is using a response with first legal channel number (TLMIN4) = 0, and is NOT based on an already existing spectrum, the last channel is erroneously ignored and always ends up with 0 counts. Our thanks to David Morris for pointing this out. Report added on Oct 31, 2007.

The fix is to replace headas/Xspec/src/XSModel/Data/SpectralData.cxx, and rebuild xspec.

Monday, October 22, 2007

rbnrmf bug in energy binning

I made an error in the new energy binning option - I should be averaging the response rather than summing it so the resulting responses were too large by the binning factor. Also, there was a one-off problem for responses with zero-based channels. Checked in fixes.

Friday, October 19, 2007

Preprints

Franz discusses confidence regions on ratios.

Hague et al. discuss statistical tests for deviations from the power-law for the cosmic ray energy spectrum.

Lang & Hughes investigate the ability to localize SMBH mergers from the GW signal.

Comastri & Brusa review AGN results from X-ray surveys and their multiwavelength follow-up and consider that case for 2-3 Msec XMM survey.

Rapetti & Allen consider what it would take to use X-ray observations of cluster of galaxies to determine dark energy parameters with a precision comparable to other methods.

Brunetti et al estimate hard X-ray fluxes from clusters of galaxies and relate them to prospective observations with SIMBOL-X.

Thursday, October 18, 2007

webspec

Spent some time working on webspec. Main changes are to the look : the front page is more compact so I don't have to scroll down to hit the button; the advanced page allows up to 9 components; the basic and advanced pages both read the list of missions from the same file so they won't fall out of step as in the past; the page to set exposure and parameters has been tidied up a bit; the results page now has the plot next to the set of options to change plotting parameters.

I would like to have the replot option simply change the plot on the current results page rather than opening a new page however this would involve substantial programming changes. Another nice option would be the ability to make contour plots (by running steppar) however this is a potentially huge cpu hog and I'm not sure we want to do this on the main web servers. Perhaps this would be better as part of heraspec.

UPDATE: Fixed a problem that appeared under Safari - the check box for background was not coming up checked by default because I put checked inside double quotes in the html input tag.


Monday, October 15, 2007

OpenMP

gcc 4.2 and later now includes support for the OpenMP shared-memory parallelization API. This would be a good way of adding support to xspec for multi-core machines. This can be used in C/C++ or Fortran and provides a simple way of parallelizing loops.

Wednesday, September 26, 2007

xselect and directory paths with spaces

Eric Miller points out that xselect runs into problems on the Mac if the directory path has a space in it even if a soft link is used to produce a path without a space. This occurs because xselect calls getcwd to return the current working directory and getcwd resolves any links to give the absolute path. This then runs into the customary problems with directory paths containing spaces.

The best workaround seems to be to change xsel_utils.f and replace

call XPICWD(wrkdir)

with

wrkdir = "./"
call XSL_EXPAND_DIR(wrkdir,status)

since the xsl_expand_dir routine in xsel_unix_c.c spawns a shell and runs pwd to get the current directory path. This method does preserve links.

Note that having an explicit directory path with a space (ie no links) fails in all sorts of ways and will be very hard to work around.

Thursday, September 20, 2007

Linking parameters in xspec

There is a subtle issue when linking parameters in xspec. If you do something like

XSPEC12> newpar 5 = 12

then the hard limits used for parameter 12 are those of parameter 5. This is not usually a problem however if parameter 12 is part of a table model and its tabulated parameters cover a smaller range than parameter 5 it is possible for the fit to reach a point outside the available tabulated data. This will generate a warning message in v11 and an error message in v12.

The best workaround is to always make sure that table model parameters are linked to rather than from so that the hard limits in use will be those from the table model.

Thursday, September 06, 2007

bad channels in the Suzaku XIS

Koji just spotted that xselect sets the channels 1-81 bad for the Suzaku XIS and this ought to be 0-81. Checked in a fix to xselect.mdb.

Thursday, August 30, 2007

Removing values of names set using xset

Jeremy Sanders enquires how to return to the default after having used xset to change APECROOT. Doing
XSPEC12> xset APECROOT
actually works although this is undocumented and is misleading because doing an xset then shows APECROOT still existing but with no value. Fixed so that the name no longer shows up as existing.

Tuesday, August 28, 2007

Abundances in NEI models

Frank Haberl pointed out that the documentation on the NEI models is wrong. The documentation states that abundances are wrt Anders & Grevesse while in fact they are relative to whatever is set by the abund command. This was a change in code from June 2005 which was never documented. Updated all the relevant files (11.3.2ai).

Thursday, August 23, 2007

PGPLOT PS driver

Phil Evans reports occasionally losing a few pixels from text labels due to the bounding box being set too small. Made a simple fix in grtext.f to add 2% in each direction.

rdblur model

The hard lower limit on the Rin parameter for rdblur should be 6, not 0 as currently set. If Rin < 6 then the model returns zero.

Monday, August 20, 2007

xspec updates

Bug fixes/updates from Craig. These are all listed on the bugs page.

12.3.1ak This fixes dummyrsp so it can be applied to any model for a given spectrum, and can now take advantage of XSPEC's recently added multiple sources capability in the same way as the response command. Previously dummyrsp only worked properly for the standard single source cases. This also fixes a Solaris specific bug, which could cause NaN calculation errors when folding a model with a dummy response. Report added on Aug 20, 2007.

The fix is to replace headas/Xspec/src/XSModel/Data/ SpectralData.cxx, src/XSModel/Data/Detector/ UserDummyResponse.cxx, src/XSModel/GlobalContainer/ DataContainer.cxx, src/XSUser/Handler/ xsDummyrsp.cxx, xsResponse.cxx, and rebuild xspec.

12.3.1al Using delcomp to remove a table model component causes a segmentation fault. If editmod is used on a model with a table component, and the component is written with an abbreviated form of "atable", "mtable", etc., editmod erroneously considers it a modified component. Report added on Aug 20, 2007.

The fix is to replace headas/Xspec/src/XSModel/Model/ Model.cxx, src/XSModel/Model/Component/ Component.cxx, and rebuild xspec.

12.3.1am A couple of output formatting improvements: lumin output should be in standard "d.ddde+EE" format and not written as "d.ddd x 10^EE". The margin command output should switch from fixed to scientific format for a wider range of exponent values. Our thanks to Jeremy Sanders for pointing this out. Report added on Aug 20, 2007.

The fix is to replace headas/Xspec/src/XSFit/MCMC/ MarginGrid.cxx, src/XSModel/Model/ Model.cxx, and rebuild xspec.

Thursday, August 16, 2007

building lisatools

Building lisatools using the instructions provided by Michele. A few things to note :

1. The correct svn command is
svn co https://lisatools.svn.sourceforge.net/svnroot/lisatools lisatools

2. The build of synthLISA fails with a C++ error. This is because python2.5 requires the
SWIGged files to have been created by swig 1.3.31, not the swig 1.3.29 in lisatools. Grabbed
the new gzipped swig from sourceforge and replaced in lisatools/Packages. Then edited
master-install.py to use 1.3.31 instead of 1.3.29.

3. This still fails because the SWIGged files are not created in the standard build. Deleted
lisasim/{lisasim-swig_wrap.cpp, lisasim.py} then built synthLISA using the setup.py in
synthLISA-1.3.3. Note that if I rerun the master-install.py it reextracts the contents of the
tarfile and puts back the two files I just deleted.

Monday, August 13, 2007

xspec lumin command

Jeremy Sanders points out that the lumin command doesn't write the number in standard computer notation (x.xxxxxe+yy) unlike every other output number in xspec. So, modified Model.cxx appropriately.

xselect array sizes

Kenji ran into a problem with xselect trying to use a large number of MKFs. Since the cost in memory is low I increased most of the sizes in the xsel.inc file.

Saturday, July 28, 2007

Ubuntu network problem

I ran into a problem with avahi that appears to be relatively common. My version is that the wireless networking fails and Network Tools shows a network device called eth1:avahi which shows a few transmitted and received bytes (with errors) but no interface information. This device appears to have preempted the correct eth1 device. I killed this rogue device using
sudo avahi-autopid --kill eth1
then after a while wireless works again as the eth1 device shows a connection.

At the suggestion of omingo I have done a
sudo apt-get --purge install avahi-autoipd --reinstall
to make sure the latest version of avahi-autopid is in use.

Update: this doesn't seem to have helped. Another possible workaround seems to be to go to Wireless Connections Properties using the Network Settings tool and switch from DHCP to Zeroconf, click on OK, wait for the tool to finish resetting the connection, then go back into Properties and switch back to DHCP.

Update: this may actually be a problem with network-manager. I've made the fix to NetworkManager.conf for bug 40125. Did a suspend then restart and the wireless connection came up correctly which it has not done before.

Thursday, July 26, 2007

HEAsoft built under Ubuntu

Successfully built the HEAsoft distribution on my new Dell with Ubuntu Feisty Fawn. I had to get a number of packages...

sudo apt-get install gfortran g++
sudo apt-get install libncurses5-dev
sudo apt-get install x-dev libx11-dev libxt-dev

Just to be on the safe side (and under bash) I did a

F77=gfortran
export F77
CC=gcc
export CC
CXX=g++
export CXX

Then the configure and build is

./configure > config.out 2>&1 &amp;
make > build.log 2>&1 &
make install > install.log 2>&1 &

Wednesday, July 25, 2007

Cisco VPN client and Ubuntu Feisty Fawn

Working on setting up my new Dell laptop which came preinstalled with Ubuntu Feisty Fawn. A little work needed with the Cisco VPN client - the version downloaded from Goddard CNE needs patching for recent versions of Linux. Fortunately, there are really helpful instructions on using the VPN client available. Tricks I had to do were
sudo chmod 4111 /opt/cisco-vpnclient/bin/cvpnd
/etc/init.d/vpnclient_init restart

to get round the error messages
privsep: unable to drop privileges: group set failed.
The application was unable to communicate with the VPN sub-system.

then I got
Initializing the VPN connection.
Initiating TCP to 198.119.56.78, port 10005
Secure VPN Connection terminated locally by the Client
Reason: Failed to establish a VPN connection.
There are no new notification messages at this time.

This occurs if both the wireless and ethernet connections are enabled at the same time. I turned off the ethernet connection by going to Network Settings selecting Wired Connection then clicking on Properties followed by checking the Enable Roaming Mode box.

Friday, July 20, 2007

update of fluxerror.tcl for multiple datasets

Shao Li noted that fluxerror.tcl doesn't work if multiple datasets have been read in. An immediate workaround is just to change "tcloutr flux" to "tcloutr flux 1" in the script. I have checked in a new version of the script which returns an error range for each dataset - note that the flux ranges will only actually be different if the datasets are members of different datagroups.

Thursday, July 19, 2007

xspec v12 gain fit parameters

Craig has fixed the gain fit parameters so they can be individually frozen during a fit (other than just having both parameters fixed or free). This makes the behavior similar to that available in v11. v12.3.1ae.

swind1 model update

Chris Done supplied modified model.dat information for her swind1 model which is currently available through the new models website. The only change is to the allowed range in the column parameter.

Wednesday, July 18, 2007

Unable to save file in xspec v11

Glenn Morris reported that when xspec v11 is built using gcc4 then the save command will not allow an existing filename to be overwritten. This turned out to be because in this case the Fortran OPEN command returns an IOSTAT=1, not IOSTAT=128 as per gcc3. This breaks the code in OPENWR in sys.lnx and sys.darwin. Fixed in v11.3.2ah by using an INQUIRE in these two files to check for a pre-existing file.

Note that the sys.* options are labelled by operating system however all those running gcc should be the same (eg sys.lnx and sys.darwin).

Friday, July 13, 2007

invalid filter expressions in extractor

Extractor was silently ignoring invalid filters attached to filenames eg infile.fits[pi>100]. Now it at least generates an error message. Note that the only allowed filters are of form name=#:#. v4.79

xspec v11 bug in HEAsoft 6.3

One of my minor mods to xspec v11 to support the use of the gfortran compiler introduced a bug in the addcomp command - inserting a component into the model caused the name of the final component to be changed to CPCMOD. Thanks to a report from Lisa Winter we caught this within a week of the HEAsoft 6.3 release and have updated the tar files.