1 / 43

GRB tutorial

GRB tutorial. Spectral analysis of the LAT and GBM data. All the software you need. https://confluence.slac.stanford.edu/display/DC2/DC2+code+releases. The tools I used. gtselect Select the ROI containing the bursts, in time, ra and dec gtbin

overton
Télécharger la présentation

GRB tutorial

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GRB tutorial Spectral analysis of the LAT and GBM data

  2. All the software you need https://confluence.slac.stanford.edu/display/DC2/DC2+code+releases

  3. The tools I used • gtselect • Select the ROI containing the bursts, in time, ra and dec • gtbin • Bin the LAT data in time -> obtain the light curve • Bin the LAT data in RA,DEC ->Obtaining a count map • Bin the GBM and LAT data in energy -> obtaining a spectrum PHA1 files • Bin the GBM and LAT data in time and energy->PHA2 files • gtrspgen • Compute the response for the LAT • gtlikelihood • Unbinned spectral analysis • DataServer • Hyppodraw, fv, ds9 • visualization of LC and CMAP • Python as scripting tool • Xspec for performing the spectral analysis

  4. Getting the data at http://glast.gsfc.nasa.gov/ssc/dev/databases/DC2/

  5. The files you need: • LAT livetime history (DC2_FT2.fits) • ftp://heasarc.gsfc.nasa.gov/FTP/glast/DC2/misc_data/DC2_FT2.fits • LAT photon data (all sky, first week):(LAT_allsky_220838401.126_V01.fits) • ftp://heasarc.gsfc.nasa.gov/FTP/glast/DC2/allsky/LAT_allsky_220838401.126_V01.fits • GRB080104514 GBM files: • ftp://heasarc.gsfc.nasa.gov/FTP/glast/DC2/burst/GRB080104514.tar.gz

  6. Un-packaging the GBM files dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ l -rw-r--r-- 1 omodei omodei 23040 Feb 23 08:55 GLG_BCK_B0_BN080104514_V01.BAK … -rw-r--r-- 1 omodei omodei 106560 Feb 23 08:55 GLG_CSPEC_B0_BN080104514_V01.RSP … -rw-r--r-- 1 omodei omodei 1900800 Feb 23 08:55 GLG_CTIME_B0_BN080104514_V01.FIT … -rw-r--r-- 1 omodei omodei 20275200 Feb 23 08:42 GLG_CTIME_N0_080104514_V01.FIT … -rw-r--r-- 1 omodei omodei 591 Feb 23 08:52 GLG_NOTICE_080104514.TXT -rw-r--r-- 1 omodei omodei 380160 Feb 23 08:55 GLG_TTE_B0_BN080104514_V01.FIT -rw-r--r-- 1 omodei omodei 377280 Feb 23 08:55 GLG_TTE_B1_BN080104514_V01.FIT -rw-r--r-- 1 omodei omodei 164160 Feb 23 08:52 GLG_TTE_N0_BN080104514_V01.FIT -rw-r--r-- 1 omodei omodei 161280 Feb 23 08:52 GLG_TTE_N1_BN080104514_V01.FIT -rw-r--r-- 1 omodei omodei 141120 Feb 23 08:52 GLG_TTE_N2_BN080104514_V01.FIT -rw-r--r-- 1 omodei omodei 146880 Feb 23 08:52 GLG_TTE_N3_BN080104514_V01.FIT -rw-r--r-- 1 omodei omodei 161280 Feb 23 08:52 GLG_TTE_N6_BN080104514_V01.FIT -rw-r--r-- 1 omodei omodei 129600 Feb 23 08:52 GLG_TTE_N7_BN080104514_V01.FIT -rw-r--r-- 1 omodei omodei 158400 Feb 23 08:52 GLG_TTE_N9_BN080104514_V01.FIT -rw-r--r-- 1 omodei omodei 135360 Feb 23 08:52 GLG_TTE_NB_BN080104514_V01.FIT

  7. GCN-like notices: GLG_NOTICE_080104514.TXT GLAST BURST MONITOR BURST NOTIFICATION ************************************** BURST Name = GRB080104514 BURST Date = 080104 BURST Time (Sec of Day) = 44414.0 BURST RA (Deg) = 59.3413 BURST DEC (Deg) = 14.3453 BURST LOC ERR (Deg 1 sigma) = 2.29264 Standard Intensity (cts/sec) = 697.885 (Standard Intensity is an angle-adjusted measure of the peak count rates in 2 NaI detectors closest t o the source) Closest detectors = N0 N6 B0 • In DC2 we know (approximately) the position of the burst (GLG_NOTICE) • GRB can be displaced statistically and systematically…

  8. Quick look at the data: hippodraw Open the LAT_allsky_220838401.126_V01.fits Select EVENT extension Do a color plot RA vs DEC Set the axis bin width as you prefer (1 deg in the fig.)

  9. Add a cut on TIME, reset the bin width (axis)…

  10. Ra ~57 Dec ~14 Tmin : 221142007 Tmax: 221142060

  11. GBM and LAT light curve • Lightcurves curves at LAT energy and GBM energy are different, as predicted from the model • This imply a spectral evolution!

  12. Trick 2: open the header file of the TTE data!

  13. 1. Selecting the data dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ gtselect Input FT1 file [] : ../DC2/LAT_allsky_220838401.126_V01.fits Output FT1 file [] : GRB080104514_select.fits RA for new search center (degrees) <0 - 360> [] : 59.34 Dec for new search center (degrees) <-90 - 90> [] : 14.35 radius of new search region (degrees) <0 - 180> [] : 20 start time (MET in s) [] : 221142007 end time (MET in s) [] : 221142060 lower energy limit (MeV) [30] : upper energy limit (MeV) [300000] : Event classes (-1=all, 0=FrontA, 1=BackA, 2=FrontB, 3=BackB, 4=class A) <-1 - 4> [-1] : There was a bug (in ST v6r4p1) related to insufficient precision of MET. (Resulting in empty files) Resolved in dataSubselector version v4r1p5 Alternatively…

  14. It is useful to rename the file! (GRB080104514_select.fits)

  15. 2. Binning the LAT data in spatial coordinates CMAP dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ gtbin This is gtbin version v0r16p3 Type of output file <CMAP|LC|PHA1|PHA2> [] : CMAP Event data file name [] : GRB080104514_select.fits Output file name [] : GRB080104514_lat.cmap Spacecraft data file name[] : ../DC2/DC2_FT2.fits Size of the X axis in pixels [] : 360 Size of the Y axis in pixels [] : 180 Image scale (in degrees/pixel) [1] : Coordinate system (CEL - celestial, GAL -galactic) <CEL|GAL> [GAL] : First coordinate of image center in degrees (RA or galactic l) [0] : Second coordinate of image center in degrees (DEC or galactic b) [0] : Rotation angle of image axis, in degrees [0] : ds9 -bin factor 0.5 0.5 -cmap b -scale sqrt "GRB080104514_select.fits[bin=RA,DEC]"

  16. 3. Binning the LAT data in time Obtaining the LAT light curve dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ gtbin This is gtbin version v0r16p3 Type of output file <CMAP|LC|PHA1|PHA2> [PHA1] : LC Event data file name [] : GRB080104514_select.fits Output file name [] : GRB080104514_lat.lc Spacecraft data file name[] : ../DC2/DC2_FT2.fits Algorithm for defining time bins <FILE|LIN|SNR> [LIN] : Start value for first time bin [] : 221142007 Stop value for last time bin [] : 221142060 Width of linearly uniform time bins [] : 0.1

  17. 3. Binning the LAT data in energy dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ gtbin This is gtbin version v0r16p3 Type of output file <CMAP|LC|PHA1|PHA2> [PHA1] : Event data file name [GRB080104514_select.fits] : Output file name [] : GRB080104514_lat.pha Spacecraft data file name [../DC2/DC2_FT2.fits] : Algorithm for defining energy bins <FILE|LIN|LOG> [LIN] : LOG Start value for first energy bin [30] : Stop value for last energy bin [300000] : Number of logarithmically uniform energy bins [15] : Obtaining a spectrum (PHA1) file gtbin evfile=GRB080104514_select.fits scfile=../DC2/DC2_FT2.fits outfile=GRB080104514_lat.pha algorithm=PHA1 energybinalg=LOG emin=30 emax=300000 enumbins=15 This is gtbin version v0r16p3 Done!

  18. 4. Binning the GBM data in energy dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ gtbin This is gtbin version v0r16p3 Type of output file <CMAP|LC|PHA1|PHA2> [PHA1] : Event data file name [] : GLG_TTE_N0_BN080104514_V01.FIT Output file name [] : GRB080104514_N0.pha Spacecraft data file name [NONE] : This has to be done for each bright detectors in the GBM: <12 NaI, <2 BGO. Notice: in DC2 one can use all the GBM detectors due to the fact that the background used to build the data is the same of the .bak files. In reality things are different!

  19. Compute the response function for the LAT dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ gtrspgen This is gtrspgen version v1r2 Response calculation method (GRB, PS) <GRB|PS> [GRB] : Spectrum file name [] : GRB080104514_lat.pha Spacecraft data file name [] : ../DC2/DC2_FT2.fits Output file name [] : GRB080104514_lat.rsp Time of GRB (s) [] : 221142007 Response function to use, e.g. DC1F/DC1B, G25F/G25B, TestF/TestB [DC2] : Algorithm for defining true energy bins <FILE|LIN|LOG> [] : LOG Start value for first energy bin [30] : Stop value for last energy bin [300000] : Number of logarithmically uniform energy bins [100] : ! I renamed GBM files to match my “convention” GRBYYMMDDFFF_det.* GLG_CSPEC_B0_BN080104514_V01.RSP =>GRB080104514_B0.rsp GLG_CSPEC_B1_BN080104514_V01.RSP => GRB080104514_B1.rsp GLG_CSPEC_N0_BN080104514_V01.RSP => GRB080104514_N0.rsp GLG_CSPEC_N1_BN080104514_V01.RSP => GRB080104514_N1.rsp GLG_CSPEC_N2_BN080104514_V01.RSP => GRB080104514_N2.rsp GLG_CSPEC_N3_BN080104514_V01.RSP => GRB080104514_N3.rsp GLG_CSPEC_N6_BN080104514_V01.RSP => GRB080104514_N6.rsp GLG_CSPEC_N7_BN080104514_V01.RSP => GRB080104514_N7.rsp GLG_CSPEC_N9_BN080104514_V01.RSP => GRB080104514_N9.rsp GLG_CSPEC_NB_BN080104514_V01.RSP => GRB080104514_NB.rsp

  20. Everything is here: ~/GLAST/GRB080104514 omodei$ l *pha GRB080104514_B0.pha GRB080104514_B1.pha GRB080104514_N0.pha GRB080104514_N1.pha GRB080104514_N2.pha GRB080104514_N3.pha GRB080104514_N6.pha GRB080104514_N7.pha GRB080104514_N9.pha GRB080104514_NB.pha GRB080104514_lat.pha ~/GLAST/GRB080104514 omodei$ l *rsp GRB080104514_B0.rsp GRB080104514_B1.rsp GRB080104514_N0.rsp GRB080104514_N1.rsp GRB080104514_N2.rsp GRB080104514_N3.rsp GRB080104514_N6.rsp GRB080104514_N7.rsp GRB080104514_N9.rsp GRB080104514_NB.rsp GRB080104514_lat.rsp ~/GLAST/GRB080104514 omodei$ l *bak GRB080104514_B0.bak GRB080104514_B1.bak GRB080104514_N0.bak GRB080104514_N1.bak GRB080104514_N2.bak GRB080104514_N3.bak GRB080104514_N6.bak GRB080104514_N7.bak GRB080104514_N9.bak GRB080104514_NB.bak Notice: no background for the LAT

  21. Running XSPEC dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ xspec XSPEC version: 12.2.1 Build Date/Time: Tue Nov 22 20:13:51 2005 !XSPEC12>cpd /xw; !XSPEC12>data GRB080104514_N0.pha, GRB080104514_N6.pha, GRB080104514_B0.pha, GRB080104514_LAT.pha !XSPEC12>response GRB080104514_N0.rsp, GRB080104514_N6.rsp, GRB080104514_B0.rsp, GRB080104514_LAT.rsp !XSPEC12>backgrnd GRB080104514_N0.bak, GRB080104514_N6.bak ,GRB080104514_B0.bak Net count rate (cts/s) for Spectrum:1 9.929e+01 +/- 4.590e+00 (30.7 % total ) Net count rate (cts/s) for Spectrum:2 9.090e+01 +/- 4.570e+00 (28.8 % total ) Net count rate (cts/s) for Spectrum:3 7.422e+01 +/- 7.881e+00 (9.4 % total ) !XSPEC12>setplot energy; !XSPEC12>ignore 1:1000.0-**; !XSPEC12>ignore 2:1000.0-**; !XSPEC12>ignore 3:**-150.0; !XSPEC12>ignore 3:3e4-**; !XSPEC12>setplot rebin 5 5 1 ; !XSPEC12>setplot rebin 5 5 2 ; !XSPEC12>setplot rebin 3 10 3; !XSPEC12>setplot rebin 1 1 4; !XSPEC12>model grbm Input parameter value, delta, min, bot, top, and max values for ... -1 0.01 -10 -3 2 5 grbm:alpha> -2 0.01 -10 -5 2 10 grbm:beta> 300 10 10 50 1000 10000 grbm:tem> 1 0.01 0 0 1e+24 1e+24 grbm:norm> !XSPEC12>renorm !XSPEC12>fit !XSPEC12>plot ldata NaI < 1 MeV 150 keV < BGO< 30MeV

  22. The result (2NaI, 1BGO + LAT) ======================================================================== Model grbm<1> Source No.: 1 Active/On Model Model Component Parameter Unit Value par comp 1 1 grbm alpha -1.15569 +/- 9.78069E-02 2 1 grbm beta -1.94431 +/- 1.81158E-02 3 1 grbm tem keV 278.690 +/- 102.841 4 1 grbm norm 2.82605E-03 +/- 7.12606E-04 ________________________________________________________________________ Chi-Squared = 118.35 using 344 PHA bins. Reduced chi-squared = 0.34808 for 340 degrees of freedom Null hypothesis probability = 1.000000e+00

  23. With all the detectors (8NaI, 1BGO + LAT) ======================================================================== Model grbm<1> Source No.: 1 Active/On Model Model Component Parameter Unit Value par comp 1 1 grbm alpha -1.18380 +/- 5.99816E-02 2 1 grbm beta -1.95094 +/- 1.71234E-02 3 1 grbm tem keV 336.394 +/- 85.1461 4 1 grbm norm 2.64184E-03 +/- 3.97155E-04 ________________________________________________________________________ Chi-Squared = 327.69 using 980 PHA bins. Reduced chi-squared = 0.33575 for 976 degrees of freedom Null hypothesis probability = 1.000000e+00

  24. Scripting xspec set PREFIX GRB set GRBNAME 080104514 set GRBNAME $PREFIX$GRBNAME echo $GRBNAME cpd /xw dat ${GRBNAME}_N0.pha, ${GRBNAME}_N6.pha, ${GRBNAME}_B0.pha, ${GRBNAME}_LAT.pha; respon ${GRBNAME}_N0.rsp, ${GRBNAME}_N6.rsp, ${GRBNAME}_B0.rsp, ${GRBNAME}_LAT.rsp; back ${GRBNAME}_N0.bak, ${GRBNAME}_N6.bak ,${GRBNAME}_B0.bak; setplot energy; ignore 1:1000.0-** ignore 2:1000.0-** ignore 3:**-150.0 ignore 3:3e4-** #ignore 8:**-3e4 setplot rebin 5 5 1 setplot rebin 5 5 2 setplot rebin 3 10 3 setplot rebin 1 1 4 mod grbm; renorm fit plot ldata;

  25. Time resolved temporal analysis 1 2 3 4

  26. Creating Pha2 files… dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ gtbin This is gtbin version v0r16p3 Type of output file <CMAP|LC|PHA1|PHA2> [] : PHA2 Event data file name [GRB080104514_select.fits] : Output file name [] : GRB080104514_lat.pha2 Spacecraft data file name [NONE] : Algorithm for defining energy bins <FILE|LIN|LOG> [LOG] : Start value for first energy bin [30] : Stop value for last energy bin [300000] : Number of logarithmically uniform energy bins [15] : Algorithm for defining time bins <FILE|LIN|SNR> [] : FILE Name of the file containing the time bin definition [] : timebins.fits dhcpvisitor216193:~/GLAST/GRB080104514 omodei$ gtbin This is gtbin version v0r16p3 Type of output file <CMAP|LC|PHA1|PHA2> [PHA2] : Event data file name [] : GLG_TTE_B1_BN080104514_V01.FIT Output file name [] : GRB080104514_B1.pha2 Spacecraft data file name [NONE] : Algorithm for defining time bins <FILE|LIN|SNR> [FILE] : Name of the file containing the time bin definition [timebins.fits] : LAT All the GBM detectors I want to analyze … … …

  27. 1 1 grbm alpha -0.310013 +/- 3.05915 2 1 grbm beta -1.78821 +/- 0.199308 3 1 grbm tem keV 401.832 +/- 1855.11 4 1 grbm norm 9.98445E-05 +/- 3.09719E-04

  28. 1 1 grbm alpha -1.18084 +/- 8.50302E-02 2 1 grbm beta -2.04713 +/- 5.02809E-02 3 1 grbm tem keV 267.715 +/- 84.8468 4 1 grbm norm 6.20244E-03 +/- 1.11782E-03

  29. 1 1 grbm alpha -1.19528 +/- 0.118542 2 1 grbm beta -1.84633 +/- 3.91127E-02 3 1 grbm tem keV 719.387 +/- 516.844 4 1 grbm norm 2.63532E-03 +/- 6.82597E-04

  30. 1 1 grbm alpha -1.49635 +/- 1.08452 2 1 grbm beta -1.88247 +/- 6.95778E-02 3 1 grbm tem keV 115.413 +/- 579.045 4 1 grbm norm 1.77894E-03 +/- 8.21310E-03

  31. Conclusions Have fun !!

  32. hcpvisitor216193:~/GLAST/GRB080104514 omodei$ gtlikelihood Statistic to use <BINNED|UNBINNED> [UNBINNED] : Spacecraft file [../DC2/DC2_FT2.fits] : Event file [GRB080104514_select.fits] : Unbinned exposure map [none] : Exposure hypercube file [none] : Source model file [myGRBmod.xml] : Response functions to use [DC2] : Optimizer <LBFGS|MINUIT|DRMNGB> [DRMNGB] : Computing exposure at (57, 14).....................! myGRB: Prefactor: 4910.05 +/- 575.129 Index: -2.06767 +/- 0.0766657 Scale: 100 Npred: 107.941 ROI distance: 0 TS value: -1243.53 Total number of observed counts: 108 Total number of model events: 107.941 -log(Likelihood): 621.763403 Elapsed CPU time: 0.001338

  33. Scripts: Pythontcl

  34. Trick 1: How to get MET out of a GLG_NOOTICE import time import datetime refdate=datetime.date(2001, 1, 1) grbdate=datetime.date(2008, 1, 4) tstart=(grbdate - refdate).days*86400+44414.0 print ‘Burst Time in MET is:’,tstart Burst Time in MET is: 221142014.0 Many other tools can do this, even excel… But, the triggertime in the notice is not the Montecarlo starting time of the burst…

  35. Python… running the ScienceTools import os import time import datetime refdate=datetime.date(2001, 1, 1) grbnumber="080104514" grbprefix="GRB" infile="../DC2/LAT_allsky_220838401.126_V01.fits" scfile="../DC2/DC2_FT2.fits" grbdate=datetime.date(2008, 1, 4) tstart=(grbdate - refdate).days*86400+44414.0 tmin=str(tstart-5) tmax=str(tstar+60) deltatime=".1" ra="57" dec="14" rad="15" emin="30" emax="300000" enumbins="15" eventClass="-1"

  36. …again python… select=0 lc=1 cmap=1 pha=1 pha2=1 rsp=1 gbm=1 gbm2=1 grbname=grbprefix+grbnumber; grbfile=grbname+"_select.fits" lat_lc=grbname+"_lat.lc" lat_cmap=grbname+"_lat.cmap" lat_pha=grbname+"_lat.pha" lat_pha2=grbname+"_lat.pha2" lat_rsp=grbname+"_lat.rsp" timebinfile="timebins.fits" numxpix="360" numypix="180" pixscale="1" coordsys="GAL" Flags to decide the steps to do… …my naming convention…

  37. …be patient… if select: cmd="gtselect infile="+infile+" outfile="+grbfile+" ra="+ra+" dec="+dec+" rad="+rad+" tmin="+tmin+" tmax="+tmax+" emin="+emin+" emax="+emax+" eventClass="+eventClass print cmd os.system(cmd) if lc: cmd="gtbin evfile="+grbfile+" scfile="+scfile+" outfile="+lat_lc+" algorithm=LC timebinalg=LIN"+" tstart="+tmin+" tstop="+tmax+" deltatime="+deltatime+" energybinalg=LOG" print cmd os.system(cmd) if cmap: cmd="gtbin evfile="+grbfile+" scfile="+scfile+" outfile="+lat_cmap+" algorithm=CMAP numxpix=360 numypix=180 pixscale=1 coordsys="+coordsys+" xref=0 yref=0 axisrot=0" print cmd os.system(cmd) if pha: cmd="gtbin evfile="+grbfile+" scfile="+scfile+" outfile="+lat_pha+" algorithm=PHA1 energybinalg=LOG"+" emin="+emin+" emax="+emax+" enumbins="+enumbins print cmd os.system(cmd) if pha2: cmd="gtbin evfile="+grbfile+" scfile="+scfile+" outfile="+lat_pha2+" algorithm=PHA2 energybinalg=LOG"+" emin="+emin+" emax="+emax+" enumbins="+enumbins+" timebinalg=FILE timebinfile="+timebinfile print cmd os.system(cmd) if rsp: cmd="gtrspgen respalg=GRB specfile="+lat_pha+" scfile="+scfile+" outfile="+lat_rsp+" time="+tmin+" resptype=DC2"+" energybinalg=LOG"+" emin="+emin+" emax="+emax+" enumbins=100" os.system(cmd)

  38. …done! if gbm: detectorList=["N0","N1","N2","N3","N4","N5","N6","N7","N8","N9","NA","NB","B0","B1"] for det in detectorList: gbm_file_in="GLG_TTE_"+det+"_BN"+grbnumber+"_V01.FIT" gbm_file_out=grbname+"_"+det+".pha" cmd="gtbin evfile="+gbm_file_in+" scfile=NONE outfile="+gbm_file_out+" PHA1" os.system(cmd) cmd="cp GLG_CSPEC_"+det+"_BN"+grbnumber+"_V01.RSP "+grbname+"_"+det+".rsp" os.system(cmd) cmd="cp GLG_BCK_"+det+"_BN"+grbnumber+"_V01.BAK "+grbname+"_"+det+".bak" os.system(cmd) if gbm2: for det in detectorList: gbm_file_in="GLG_TTE_"+det+"_BN"+grbnumber+"_V01.FIT" gbm_file_out=grbname+"_"+det+".pha2" cmd="gtbin evfile="+gbm_file_in+" scfile=NONE outfile="+gbm_file_out+" PHA2 timebinalg=FILE timebinfile="+timebinfile os.system(cmd) print "Done!"

  39. PlotWithHippo import sys import os import hippo import hippoplotter as plot from hippo import FitsController from hippo import Display def CM(grbnumber): my_file='GRB'+grbnumber+'_lat.cmap' import hippoplotter as plot plot.fitsImage(my_file, zlog=1, aspect=2) def LAT_SELECTION(grbnumber): my_file='GRB'+grbnumber+'_select.fits' ntc = FitsController.instance() hdus = ntc.getNTupleNames(my_file) events = ntc.createNTuple ( my_file, hdus[1] ) lc=plot.Histogram(events,'TIME') lc.setBinWidth('x',.1) sm = plot.XYHist(events,'RA','DEC') sm.setBinWidth ( 'x', .5 ) sm.setBinWidth ( 'y', .5 ) str = raw_input("Type return to quit. ") def LAT_LC(grbnumber): my_file='GRB'+grbnumber+'_lat.lc' ntc = FitsController.instance() hdus = ntc.getNTupleNames(my_file) events = ntc.createNTuple ( my_file, hdus[1] ) plot.Scatter(events,'TIME','COUNTS',pointRep='Line') str = raw_input("Type return to quit. ")

  40. PlotWithHippo def LAT_GBM_LC(grbnumber): lc=range(15) events=range(15) ntc = FitsController.instance() lat_file='GRB'+grbnumber+'_select.fits' hdus = ntc.getNTupleNames(lat_file) events[0]= ntc.createNTuple ( lat_file, hdus[1] ) lc[0]=plot.Histogram(events[0],'TIME') lc[0].setBinWidth('x',.1) detectorList=["N0","N1","N2","N3","N4","N5","N6","N7","N8","N9","NA","NB","B0","B1"] i=0 for det in detectorList: i=i+1 gbm_file = "GLG_TTE_"+det+"_BN"+grbnumber+"_V01.FIT" if os.path.exists(gbm_file): print "file "+gbm_file+" exists:" hdus = ntc.getNTupleNames(gbm_file) events[i] = ntc.createNTuple ( gbm_file, hdus[2] ) lc[i] = plot.Histogram(events[i],'TIME') lc[i].setBinWidth ( 'x', .1 ) lc[i].setTitle(det) tstart=lc[1].getRange('x')[0]+5 tend=lc[1].getRange('x')[1]-5 print 'Tstart=',tstart,', Tend=',tend i=0 lc[i].setRange('x',tstart,tend) for det in detectorList: i=i+1 gbm_file = "GLG_TTE_"+det+"_BN"+grbnumber+"_V01.FIT" if os.path.exists(gbm_file): lc[i].setRange('x',tstart,tend) str = raw_input("Type return to quit/continue. ")

More Related