The nibackgen3C50 task uses a set of three background proxies embedded in NICER event lists to estimate the background spectrum for a single NICER observation. It does so by (1) dividing the exposure into intervals, (2) calculating the value of the proxies in each interval, (3) finding the best match to a pre-computed library of background spectra for each interval, and (4) combining these - appropriately weighted and scaled - to construct a composite background spectrum. Note that the library spectra are extracted from observations of source-free areas of the sky, and include the astrophysical background associated with those fields as well as the NICER instrumental Non-X-ray-Background. For these purposes, the input cleaned event file GTI are subdivided into intervals no larger than that specified by the 'dtmax' parameter, discarding residual intervals smaller than that specified by the 'dtmin' parameter. The location of the required "3C50_RGv5" background library file is specified by the 'bkgdir' parameter. One may set 'dtmin' to 0 and 'dtmax' to some value greater than the exposure time to use the original GTI.
The task also creates a total spectrum extracted from the input event list based on these (possibly revised) GTI, with the additional excision of data in time intervals with background proxies that lie outside of the background library bounds. The source (background subtraced) spectrum may then be determined by the difference between the total spectrum and the background spectrum. Both the total and background spectra are extracted based on the unfiltered event list with the option of excluding a list of FPMs using the 'fpmofflist' parameter that, by default, is set to FPMs (DET_ID) 14 and 34. Finally, GTI where the absolute value of the estimated net "HBG" (13-15 keV) count rate exceeds the value set by the 'hbgcut' parameter, are considered as suspect and also excluded; its default value is set at a conservative value of 0.5 counts per second.
Note that "3C50_RGv5" background library files were extracted using CalDB gain file nixtiflightpi20170601v002.fits; and, strictly speaking are applicable to input event files with the same gain correction (see GCALFILE header keyword to check).
As with the nicerl2 task, by default, the task expects the input to adhere to the standard NICER directory layout with calibrated merged unfiltered and filtered event files in $ROOTDIR/$OBSID/xti/event_cl, and auxiliary files in $ROOTDIR/$OBSID/auxil/. An advanced programmer can adjust these locations with the hidden parameters ufadir, cldir, ufafile, clfile, and mkfile. When using these parameters, note that the certain patterns can be used as shortcuts: "$CALEVTDIR" for the location of the input calibrated and filter event files, "$OBSID" for the observation ID number, and "$INDIR" for the input directory $ROOTDIR/$OBSID. Note that these patterns should appear explicitly with the dollar sign included; typically the command shell will interpret '$name' as a shell variable so appropriate quoting will be required. The 'rootdir' parameter may be maintained at its default value of "NONE" in some such cases.
The user may also directly input the combined, calibrated unfiltered "ufa" and filtered "cl" event files using the 'ufafile' and 'clfile' parameters. In this case, the 'rootdir', 'obsid', and 'calevtdir' parameters may all be set to "NONE". The GTI extension of the cleaned event file must be named GTI (and not, e.g., STDGTI).
The 'mkfile' parameter is not currently used, but reserved for future task revision, and may be generally set to 'NONE' at this time.
1. Extract estimated NICER background, and accompanying total spectrum, for observation 1200190101.
nibackgen3C50 rootdir='datadir' obsid='1200190101' bkgdir='bgklibdir'
The input directory is a NICER observation number 1200190101. The input event files are in the observation directory under datadir/1200190101/xti/event_cl/, and the background library files under bgklibdir.
2. Extract estimated NICER background and accompanying total spectrum for observation 1200190101, using intervals between 10 and 120 s to characterize the variation of the background.
nibackgen3C50 rootdir='datadir' obsid='1200190101' bkgdir='bgklibdir' \ dtmin=10.0 dtmax=120.0
3. Extract estimated NICER background and accompanying total spectrum, for observation 1200190101, excluding events detected in FPMs (DET_ID) 0, 1, 2, 3, 4, 5, 25, 26, and 27 from the output total and background spectrum.
nibackgen3C50 rootdir='datadir' obsid='1200190101' bkgdir='bgklibdir' \ fpmofflist=0-5,25-274. Extract estimated NICER background and accompanying total spectrum from ufiltered event file combined_ufa.evt based on the GTI in combined_cl.evt, and using intervals between 10 and 120 s to characterize the variation of the background.
nibackgen3C50 rootdir='NONE' obsid='NONE' bkgdir='bgklibdir' \ calevtdir='NONE' ufafile='combined_ufa.evt' clfile='combined_cl.evt' \ mkfile='NONE' dtmin=10.0 dtmax=120.0