Manually Applying Quality Flags
Once a spectrum has been extracted, it often may need to be adjusted or enhanced by later post-processing steps. This thread describes how to apply NICER QUALITY flags to an existing spectrum, so that "bad" bins are automatically ignored by analysis tools like XSPEC.
Read this thread if you want to: Apply QUALITY flags to a NICER spectrum.
Last update: 2022-10-26
Spectroscopy is a fundamental pillar of most X-ray data analysis projects An X-ray spectrum provides information about the X-ray target that usually cannot be found by any other means. Thus, generating a quality spectrum is an important task that all NICER users will need to do.
One of the steps to establishing proper quality is to flag known "bad" spectral bins. This can be achieved using the standard QUALITY column. The QUALITY column as well as all other aspects of standard spectral files can be found in the The OGIP Spectral File Format calibration memo, available from HEASARC.
Essentially, spectral bins whose QUALITY value are zero are considered good. A non-zero value indicates "bad" data. For NICER, there is a standard task niphaquality to do this operation. The user specifies the desired channel range(s). This thread describes how to use niphaquality.
Here is what is needed:
Apply Quality Flags
Apply quality flags with the following command:
niphaquality infile=myspectrum.pha noticerange=22:1501
Upon completion, niphaquality will modify the spectrum in place, adding a QUALITY column if needed, and setting the QUALITY flag to "good" for the good channels and "bad" for the bad channels.
Verifying QUALITY Flags
To verify the QUALITY flag setting has occurred, we can plot this
column from the FITS file. Here is an example plotting session:
Although we have presented this step here, please consider using the nicerl3-spect high level spectral pipeline task, which does all NICER-recommended steps.
In addition to extracting a spectrum, one will have to
consider response generation,
and applying systematic error,
and bin grouping