Extract lightcurve of source and background

Here we demonstrate how to extract source and background light curves from SXT Level 2 data using XSELECT. The PC mode 28th March 2017 observation of GRS 1915+105 is used for an example. The observation id is G06_033T01_9000001116. The test data used here is available in the public domain and can be downloaded from the astrobrowser portal.
Go to the ‘Results’ folder where you want to extract your results.

$ cd Results
$ xselect

                         **  XSELECT V2.4j  **
 
$ Enter session name >[ ] xsel 
$ xsel:NICER > read event GRS_1915_sxt_merged_cl.evt
$ Enter the Event file dir >[ ] ./
Got new mission: ASTROSAT
$ Reset the mission ? >[ ] yes 
 
 Notes: XSELECT set up for      ASTROSAT
 Time keyword is TIME       in units of s
 Default timing binsize =   5.0000
 
Setting...
 Image  keywords   = X          Y           with binning =    1
 WMAP   keywords   = X          Y           with binning =    1
 Energy keyword   = PI                     with binning =    1
 
Getting Min and Max for Energy Column...
Got min and max for PI:     0   1023
 
Got the minimum time resolution of the read data:   2.3775
MJDREF =  5.5197000000000E+04 with TIMESYS = UTC
 Number of files read in:            1
 
******************** Observation Catalogue ********************
  
Data Directory is: /path_to_present_directory/
HK Directory is: /path_to_present_directory/
        TELESCOP    INSTRUME    DATAMODE    DATE-OBS    OBJECT       ORB_NUM
      1 ASTROSAT    SXT         PC          2017-03-29  GRS 1915+105     8118
 
$ xsel:ASTROSAT-SXT-PC > filter region ds9.reg 
$ xsel:ASTROSAT-SXT-PC > filter pha_cut 100 500
$ xsel:ASTROSAT-SXT-PC > show filters
 
 *** SELECTIONS ***
 
     NONE
 
 *** FILTERS ***
 
A PHA filter from   100 to   500 has been entered
 
 Spatial selections have been read in from:
    ds9.reg
PHA Lower cutoff =  100 PHA Upper cutoff =  500
 
$ xsel:ASTROSAT-SXT-PC > extract curve
extractor v5.36    26 Feb 2020
 Getting FITS WCS Keywords
 Doing file: /path_to_present_directory/GRS_1915_sxt_merged_cl.evt[regfilter("xsel_region.xsl",X,Y)]
100% completed
          Total      Good    Bad: Time     Phase     Grade       Cut
         138211    125708            0         0         0     12503
===============================================================================
    Grand Total      Good    Bad: Time     Phase     Grade       Cut
         138211    125708            0         0         0     12503
   in  5068.8     seconds
 Fits light curve has   125708 counts for  24.80     counts/sec
 Thresholding removed significant counts
 Try exposure=0.0 on the extract command in xselect
 or lcthresh=0.0 if running extractor stand-alone
 Thresholding removed more than half the bins
 Try exposure=0.0 on the extract command in xselect
 or lcthresh=0.0 if running extractor stand-alone

$ xsel:ASTROSAT-SXT-PC > plot curve

$ PLT> hardcopy lightcurve_1_5_keV.ps/cps
$ PLT> exit

The light curve above is extracted for the 1.0 -5.0 keV energy range. However, the data can be filtered to produce images over any energy band. using the command filter pha_cutoff, where the range must be given in terms of channels. For the SXT, 1 channel = 100 eV.

$ xsel:ASTROSAT-SXT-PC > save curve lightcurve
$ xsel:ASTROSAT-SXT-PC > clear region
$ xsel:ASTROSAT-SXT-PC > extract image
 Getting FITS WCS Keywords
 Doing file: /path_to_present_directory/GRS_1915_sxt_merged_cl.evt
100% completed
          Total      Good    Bad: Time     Phase     Grade       Cut
         166868    142584            0         0         0     24284
===============================================================================
    Grand Total      Good    Bad: Time     Phase     Grade       Cut
         166868    142584            0         0         0     24284
   in  5068.8     seconds
 Image            has   142584 counts for  28.13     counts/sec

$ xsel:ASTROSAT-SXT-PC > plot image
$ xsel:ASTROSAT-SXT-PC > filter region Bkg.reg 
$ xsel:ASTROSAT-SXT-PC > show filters
 
 *** SELECTIONS ***
 
     NONE
 
 *** FILTERS ***
 
A PHA filter from   100 to   500 has been entered
 
 Spatial selections have been read in from:
    Bkg.reg
PHA Lower cutoff =  100 PHA Upper cutoff =  500

$ xsel:ASTROSAT-SXT-PC > extract curve
 Getting FITS WCS Keywords
 Doing file: /path_to_present_directory/GRS_1915_sxt_merged_cl.evt[regfilter("xsel_region.xsl",X,Y)]
100% completed
          Total      Good    Bad: Time     Phase     Grade       Cut
            291       255            0         0         0        36
===============================================================================
    Grand Total      Good    Bad: Time     Phase     Grade       Cut
            291       255            0         0         0        36
   in  5068.8     seconds
 Fits light curve has      255 counts for 5.0308E-02 counts/sec
 Thresholding removed significant counts
 Try exposure=0.0 on the extract command in xselect
 or lcthresh=0.0 if running extractor stand-alone
 Thresholding removed more than half the bins
 Try exposure=0.0 on the extract command in xselect
 or lcthresh=0.0 if running extractor stand-alone

$ xsel:ASTROSAT-SXT-PC > plot curve

$ PLT > exit
$ xsel:ASTROSAT-SXT-PC > save curve Bkg_lightcurve
Wrote FITS light curve to file Bkg_lightcurve.lc
$ xsel:ASTROSAT-SXT-PC > exit
$ Save this session? >[ ] No