SAS watchout

Why do I get problems ingesting RGS (pipeline) spectra into XSPEC V12.x and how can I solve this?

XSPEC V12.x is more strict with respect to some OGIP standard keywords than former Xspec versions. Particularly, it rejects data with no keyword BACKSCAL (it was clearly specified as mandatory in the old OGIP PHA Data Extension Header in the past but it has been removed at some point from the documentation). All RGS net spectra FITS files (ie. after background subtraction) produced with SAS versions older than SAS 11.0.0 lacked this keyword, while in the case of total or background spectra they contained the vector BACKSCAL as a column, and this is part of the standard.
Our official pipeline (PPS) produces net spectra, and therefore you will get always an error with XSPEC 12.x whenever you try to read data processed before February 2012, in the form:

XSPEC12>data SPEC.FIT

***XSPEC Error: data file missing required entries: Keyword BACKSCAL is missing or of improper type in file: SPEC.FIT


How to solve this? There are several alternatives:

  • use a former version of XSPEC (ie. XSPEC 11.*), or
  • use RGS total and background spectra, deriving them with SAS, or
  • add the keyword BACKSCAL to the FITS file you want to ingest using eg. fparkey (fparkey 1.0 '.FIT[1]' BACKSCAL add=yes)

We have added the keyword BACKSCAL with rgsspectrum to net spectra with SAS 11.0.0. And therefore the problem dissapeared with PPS versions based on this or later versions.