32
Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung Yu (MPE) for the Fermi GBM team 4 th FAN Workshop, University of Hong Kong, Hong Kong (12 July 2013)

Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Embed Size (px)

Citation preview

Page 1: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM)

Hoi-Fung Yu (MPE)for the Fermi GBM team

4th FAN Workshop, University of Hong Kong, Hong Kong (12 July 2013)

Page 2: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Contents

• Basic facts of the Fermi GBM

• GBM data types

• Analysis tool: RMFIT

• Retrieving GBM data

• Spectral analysis using RMFIT

Page 3: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

What is Fermi GBM?• Fermi GBM is a joint project of MPE and UAH

• Joint analysis of spectra and time histories of Gamma-ray Bursts (GRBs) observed by both the GBM and LAT (Meegan et al. 2009)

• Provide near-real time burst locations onboard to permit repointing of the spacecraft to obtain LAT observations of delayed emission from bursts, and to disseminate burst locations rapidly to the community of ground-based observers

• 12 thallium activated sodium iodide, NaI(Tl), scintillation detectors and 2 bismuth germanate, BGO, scintillation detectors

• NaIs cover lower energy spectrum (~8 keV - ~1 MeV), BGOs cover higher energy spectrum (~200 keV - ~40 MeV)

• The axes of the NaI detectors are oriented such that the positions of GRBs can be derived from the measured relative counting rates, a technique previously employed by CGRO BATSE

Page 4: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

NaI detector (Meegan et al. 2009)

Locations and orientations of the GBM detectors (Meegan et al. 2009)

BGO detector (Meegan et al. 2009)

These detectors and the data read-out systems were actually built at MPE!

Page 5: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

GBM data types

• TTE (Time-tagged events): Event data. Individual photons (or count rates) with time tag and energy. 128 Energy channels (adjustable boundaries). Each row in event extension in the FITS file is a time and an energy channel.

• CSPEC: 4.096 s (nominal) and 1.024 s (during burst) temporal resolution, 128 energy channels (adjustable boundaries, same as TTE). Each row in spectrum extension in the FITS file is a 128 energy channel spectrum.

• CTIME: 0.256 s (nominal) and 64 ms (adjustable from 64 ms to 1.024 s during burst) temporal resolution, 8 energy channels (adjustable boundaries). Not suitable for spectroscopy.

Page 6: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Which data type should I use?• Look at the quicklook lightcurve to determine the

approximate duration of the burst.

• Spectral analysis:

• For short (~< few seconds) or highly structured events, choose TTE data. (TTE data has only time range from ~T0-25 s to ~T0+300 s, and is slower to process.

• For longer or less structured events, choose CSPEC data.

• PHA files from other experiments, e.g. Swift BAT, can also be analyzed using RMFIT, providing they have a single associated response file, and conform to standard FITS format. BAT files are single PHA files, i.e. one spectrum per file. CSPEC/CTIME files are PHA2 files, i.e. multiple spectra per file, each spectrum belonging to a time bin.

Page 7: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

• Naming convention of GRB: GRB yymmddX

• If there is IPN/Swift detection, X = A, B, C...

• For GBM detection only, X is a three digit number

• For each GRB, at the FSSC you can find...

• 14 TTE files (per each version, e.g. glg_tte_b0_bnyymmddxxx_v01.fit) [FIT]

• 14 CSPEC files (per each version, e.g. glg_cspec_b0_bnyymmddxxx_v01.pha) [PHA]

• 14 CTIME files (per each version, e.g. glg_ctime_b0_bnyymmddxxx_v01.pha) [PHA]

• 1 Trigdat file (e.g. glg_trigdat_all_bn130601547_v02.fit) for burst localization

• Various GIF and PDF files for quicklook to the lightcurves

• and TCAT files for internal use of burst information

Page 8: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Analysis tool: RMFIT version 4.3.2(should have installed before this tutorial!)

• Operating system: Mac OS X (10.6 or newer), Linux

• Supporting softwares: IDL 8.1 (virtual machine) [Good news: this is a self-contained distribution, no external library is needed!]

• Download the RMFIT package (version 4.3.2) and the installation instructions at the FSSC user contribution page: http://fermi.gsfc.nasa.gov/ssc/data/analysis/rmfit/

• Choose The Mac OS X Package if you are using OS X

• Choose The Linux Distribution if you are using Linux

• Extract the tarball and follow the installation instructions

• To run RMFIT do one of the following options:

• Double click the rmfit432.command file in /Applications/rmfit_v432/

• At a terminal prompt cd into the rmfit_v432 directory and type ./rmfit432.command

• Create an alias: alias rmfit=$directory_to_file/rmfit432.command. Then at the command prompt type rmfit. Put this inside your .bashrc to use from all terminals.

• You cannot use idl -vm to call RMFIT. You must use one of the two options above. The IDL virtual machine included in this install can only be accessed by RMFIT through the rmfit432.command file. If RMFIT will not run make sure you have X11 installed.

Page 9: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Retrieving GBM data• Directly by FTP at: http://heasarc.gsfc.nasa.gov/FTP/fermi/data/gbm/triggers if you know the full name

of the burst e.g. 080916009. Look for the files you want under the “current” directory for the burst.

• Using the FSSC interface: http://fermi.gsfc.nasa.gov/ssc/data/access/ under “GBM Burst Catalog”. You will see a page with explanations about GBM data. Click the “Browse this Table” at the top left-hand corner. Search for your burst by entering “GRB080916*” under the “name” field in the table. Select your burst from the returned triggers using your knowledge of the trigger time. “Preview and Retrieve” will allow you to generate the directory listing the available data files for this burst, or you can just retrieve the whole available data package in a tar file.

• CSPEC (CTIME) files are “glg_cspec_nx_bn080916009_v0y.pha” (“glg_ctime_nx_bn080916009_v0y.pha”) where x is the NaI detector number 0-9, a, b or “glg_cspec_bx_bn080916009_v0y.pha” (“glg_ctime_bx_bn080916009_v0y.pha”) with x =0 or 1. Choose b0 if you have low-numbered NaI, b1 for NaI with x>5. If you have a mixture, select both BGOs and choose better one after looking at data.

• TTE files are “glg_tte_nx_bn080916009_v0y.fit” or “glg_ctime_bx_bn080916009_v0y.pha”)...

