Thursday, November 30, 2006

Simultaneous fitting of source and background

Caroline Kilbourne points out that the new multiple source capability of xspec provides a clearer way of simultaneously fitting the source and the background. Suppose we have a spectrum source.pi which includes our source and some background and another spectrum back.pi which just contains background. These files have responses source.rsp and back.rsp, respectively. We now read these in by

XSPEC12> data 1:1 source.pi 2:2 back.pi
XSPEC12> resp source.rsp back.rsp
XSPEC12> resp 2:1 source.rsp

Now we set up the model for the background as the default model

XSPEC12> model ....

and the model for source as the second model

XSPEC12> model 2:source ....

The default model now has linked parameters across the two datasets while the second model just contributes to the model for source.pi.

Randall Smith suggests it would be nice to be able to fit models to the background which is read in as a background file eg something like

XSPEC12> data source.pi
XSPEC12> back back.pi
XSPEC12> resp source.rsp
XSPEC12> model ....
XSPEC12> model back ....

Note that this would also require us to be able to associate a background response matrix with the background spectrum eg

XSPEC12> resp back back.rsp

Keywords: HEAsoft, xspec

No comments: