Title: Using ScienceTools when simulating and analysing GLAST GRB data
1Using ScienceTools when simulating and analysing
GLAST GRB data
Milan Battelino, Stockholm University
- Workshop _at_ KTH
- 2007-04-12
- ScienceTools, concepts and related software
2Outline
- Introduction to main tools used gtobssim GBM
Tools - Installation and preparation of ScienceTools for
GRB simulations - Simulation of GRBs producing LAT and GBM data
using ScienceTools and related software - gtobssim
- GBM Tools
- Using ScienceTools to prepare LAT and GBM data
for spectral analysis - LAT Data
- gtselect
- gtbin
- gtrspgen
- GBM data
- gtbin
- Analysis of LAT and GBM data
- XSPEC
- FTOOLS
- Demo if time allows
31. Introduction to main tools used gtobssim GBM
Tools
4LAT Simulations (ScienceTools)
gtobssim
Based on BATSE phenomenological data
Based on Fireball Model Physics
Reads Spectrum From An ASCII file
High-level model simulators
Common tool to Interface models with LAT
software
LAT simulators (C)
GLAST LAT Full Simulation (Monte Carlo)
GLAST LAT Fast Simulation with Parameterized IRF
Event Data
adapted from N. Omodei, 2006
5GBM (NaIBGO) Simulations
Based on BATSE phenomenological data
SBM
GRB Physical Model (GRB)
GRB Phenomenological Model (GRBObs)
ScienceTools
Band Parameters
ASCII histogram files (NaI and BGO)
GBM Tools
GridDataReader
IDL Code separate from ScienceTools written in
C
NaI 5keV - 1MeV BGO 150keV - 30 MeV
Event Data
12 NaI 2 BGO Detectors
6Band Function
Band, D. et al.1993 ApJ 413, 281
Excellent fit for majority of Prompt GRB
spectra in BATSE energy window
a, b, Ec , Aband
72. Installation and preparation of ScienceTools
8Installation of ScienceTools
- GLAST SAS User Workbook
- http//glast-ground.slac.stanford.edu/workbook/sci
Tools_Home.htm - A Crash Course in the Analysis of LAT Data
- http//glast.gsfc.nasa.gov/ssc/dev/Analysis_Tools_
Documentation/Analysis_threads/crash_course.html - Standard Analysis Environment (SAE)
- Extension of FTOOLS environment
- Supported platforms
- Red Hat Enterprise Linux 3, Fedora Core 1,
Scientific Linux 3 - Red Hat Enterprise Linux 4, Scientific Linux 4
- Mac OS X (Tiger)
- Windows XP
9Preparing ScienceTools
- Installing GRBtemplate
- Tar-ball
- http//www-glast.stanford.edu/cgi-bin/viewcvs/cele
stialSources/GRBtemplate.tar.gz?viewtarpathrevH
EAD - Install instructions
- https//confluence.slac.stanford.edu/display/SCIGR
PS/GRBtemplateHowTo - Compile and link gtobssim
- Linux
- cd HOME/ScienceTools/v7r5/observationSim/v6r3p5/c
mt - cmt broadcast make clean
- cmt broadcast make all
- All gtobssim dependencies, including GRBtemplate,
are (re)compiled and linked.
103. Simulation of GRBs gtobssimGBM Tools
11Simulation of GRBs
- gtobssim
- fast and flexible observation simulator using the
instrument response file (IRFs) - generate photon events from astrophysical sources
and process those photons according to the
specified IRF
12GRBtemplate
- Photon Histogram
- Number of energy bins (columns)
- Min Energy
- Max Energy
- Number of time bins (rows)
- Timebinwidth
- Energy binning
13Prepare for gtobssim run
- Prepare source XML definition library file
- GRBtemplate_user_library.xml
- ltsource_library title"GRBtemplate_library"gt
- ltsource name" GRB960530005 "gt
- ltspectrum escale"MeV"gt
- ltSpectrumClass name"GRBtemplateManager"
- params"/home/milan/GLAST/DAT/LAT_GRB_9110
16001.dat, - 0.0, 10.0 , 1, 0.0"/gt
- ltuse_spectrum frame"galaxy" /gt
- lt/spectrumgt
- lt/sourcegt
- Prepare list of XML definition files (optional)
- xmlFiles.dat
14Run gtobssim
- Interactively (command-line)
- gt HOME/Glast/ScienceTools-v7r5/observationSim/v
6r3p5/rh9_gcc32/gtobssim.exe - File of flux-style source definitions none
../GRBtemplate_user_library.xml - File containing list of source names none
../source_names.dat - Pointing history file none
- Prefix for output files test 960530002
- Simulation time (seconds) lt1 - 4e7gt 86400
- Simulation start date 2001-01-01 000000
2001-05-30 000000 - Apply acceptance cone? no
- Response functions ltDC2DC1AG25gt DC1A DC2
- Random number seed 20648
- Input filename /home/milan/GLAST/DAT/LAT_GRB_9605
30002.dat - Start time 1.28736e07
- Min photon energy 10000
- m_GenerateGBMOutputs 0
- m_theta_fow 0
- Theta 89.4904 deg. Theta 90 -gt XY-plane,
Theta 0 -gt Z. - Phi 117.805 deg.
15Run gtobssim
- Single command-line
- HOME/Glast/ScienceTools-v7r5/observationSim/v6r
3p5/rh9_gcc32/gtobssim.exe - xml_source_file"../GRBtemplate_use
r_library.xml" \ - source_list"../source_names.dat"
\ - scfile"none" \
- outfile_prefix"960530002" \
- simulation_time"86400" \
- start_date"2001-05-30 000000" \
- use_acceptance_cone"no" \
- rspfunc"DC2" \
- random_seed"20648"
- Input filename /home/milan/GLAST/DAT/LAT_GRB_9605
30002.dat - Start time 1.28736e07
- Min photon energy 10000
- m_GenerateGBMOutputs 0
- m_theta_fow 0
- Theta 89.4904 deg. Theta 90 -gt XY-plane,
Theta 0 -gt Z. - Phi 117.805 deg.
16Run gtobssim
- ObsSim GUI
- This tool drives the gtobssim application and
provides a convenient means of navigating the
various libraries of sources available for
simulation by gtobssim or GLEAM.
17Produced LAT data
- 960530002_events_0000.fits
- 960530002_scData_0000.fits
- 960530002_srcIds.txt
- GRBTMP_010530000_DEF.txt
18Event data 960530002_events_0000.fits
FT1 (LAT Event Summary) Format
19Science Flight Data 960530002_scData_0000.fits
FT2 (LAT pointing livetime history) Format
20GBM Definition file GRBTMP_010530000_DEF.txt
- BURST DEFINITION FILE
- Burst Name
- 010530000
- RA,DEC (deg)
- 358.754 11.8625
- S/C azimuth, elevation (deg)
- 117.805 89.4904
- Trigger Time (s)
- 10
21GBM Tools
- IDL Code
- http//www.astro.su.se/milan/GBM_Tools_modified_0
70322.tgz - GBM Tools Input
- Definition File
- Band Parameter file
- or
- NaI BGO Histogram files
- Data binned in time (rows) and energy (columns)
according to energy grids - http//www.astro.su.se/milan/NaI_energy_grid.dat
- http//www.astro.su.se/milan/BGO_energy_grid.dat
- Not limited to GRB data!
22Running GBM Tools
- Interactively
- Input files
- NaI_090101011.lc
- BGO_090101011.lc
- 090101011.def
- IDLgt simulate_one_burst
- SIMULATION OF THE GBM DATA FOR ONE GAMMA-RAY
BURST
- Input the root of the filenames
- 090101011
- Simulation (0) or generate energy grid files (1)?
- 0
- Use light curve file with
- Band parameters (0),
- photon flux matrix with logarithmic energy
bins (1) - photon flux matrix with detector energy grid
bins (2)
- Calculate detection probabilities
- Generate burst photons
- Fetching photon list
- Compiled module READ_GRID_16MS.
- TimeBins 10
- Read in photon matrix.
- Begin processing 10 time bins
- Photons fetched
- 2199 photons created between energies 2.00000 -
20000.0 - and times 0.00000 - 0.160000 from 2 detectors
- Apportion and detect burst photons
- Detector 1( 2)
-
- Number of photons 1083
- Another 10000 done 0.00063232583 0
- Detector 2( 2)
-
- Number of photons 1116
- Another 10000 done 5.0458031e-05 0
23Running GBM Tools
- Script
- Input files
- GRB_OBS/NaI_090101011.lc
- GRB_OBS/BGO_090101011.lc
- GRB_OBS/090101011.DEF
- GRB_LIST
- gt ./GBM.sh GRB_LIST 12345
- spawn idl
- IDL Student Edition 5.6 (linux x86 m32). (c)
2002, Research Systems, Inc. - Installation number 001.
- Licensed for use by IDL Student Version
- IDLgt .compile channel_boundaries.pro
- .
- .
- .
Fetching photon list TimeBins 10
Read in photon matrix. Begin processing
10 time bins Photons fetched 2199 photons created
between energies 2.00000 - 20000.0 and times
0.00000 - 0.160000 from 2 detectors Apportion and
detect burst photons Detector 1(
2) Number of
photons 1083 Another 10000 done
0.00063232583 0 Detector 2(
2) Number
of photons 1116 Another 10000 done
5.0458031e-05 0 Checked error is
1.77123 Calculate detection probabilities Generate
burst photons Fetching photon list TimeBins
10 Read in photon matrix. Begin
processing 10 time bins Photons
fetched 1827 photons created between energies
15.0000 - 100000. and times 0.00000 - 0.160000
from 2 detectors Apportion and detect burst
photons Detector 1(
2) Number of
photons 883 Another 10000 done
0.00060495438 0 Detector 2(
2) Number
of photons 944 Another 10000 done
0.0023189511 0
24Produced GBM data
- GLG_TTE__BN090101011_V02.FIT
- GLG_BCK__BN090101011_V02.BAK
- GLG_CSPEC__BN090101011_V02.RSP
- GLG_CTIME__BN090101011_V02.FIT
- GLG_CSPEC__BN090101011_V02.FIT
- N0-NB or B0-B1
- Note that GBM consists of 12 NaI and 2 BGO
detectors!
254. Preparation of produced data for further
analysis
26XSPEC
- Command-driven, interactive, X-ray
spectral-fitting program that is
detector-independent. - CGRO
- Chandra
- XMM-Newton
- GLAST
27Preparing LAT and GBM data for XSPEC
- Files required by XSPEC
- PHA-I or PHA-II (LATGBM)
- Response files (LATGBM)
- Background (GBM)
- ScienceTools available
- gtselect (LAT)
- gtrspgen (LAT)
- gtbin (LAT GBM)
28Converting LAT/GBM data for XSPEC
EVENT (FT1)
gtobssim
gtselect
SELECT (TTE)
SC DATA
GBM Tools
gtrspgen
gtbin
PHA-I
PHA-II
BAK
RSP
29gtselect
Performs sub-selections of event data. Creates a
new FITS file of selected rows in an input event
data file based on cuts that are applied to the
values in each row of the input file. This
application enables more detailed selections to
be made on data obtained from the GSSC data
server or generated using gtobssim.
- Example
- DATASUBSELECTORROOT/rh9_gcc32/gtselect.exe
- Input FT1 file test_events_0000.fits
960530002_events_0000.fits - Output FT1 file test_select.fits
960530002_select.fits - RA for new search center (degrees) lt0 - 360gt
0.0 358.754 - Dec for new search center (degrees) lt-90 - 90gt
0.0 22.8625 - radius of new search region (degrees) lt0 - 180gt
20 20 - start time (MET in s) 0 12873605
- end time (MET in s) 5 12873665
- lower energy limit (MeV) 30 30
- upper energy limit (MeV) 200000 200000
- Event classes (-1all, 0FrontA, 1BackA,
2FrontB, 3BackB, 4class A) lt-1 - 4gt 4 -1 - Done.
30gtselect
Use fv to pinpoint sky position of burst
Use result as input To gtselect
31Event Classes
- Class A
- Best PSF
- Lowest background contamination
- Class B
- Events that belong to All but are not Class A
events - All
- More effective area
- More background...
- Back and Front
- Front or back section of LAT
32gtbin
Bins an event list in time, energy, or space and
results in spectra (PHA), lightcurves (LC), or
a count map (CMAP).
- Example PHA-I
- gt gtbin.exe
- This is gtbin version v1
- Type of output file ltCCUBECMAPLCPHA1PHA2gt
CMAP PHA1 - Event data file name 960530002_select.fits
GLG_TTE_NB_BN960530002_V02.FIT - Output file name 960530002.cmap
GRB960530002_NB.pha - Spacecraft data file name 960530002_scData_0000.f
its none - Example PHA-II
- gt gtbin.exe
- This is gtbin version v1
- Type of output file ltCCUBECMAPLCPHA1PHA2gt
CMAP PHA2 - Event data file name GLG_TTE_N1_BN960530002_V02.F
IT GLG_TTE_NB_BN960530002_V02.FIT - Output file name test.pha2 GRB960530002_NB_5s.
pha2 - Spacecraft data file name none none
- Algorithm for defining time bins ltFILELINSNRgt
LIN LIN - Start value for first time bin 12873605
3010868200 - Stop value for last time bin 12873665
3010868230 - Width of linearly uniform time bins 0.1 5
33CMAP
34LC
35gtrspgen
Creates an RSP file from the multi-dimensional
response functions.
- gt RSPGENROOT/rh9_gcc32/gtrspgen.exe
- This is gtrspgen version v1r2p3
- Response calculation method (GRB, PS) ltGRBPSgt
PS GRB - Spectrum file name test.pha 960530002.pha
- Spacecraft data file name test_scData_0000.fits
960530002_scData_0000.fits - Output file name test.rsp 960530002.rsp
- Time of GRB (s) 10 12873605
- Response function to use, DC2DC2ADC2FADC2BADC2
FBDC2BBDC1AG25 etc DC1A DC2 - Algorithm for defining true energy bins
ltFILELINLOGgt LIN LOG - Start value for first energy bin 20 30
- Stop value for last energy bin 300000 200000
- Number of logarithmically uniform energy bins
100 100
365. Analysis of GLAST data using XSPEC
37XSPEC analysis
- Input files
- PHA-I or PHA-II
- Background
- Response
- Procedure
- Load Data files
- Load Background files
- Load Response files
- Define good energy range
- Define model
- Perform spectral fit
- Determine error range
38XSPEC analysis exampleLoad Data
- XSPEC12gtquery yes
- XSPEC12gtdata GRB_960530002_N9_05_00s.pha21
GRB_960530002_NB_05_00s.pha21
GRB_960530002_B1_05_00s.pha21
960530002_05_0s.pha21 - Source File GRB_960530002_N9_05_00s.pha21
- Net count rate (cts/s) for Spectrum1
4.970e02 /- 1.004e01 - Assigned to Data Group 1 and Plot Group 1
- Noticed Channels 1-128
- Telescope GLAST Instrument GBM Channel Type
PI - Exposure Time 4.954 sec
- No response loaded.
- Source File GRB_960530002_NB_05_00s.pha21
- Net count rate (cts/s) for Spectrum2
5.047e02 /- 1.010e01 - Assigned to Data Group 1 and Plot Group 2
- Noticed Channels 1-128
- Telescope GLAST Instrument GBM Channel Type
PI - Exposure Time 4.967 sec
- No response loaded.
- Source File GRB_960530002_B1_05_00s.pha21
39XSPEC analysis exampleLoad Response
- XSPEC12gtresp GRB_960530002_N9.rsp
GRB_960530002_NB.rsp GRB_960530002_B1.rsp
960530002.rsp - Response successfully loaded.
- Response successfully loaded.
- Response successfully loaded.
- Response successfully loaded.
- XSPEC12gtignore 11000.0-
- 22 channels (107-128) ignored in source
1 -
- XSPEC12gtignore 21000.0-
- 22 channels (107-128) ignored in source
2 -
- XSPEC12gtignore 3-150.0
- 2 channels (1-2) ignored in source 3
- XSPEC12gtignore 33e4-
40XSPEC analysis exampleDefine Model
- XSPEC12gtmodel bbbknpowerhighecut
- Input parameter value, delta, min, bot, top, and
max values for ... - 3 0.01 0.0001 0.01
100 200 - bbodykTgt50
- 1 0.01 0 0
1e24 1e24 - bbodynormgt
- 1 0.01 -3 -2
9 10 - bknpowerPhoIndx1gt1.42
- 5 0.01 0 0.01
1e06 1e06 - bknpowerBreakEgt6e3
- 2 0.01 -3 -2
9 10 - bknpowerPhoIndx2gt2.1
- 1 0.01 0 0
1e24 1e24 - bknpowernormgt
- 10 0.01 0.0001 0.01
1e06 1e06 - highecutcutoffEgt1e6 0.01 1e3 1e4 1e7 1e8
- 15 0.01 0.0001 0.01
1e06 1e06 - highecutfoldEgt3e6 0.01 1e3 1e4 1e7 1e8
41XSPEC analysis exampleModel Fit and Param
Estimates
- XSPEC12gtrenorm
- Chi-Squared 546.5629 using 344 PHA bins.
- Reduced chi-squared 1.626675 for 336
degrees of freedom - Null hypothesis probability 2.858868e-12
- Valid fit does not exist.
- XSPEC12gtfit 80 1.0e-4
- .
- .
- .
- Model bbodylt1gtbknpowerlt2gthighecutlt3gt Source
No. 1 Active/On - Model Model Component Parameter Unit Value
- par comp
- 1 1 bbody kT keV
41.8168 /- 0.836410 - 2 1 bbody norm
5.40653 /- 0.172398 - 3 2 bknpower PhoIndx1
1.48313 /- 1.47317E-02
42Error range in XSPEC analysis
- fit command not enough for model test and
parameter estimates - Use uncertain or error command to determine
actual 1s levels and c2
43Problem
- Is it correct to always use c2 statistic?
- Not at low photon counts (lt 5 ph/bin)
- Alternative
- C-statistic
- Modified version of Cash statistic
- W.Cash, ApJ 228, 939-947 (1979)
- Useful when low photon count (lt 5 ph/bin) but...
- May only be used for estimation of parameter
values, NOT model testing!
44Solution
- Use FTOOLS to rebin data to gt 5 ph/bin
- bcmppha
- convert from GBM PHA-II to PHA-I
- modified for RATE, original only handles
- COUNT correctly ?
- mathpha
- subtract background from GBM PHA-I file
- grppha, grpph2
- rebin the background subtracted data
45Difference
- Example Simulated GRB911016
Statistic Powerlaw 1 (1.42) Powerlaw 2 (2.1)
Unbinned c2 1.48 /- 0.02 2.4 /- 0.2
Binned c2 1.44 /- 0.02 2.3 /- 0.2
C 1.42 /- 0.01 2.2 /- 0.1
46The End
Basic research is what I am doing when I dont
know what I am doing
- Wernher von Braun