• In either case, you will need a detector response file for each detector you are analyzing “glg_cspec_nx_bn080916009_v0y.rsp” or “glg_cspec_bx_bn080916009_v0y.rsp”. CSPEC response files apply to both CSPEC and TTE data files: the number of energy channels is 128 for both.

• Quicklook lightcurves are called glg_lc_all_bn080916009.gif

• The version number v0y is unimportant and can be different for each file type.

From the spectroscopy tutorial: http://fermi.gsfc.nasa.gov/ssc/data/analysis/user/vc_rmfit_tutorial.pdf (RMFIT team, April 2010)

Page 10: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Spectral analysisI will use a recent burst GRB 130305A (130305486) as an example (a Fermi and Swift detected burst):http://fermi.gsfc.nasa.gov/ssc/data/access/

Page 11: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

GBM Products

Page 12: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

1. Choose the brightest 3-4 NaIs, and also the suitable BGO. Usually the triggered NaIs are bright. Use the blocked BGO.

Page 13: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

2. Open RMFIT, then load all the desired CSPEC files [PHA].

Page 14: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

You can toggle to switch between the lightcurve and energy channel display windows.

You can rebin according to temporal resolution (must be integer multiple of the finest bin) or S/N ratio, or click “Rebin: Full Resolution” to return to full resolution.

3. Zoom to around the trigger time. (You can do this just once and then load the lookup files to all other detectors!)

Page 15: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

4. Click on the right-most region to delete the current selection or click on “EXIT” at the bottom-left corner of the display window to confirm selection.

For NaIs, usually we use ~8-900 keV. Avoid the overflow channels.

3. Toggle to the energy channels display, click “Select Source: Source Interactive” in order to select usable energy ranges.

Page 16: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

5. In the lightcurve display, click “Fit Background” and then select the background intervals before and after the burst.

6. Click on the right-most region to delete the current selection or click on “EXIT” at the bottom-left corner of the display window to confirm selection.

7. Choose the order of polynomial used to fit the background intervals (RMFIT will then extrapolate the fit into the burst region).

8. Look at the reduced Chi2 values for each energy channel, they should be all around the value 1. Click “Dismiss” to return to the lightcurve display.

Page 17: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

9. Zoom closer to the burst to check whether the fitted background (blue dotted line) is reasonable. If not, repeat the background fitting process by selecting another pair of intervals.

10. Click “Select Source: Source Interactive” to select the source interval. Click “Exit” to confirm or the right-most region to cancel selection. In this tutorial I just choose a ~15 s interval containing the brightest part of the burst.

Important: The source interval interval must not intercept with the background intervals!

Page 18: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

You can also toggle to the energy channel display to see the fitted background rates for each energy channel (remember the energy channel display reveals mainly the effective area effect).

RMFIT will display the selected energy range at the upper-right corner, and the bottom, and the source time interval at the bottom.

Page 19: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

