Xtend NXB Database and Spectral Extraction Recipes

Overview

This page is to share the "provisional" NXB Database (DB) of Xtend. This page also provides an example of how to run xtdnxbgen with the database under HEASOFT 6.34. This provisional DB is for full-window mode only.


Data Files

  • NXBDB
    • Extended HK file for NXB: merged_reduced_fix.ehk
    • Stacked NTE event file in trend archive (from Oct. 21, 2023 to Jan. 29, 2024): merged_rev2_nte_xtend_fullwin_gtifix.evt
      • We used "rev2" NTE events in which flickering pixels are removed. We confirmed that "rev3" NTE files with manual screening of flickering pixels give an almost identical spectrum except the strip at DETY=1005.
  • Science data for your source; here we use OBSID 123456789 and dataClass 300000a0 as an example. Replace with your own data OBSID and dataClass in the commands below.
    • Data event file: xa123456789xtd_p0300000a0_cl.evt
    • ehk file: xa123456789.ehk
      • Please replace with your own data files via commands below
  • Other files
    • Region file that covers the entire Xtend FOV: All_det.reg
    • Region file for your source: src_det.reg (r=2.5 arcmin)
    • Response file: xtd_sim_v20201009.rmf
      • Please replace with the RMF of your source for scientific analysis and discussion
    • Response file: xtend_nxb.rmf
  • Repository

Example of Commands

Remove flickering pixel from the source event file.

  • ftselect xa123456789xtd_p0300000a0_cl.evt.gz xa123456789xtd_p0300000a0_cl_calSrcMask.evt 'status[2]==b0'

  • extractor 'xa123456789xtd_p0300000a0_cl_calSrcMask.evt' 'eventsout=NONE' 'imgfile=xa123456789xtd_p0300000a0_cl_calSrcMask_det.img' 'phafile=NONE' 'fitsbinlc=NONE' 'regionfile=NONE' 'timefile=NONE' 'xcolf=DETX' 'ycolf=DETY' 'tcol=TIME'

  • ds9 xa123456789xtd_p0300000a0_cl_calSrcMask_det.img
  • # max of source counts~535

  • # after several trials, we decided to remove flickeling pixels by invoking the commands below (not optimized, but shall be good enough for demonstration purpose)
  • searchflickpix infile=xa123456789xtd_p0300000a0_cl.evt.gz outfile=xa123456789xtd_p0300000a0.fpix cellsize=5 logprob1=10 logprob2=-20.0 iterate=no n_division=50 bthresh=4 cleanimg=no impfac=320
  • searchflickpix infile=xa123456789xtd_p0300000a0_cl.evt.gz outfile=xa123456789xtd_p0300000a0_cl2.evt cellsize=5 logprob1=10 logprob2=-20.0 iterate=no n_division=50 bthresh=4 cleanimg=yes impfac=320
  • ftappend 'xa123456789xtd_p0300000a0_cl.evt.gz[GTI]' xa123456789xtd_p0300000a0_cl2.evt

Prepare "base" GTI for source and NXB to make them compatible with each other. CORTIME cut for source is optional and you shall apply the same cut to NXB in running xtdnxbgen ("sortbin" option).

  • maketime merged_reduced_fix.ehk ehkSelA.gti "SAA==0 && ELV<-5 && DYE_ELV>100 && T_SAA_SXI>300" compact=no time=TIME no
  • maketime xa123456789.ehk.gz ehkSelB.gti "SAA==0 && T_SAA_SXI>300 && CORTIME>6" compact=no time=TIME no

GTI-based selection on the NXB event file.

  • extractor 'filename=merged_rev2_nte_xtend_fullwin_gtifix.evt' 'eventsout=merged_rev2_nte_xtend_fullwin_gtifix_ehkSel.evt' 'imgfile=NONE' 'phafile=NONE' 'fitsbinlc=NONE' 'regionfile=NONE' 'timefile=ehkSelA.gti' 'xcolf=X' 'ycolf=Y' 'tcol=TIME' 'ecol=PI' 'xcolh=DETX' 'ycolh=DETY'
  • ## 36019625, 368.1ks

GTI-based selection on the source event file.

  • extractor 'filename=xa123456789xtd_p0300000a0_cl2.evt' 'eventsout=xa123456789xtd_p0300000a0_cl2_ehkSel.evt' 'imgfile=NONE' 'phafile=NONE' 'fitsbinlc=NONE' 'regionfile=NONE' 'timefile=ehkSelB.gti' 'xcolf=X' 'ycolf=Y' 'tcol=TIME' 'ecol=PI' 'xcolh=DETX' 'ycolh=DETY'
  • ## 2183722, 75.9ks

Event-based selection on the source event file.

CI row and 2 preceding/trailing rows are removed in cleanded event file, and position of CI rows were changed on 2024 Mar 09.

Since the current NXBDB contains NTE data only before the change of CI rows, you may want to remove all CI rows and preceding/trailing rows to make your source spectrum compatible with the NXB spectrum.

  • ftselect 'xa123456789xtd_p0300000a0_cl2_ehkSel.evt[EVENTS]' xa123456789xtd_p0300000a0_cl2_ehkSel_evSel.evt expr="(abs(rawy-0)>=3 && abs(rawy-80)>=3 && abs(rawy-160)>=3 && abs(rawy-240)>=3 && abs(rawy-320)>=3 && abs(rawy-400)>=3 && abs(rawy-480)>=3 && abs(rawy-560)>=3) && (abs(rawy-0)>=3 && abs(rawy-35)>=3 && abs(rawy-115)>=3 && abs(rawy-195)>=3 && abs(rawy-275)>=3 && abs(rawy-355)>=3 && abs(rawy-435)>=3 && abs(rawy-515)>=3 && abs(rawy-595)>=3) && (grade==0 || grade==2 || grade==3 || grade==4 || grade==6) && status[1]==b0 && status[2]==b0"

