#acl All:read == Dealing with background in XSPEC == === When the background requires a different response to the source === Suppose we have a model for the background spectrum which requires a different response to that for the source spectrum. Read in the source and background spectra as separate files : XSPEC12>data 1:1 source.pha 2:2 back.pha The source and background files have their own response matrices : XSPEC12>response 1 source.rsp 2 back.rsp Set up the model for the source. Here we will take the simple case of an absorbed power-law : XSPEC12>model phabs(pow) Input parameter value, delta, min, bot, top, and max values for ... 1 0.001 0 0 100000 1e+06 1:data group 1::phabs:nH> 1 0.01 -3 -2 9 10 2:data group 1::powerlaw:PhoIndex> 1 0.01 0 0 1e+24 1e+24 3:data group 1::powerlaw:norm> Input parameter value, delta, min, bot, top, and max values for ... 1 0.001 0 0 100000 1e+06 4:data group 2::phabs:nH> 1 0.01 -3 -2 9 10 5:data group 2::powerlaw:PhoIndex> 1 0.01 0 0 1e+24 1e+24 6:data group 2::powerlaw:norm>0 0 Note that we have fixed the normalization of the source model for the background dataset at zero so it doesn't contribute. Now we need to set up the background model for both datasets with its own response matrix. XSPEC12>response 2:1 back.rsp 2:2 back.rsp This tells xspec that both these datasets have a second model which must be multiplied by the back.rsp response matrix. We now define the background model to be used. In this case take the simple example of a single power-law XSPEC12>model 2:myback pow Input parameter value, delta, min, bot, top, and max values for ... 1 0.01 -3 -2 9 10 1:myback:data group 1::powerlaw:PhoIndex> 1 0.01 0 0 1e+24 1e+24 2:myback:data group 1::powerlaw:norm> Input parameter value, delta, min, bot, top, and max values for ... 1 0.01 -3 -2 9 10 3:myback:data group 2::powerlaw:PhoIndex> 1 0.01 0 0 1e+24 1e+24 4:myback:data group 2::powerlaw:norm> We have now set up xspec so that the source data is modeled by a source model multiplied by the source response plus a background model multiplied by the background response and the background data is modeled by the background model multiplied by the background response. The background models fitted to the source and background data are constrained to be the same. XSPEC12>show model Current model list: ======================================================================== Model phabs<1>*powerlaw<2> Source No.: 1 Active/On Model Model Component Parameter Unit Value par comp Data group: 1 1 1 phabs nH 10^22 1.0000000 +/- 0.0 2 2 powerlaw PhoIndex 1.0000000 +/- 0.0 3 2 powerlaw norm 1.0000000 +/- 0.0 Data group: 2 4 1 phabs nH 10^22 1.0000000 = 1:phabs[1]:nH 5 2 powerlaw PhoIndex 1.0000000 = 1:powerlaw[2]:PhoIndex 6 2 powerlaw norm 0.0 frozen ________________________________________________________________________ ======================================================================== Model myback:powerlaw<1> Source No.: 2 Active/On Model Model Component Parameter Unit Value par comp Data group: 1 1 1 powerlaw PhoIndex 1.0000000 +/- 0.0 2 1 powerlaw norm 1.0000000 +/- 0.0 Data group: 2 3 1 powerlaw PhoIndex 1.0000000 = 1:myback:powerlaw[1]:PhoIndex 4 1 powerlaw norm 1.0000000 = 1:myback:powerlaw[1]:norm ________________________________________________________________________