The following steps should be taken to run nibackgen3C50 as a patch on your HEASoft installation. Alternatively, one can run the tool from within an existing HEASoft installation without explicitly installing it. ***INSTALLING AND RUNNING nibackgen3C50 UNDER HEASoft*** (1) Download and "install" (i.e., untar) bg_models_3C50.tar.gz in some directory, "mybackdir". The 'bkglibdir' parameter may then be set to mybackdir/bg_models_3C50. The 3C50 background library index file, nibackgen3C50_info.fits is also included under bg_models_3C50. The 'bkgidxdir' parameter may therefore also be set to mybackdir/bg_models_3C50, or that file may be re-located and 'bkgidxdir' set accordingly. (2) Go to a terminal with HEASoft already set up. (3) Download and install nibackgen3C50_v7b.tar.gz in the nicer/tasks directory. (a) copy nibackgen3C50_v7b.tar.gz to the directory /mysoftwaredir/myheasoft/nicer/tasks where myheasoft is the HEASoft top level directory, e.g. heasoft-6.29. (b) unpack the tarfile tar -zxvmf nibackgen3C50_v7b.tar.gz (c) build and install the task cd nibackgen3C50 hmake hmake install If re-installing, "uninstall" as follows before the hmake step: rm -f /mysoftwaredir/myheasoft/nicer/myplatform/bin/nibackgen3C50.pl rm -f /mysoftwaredir/myheasoft/nicer/myplatform/syspfiles/nibackgen3C50.par rm -f /mysoftwaredir/myheasoft/myplatform/help/nibackgen3C50.html where myplatform is the platform-specific string denoting your machine's architecture, e.g. x86_64-apple-darwin19.6.0. One may type "fhelp nibackgen3C50" (and "plist nibackgen3C50") for additional details, and examples. (4) In its simplest single-obsid implementation, nibackgen3C50 rootdir='dataparentdir' obsid='2010100101' \ bkgidxdir='mybackdir/bg_models_3C50' \ bkglibdir='mybackdir/bg_models_3C50' gainepoch='2019' creates total and background spectra, using the 2019 version of the 3C50 background library, corresponding to OBSID 2010100101, where 2010100101 is a standard NICER directory located under the dataparentdir root directory. The spectra corresponding to the ISS night and ISS day components are also created, and are identifed by "_ngt.pi" and "_day.pi" suffixes, respectively. (5) To implement the task for a particular pair of "ufa" and "cl" event files nibackgen3C50 rootdir='NONE' obsid='NONE' bkgidxdir='mybackdir/bg_models_3C50' \ bkglibdir='mybackdir/bg_models_3C50' gainepoch='2019' \ calevtdir='NONE' ufafile='ufa_merged.evt' clfile='total_merged.evt Its a recommended to check the exposure time of the "total" spectrum produced by nibackgen3C50 to make sure that the extractor call in the task properly set the exposure time to the sum of the intervals in the GTI. (a) gtisum nibackgen3C50_tot.pi Running GTISUM_v1.3 ======================== Ext. HDUCLAS1 Num.Intervals GTI Start GTI End GoodTime (sec) 0 'IMAGE ' 1 'SPECTRUM' 2 'GTI ' MM 123456789 123459876 NNNN (b) ftlist nibackgen3C50_tot.pi K | grep EXPOSURE (c) If EXPOSURE is not equal to NNNN, fthedit nibackgen3C50_tot.pi EXPOSURE a NNNN where NNNN is the output from gtisum ***RUNNING nibackgen3C50 WITHOUT INSTALLING IT in HEAsoft*** (1) Download and "install" (i.e., untar) bg_models_3C50.tar.gz in some directory, "mybackdir". The 'bkglibdir' parameter may then be set to mybackdir/bg_models_3C50. The 3C50 background library index file, nibackgen3C50_info.fits is also inclued under bg_models_3C50. The 'bkgidxdir' parameter may therefore also be set to mybackdir/bg_models_3C50, or that file may be re-located and 'bkgidxdir' set accordingly. (2) Go to a terminal with HEASoft already set up. (3) Unpack the tarfile tar -xzvf nibackgen3C50_v7b.tar.gz and copy nibackgen3C50.par to your 'pfiles' directory (4) nibackgen3C50.pl rootdir='dataparentdir' obsid='2010100101' \ bkgidxdir='mybackdir/bg_models_3C50' \ bkglibdir='mybackdir/bg_models_3C50' gainepoch='2019' creates total and background spectra, using the 2019 version of the 3C50 background library, corresponding to OBSID 2010100101, where 2010100101 is a standard NICER directory located under the dataparentdir root directory. The spectra corresponding to the ISS night and ISS day components are also created, and are identifed by "_ngt.pi" and "_day.pi" suffixes, respectively. (5) To implement the task for a particular pair of "ufa" and "cl" event files nibackgen3C50.pl rootdir='NONE' obsid='NONE' bkgidxdir='mybackdir/bg_models_3C50' \ bkglibdir='mybackdir/bg_models_3C50' gainepoch='2019' \ calevtdir='NONE' ufafile='ufa_merged.evt' clfile='total_merged.evt The only difference between these commands and those described above, is that the ".pl" suffix must be explictly included. The help file nibackgen3C50.html may be viewed by directly opening it in a browser. Also, its a good idea to check the exposure time of the "total" spectrum produced by nibackgen3C50 to make sure that the extractor call in the task properly set the exposure time to the sum of the intervals in the GTI. (a) gtisum nibackgen3C50_tot.pi Running GTISUM_v1.3 ======================== Ext. HDUCLAS1 Num.Intervals GTI Start GTI End GoodTime (sec) 0 'IMAGE ' 1 'SPECTRUM' 2 'GTI ' MM 123456789 123459876 NNNN (b) ftlist nibackgen3C50_tot.pi K | grep EXPOSURE (c) If EXPOSURE is not equal to NNNN, fthedit nibackgen3C50_tot.pi EXPOSURE a NNNN where NNNN is the output from gtisum