Run xtdnxbgen to extract NXB spectrum of the whole area (in DETY>360 and DETY<1440). You may adopt larger values for timefirst and timelast if your data was taken well after this NXBDB (accumulates data from Oct. 21, 2023 to Jan. 29, 2024).

  • xtdnxbgen infile=xa123456789xtd_p0300000a0_cl2_ehkSel_evSel.evt ehkfile=xa123456789.ehk.gz regmode=DET regfile=All_det.reg innxbfile=merged_rev2_nte_xtend_fullwin_gtifix_ehkSel.evt innxbehk=merged_reduced_fix.ehk apply_xtdtools=no database=LOCAL db_location=./ timefirst=-150 timelast=+150 SORTCOL=CORTIME sortbin="6,8,10,12,99" expr="(abs(rawy-0)>=3 && abs(rawy-80)>=3 && abs(rawy-160)>=3 && abs(rawy-240)>=3 && abs(rawy-320)>=3 && abs(rawy-400)>=3 && abs(rawy-480)>=3 && abs(rawy-560)>=3) && (abs(rawy-0)>=3 && abs(rawy-35)>=3 && abs(rawy-115)>=3 && abs(rawy-195)>=3 && abs(rawy-275)>=3 && abs(rawy-355)>=3 && abs(rawy-435)>=3 && abs(rawy-515)>=3 && abs(rawy-595)>=3) && (grade==0 || grade==2 || grade==3 || grade==4 || grade==6) && status[1]==b0 && status[2]==b0 && DETY>360 && DETY<1440" outpifile=xtdnxb.pi outnxbfile=xtdnxb.evt outnxbehk=xtdnxb.ehk

Extract source spectrum

  • #-----
  • xselect
  • XRISM
  • read events
  • ./
  • xa123456789xtd_p0300000a0_cl2_ehkSel_evSel.evt
  • yes
  • extract events
  • # 1714642, 75.9ks
  • set image det
  • filter region
  • src_det.reg
  • extract events
  • # 1263978, 75.9ks
  • extract spectrum
  • save spectrum
  • src.pi
  • exit
  • no
  • #-----

Run xtdnxbgen to extract NXB spectrum for the source (in this example, named as N132D_xtdnxb.pi).

  • xtdnxbgen infile=xa123456789xtd_p0300000a0_cl2_ehkSel_evSel.evt ehkfile=xa123456789.ehk.gz regmode=DET regfile=N132D_det.reg innxbfile=merged_rev2_nte_xtend_fullwin_gtifix_ehkSel.evt innxbehk=merged_reduced_fix.ehk apply_xtdtools=no database=LOCAL db_location=./ timefirst=-150 timelast=+150 SORTCOL=CORTIME sortbin="6,8,10,12,99" expr="(abs(rawy-0)>3 && abs(rawy-80)>3 && abs(rawy-160)>3 && abs(rawy-240)>3 && abs(rawy-320)>3 && abs(rawy-400)>3 && abs(rawy-480)>3 && abs(rawy-560)>3) && (abs(rawy-0)>=3 && abs(rawy-35)>=3 && abs(rawy-115)>=3 && abs(rawy-195)>=3 && abs(rawy-275)>=3 && abs(rawy-355)>=3 && abs(rawy-435)>=3 && abs(rawy-515)>=3 && abs(rawy-595)>=3) && (grade==0 || grade==2 || grade==3 || grade==4 || grade==6) && status[1]==b0 && status[2]==b0" outpifile=N132D_xtdnxb.pi outnxbfile=N132D_xtdnxb.evt outnxbehk=N132D_xtdnxb.ehk


Generated NXB Spectrum (whole area in DETY>360 && DETY<1440) vs. Model

You may check the generated NXB spectrum as shown below. Link to the xcm file.

  • #-----
  • xspec
  • data 1:1 xtdnxb.pi
  • resp 1:1 xtend_nxb.rmf
  • setplot device /xw
  • setplot energy
  • ig **-0.5 15.0-**
  • model 1:det const*(powerlaw+gaussian+gaussian+ gaussian+gaussian+gaussian+gaussian+gaussian)
  • 1
  • 0.25
  • 0.11
  • 2.14999
  • 0
  • 0.0144638
  • 7.48709
  • 0
  • 0.0109641
  • 9.71709
  • 0
  • 0.0995875
  • 11.4995
  • 0
  • 0.0426647
  • 8.35421
  • 0.245957
  • 0.0141358
  • 11.4877
  • 0.167476
  • 0.056534
  • 13.4156
  • 0.0170246
  • 0.00632171
  • show
  • newpar det:1 0.95
  • plot
  • save all test-xtdnxbgen-nxbmodel.xcm
  • setplot xlog off
  • iplot 1d
  • rescale y 0.01 1
  • color 2 on 2
  • plot
  • hard /gif
  • exit
  • exit
  • #-----
  • mv pgplot.gif test-xtdnxbgen-nxbmodel_plot.gif

  • Generated spectrum agrees well with the NXB model with const=0.95.




COR-weighted Image

Following the recipe, you can also construct COR-weighted images in DET & SKY coordinates, as summarized below.

Here are generated DET images of data from an observation of N132D (left) and the NXB model (right). Z-axis ranges are roughly proportional to the exposure ratio.


Here are generated SKY images of N132D (left) and the NXB model (right). The coordinates of the NXB image look OK.