11. Click “File” and then “Lookup -> Save Lookup” to save the current binning, zooming, background and source selections.

The lookup file will be saved with the same name as your current CSPEC/TTE file with extension “.lu”. You can also choose your desired name for it.

Page 20: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

12. Read the lookup file to every other detectors.

For consistency you should always use the same lookup file for all detectors!

Page 21: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

13. For the BGO, the energy selection will be wrong. Toggle to the energy channels display and click “Zoom: Zoom Out: Full Range” to view the full energy range.

Avoid energy ~< 200 keV and the overflow channel. In this tutorial I use ~240 keV to ~40 MeV.

Page 22: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

14. From one of the detector windows, select “Spectral Fitting: Fit Selections”. This produces a fit of the entire source interval (which you selected) with some model you will choose.

You will be prompted for the detector response file, one per detector. Select and click “Ok”. You will be asked which detectors to include in the fit. Press “Accept” to select all of them. This will cause the fit to occur jointly over all the detectors, i.e. your fitting statistic will be optimized using information from all detectors.

Page 23: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

15. You have many models to choose from. If you click “Restore” you will get even more models which are not offered by default. Clicking a model selects it. Select “C-Stat” to use the Cash-Castor statistics (Cash 1979) instead of the Chi2 statistics, since for GBM data the background should be Poissionian. Combined models can be used by clicking individual model when holding the <ctrl> key. Clicking “Accept” will then fit the data. If you chose “Set parameters” the RMFIT will prompt you a window to initialize the parameters before starting the fit.

We will fit models 1, 7, & 5, i.e. Power-law (Pl), Comptonized (Comp), & the famous Band’s GRB function (Band Function, Band 1993) in this tutorial:

Note that the Band Function reduces to the Comptonized model when the high-energy power-law index goes to -ve infinity.

Page 24: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Points are the NaIs and BGO data rates blue curve is the model rates (expected rate convolved to the DRMs assuming the model is “correct”)

“Zoom” let you zoom the plots“Fit Results” let you write fit results to file“Redo Last Fit” let you redo the fit, you can also change the photon model(s)You can control the fitting process in “Spectral Fitting”, e.g. setting the error interval“Fit Display Options” let you convert the plot to different space, e.g. photon counts, energy, vFv etc.

Page 25: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

C-Stat [-2log(likelihood)] cannot be used to estimate goodness of fit, only compared to C-Stat for other (nested) models.

Look at the Fit Log and the residuals to decide if the fit is a good fit or not.

Fitting a power-law model:

Page 26: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Fitting a Comptonized model:

Residuals reduced, C-Stat is much less (for 1 more parameter), i.e. a better model (higher probability to produce the observed spectrum)

Page 27: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Fitting a Band model:

Similar residuals, C-Stat is ~40 less, (for 1 more parameter) i.e. best among the 3 models

Page 28: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

To show more clearly the fitted model and the data rates, you can rebin the spectrum by combining spectral bins (usually do for the BGO since most of the data points are upper-limits)

After rebinning, click “Spectral Fitting: Fit Selections” instead of “Redo Last Fit” since you have already changed the input data.

Page 29: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

Comparing to the Band model, you can see that the Comp model has too-deep decay at >1 MeV range. [Note that both the data and the model binnings changed]

Page 30: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

If there is any normalization issues, use the “Effective Area Correction” together with the chosen model. Select “Redo Last Fit” and hold <ctrl> key to select from the model window, in addition to option “5”, option “40”. Click “Set Parameters” to choose which detector areas to vary. Click “Accept” to redo the fit.

Page 31: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

With much worse likelihood, and 4 extra parameters, this does not seem to be a necessary addition to the model. These corrections are for NaIs relative to BGO.

Page 32: Data Analysis Tutorial for the Fermi Gamma-ray Burst …astro/FAN4/Presentation/Yu_Davi… ·  · 2013-07-12Data Analysis Tutorial for the Fermi Gamma-ray Burst Monitor (GBM) Hoi-Fung

You have already gone through the basic analysis procedures using RMFIT and can now play around with the data! For long and bright bursts, you can try to do time-integrated and time-resolved spectral analysis. Work hard and have fun with GRBs!

More details about the usage of RMFIT can be found at the FSSC’s RMFIT Tutorial:http://fermi.gsfc.nasa.gov/ssc/data/analysis/rmfit/

You may also have a look at more GRB spectral fitting papers from the Fermi GBM team:Time-integrated spectral catalogs: Goldstein et al. 2012, Gruber et al. 2013 (in prep.)Time-resolved spectral analysis: Burgess et al. 2013 (in prep.), Yu et al. 2013 (in prep.)