Analysis of GRB 190114C with Fermi-LAT

[1]:
import matplotlib.pyplot as plt

import numpy as np
import scipy as sp

np.seterr(all="ignore")

from threeML import *
from threeML.io.package_data import get_path_of_data_file
from threeML.io import update_logging_level
from threeML.utils.data_download.Fermi_LAT.download_LAT_data import LAT_dataset
from astropy.io import fits as pyfits

SMALL_SIZE = 15
MEDIUM_SIZE = 15
BIGGER_SIZE = 20

plt.rc("font", size=SMALL_SIZE)  # controls default text sizes
plt.rc("axes", titlesize=SMALL_SIZE)  # fontsize of the axes title
plt.rc("axes", labelsize=MEDIUM_SIZE)  # fontsize of the x and y labels
plt.rc("xtick", labelsize=SMALL_SIZE)  # fontsize of the tick labels
plt.rc("ytick", labelsize=SMALL_SIZE)  # fontsize of the tick labels
plt.rc("legend", fontsize=SMALL_SIZE)  # legend fontsize
plt.rc("figure", titlesize=BIGGER_SIZE)  # fontsize of the figure title


# This if you want to toggle different type of logging level.
update_logging_level("INFO")
log.error("error")
log.info("info")
log.debug("debug")
00:10:31 WARNING   The naima package is not available. Models that depend on it will not be         functions.py:48
                  available                                                                                        
         WARNING   The GSL library or the pygsl wrapper cannot be loaded. Models that depend on it  functions.py:69
                  will not be available.                                                                           
00:10:32 WARNING   The ebltable package is not available. Models that depend on it will not be     absorption.py:33
                  available                                                                                        
00:10:33 ERROR     error                                                                           3699701126.py:29
00:10:34 INFO      info                                                                            3699701126.py:30

GtBurst

Gtburst contains all the classes and methods to perform Fermi LAT data. It internally uses the official fermitools software. Here an example to list the IRFS available:

[2]:
from GtBurst import IRFS

irfs = IRFS.IRFS.keys()
print(irfs)
odict_keys(['p7rep_transient', 'p7rep_source', 'p7rep_clean', 'p7rep_ultraclean', 'p8r2_transient100e', 'p8r2_transient100', 'p8r2_transient020e', 'p8r2_transient020', 'p8r2_transient010e', 'p8r2_transient010', 'p8r2_source', 'p8r2_clean', 'p8r2_ultraclean', 'p8r2_ultracleanveto', 'p8r2_transient100s', 'p8r2_transient015s', 'p8_transient100e', 'p8_transient100', 'p8_transient020e', 'p8_transient020', 'p8_transient010e', 'p8_transient010', 'p8_source', 'p8_clean', 'p8_ultraclean', 'p8_ultracleanveto', 'p8_sourceveto', 'p8_transient100s', 'p8_transient015s'])

The LAT Transient Builder

Let’s see how to make a plug in for the unbinned analysis of Fermi LAT data. First we use the information form a triggered GRB to obtain MET, RA and DEC, that are needed for the analysis.

[3]:
from GtBurst.TriggerSelector import TriggerSelector

myFavoriteGRB = "bn190114873"


def findGRB(grb_name):
    a = TriggerSelector()
    a.downloadList()
    myGRB = {}
    for x in a.data:
        if x[0] == myFavoriteGRB:
            myGRB["MET"] = float(x[1])
            myGRB["RA"] = float(x[3])
            myGRB["DEC"] = float(x[4])
            myGRB["ERR"] = float(x[5])
            return myGRB
            pass
    return None
[4]:
myGRB = findGRB(myFavoriteGRB)
print(myGRB)
{'MET': 569192227.626, 'RA': 54.51, 'DEC': -26.939, 'ERR': 0.05}

Then, we download LAT data and we build the transient builder, we want to analyze 1000 seconds since the trigger. Let’s start download the data:

[5]:
tstart = 0
tstop = 1000
[6]:
myLATdataset = LAT_dataset()

myLATdataset.make_LAT_dataset(
    ra=myGRB["RA"],
    dec=myGRB["DEC"],
    radius=12,
    trigger_time=myGRB["MET"],
    tstart=tstart,
    tstop=tstop,
    data_type="Extended",
    destination_directory=".",
    Emin=100.0,
    Emax=10000.0,
)  # Energies are MeV (this is from 100 MeV to 10 GeV)
00:10:49 INFO      Query parameters:                                                       download_LAT_data.py:262
         INFO                          coordfield = 54.5100,-26.9390                       download_LAT_data.py:266
         INFO                         coordsystem = J2000                                  download_LAT_data.py:266
         INFO                          shapefield = 12                                     download_LAT_data.py:266
         INFO                           timefield = 569192227.626,569193227.626            download_LAT_data.py:266
         INFO                            timetype = MET                                    download_LAT_data.py:266
         INFO                         energyfield = 100.000,10000.000                      download_LAT_data.py:266
         INFO              photonOrExtendedOrNone = Extended                               download_LAT_data.py:266
         INFO                         destination = query                                  download_LAT_data.py:266
         INFO                          spacecraft = checked                                download_LAT_data.py:266
         INFO      Query ID: 86ad4d2b3b3e5065f0f0a976e6fc8315                              download_LAT_data.py:271
00:10:50 INFO      Estimated complete time for your query: 15 seconds                      download_LAT_data.py:428
         INFO      If this download fails, you can find your data at                       download_LAT_data.py:437
                  https://fermi.gsfc.nasa.gov/cgi-bin/ssc/LAT/QueryResults.cgi?id=L2405312                         
                  01051BD968AF249 (when ready)                                                                     
00:10:56 INFO      Downloading FT1 and FT2 files...                                        download_LAT_data.py:527
00:11:02 WARNING   Only one FT1 file provided. Skipping the merge...                        download_LAT_data.py:98
Writing ./bn190114873/gll_cspec_tr_bn190114873_v00.rsp...
time -p gtselect infile=./bn190114873/gll_ft1_tr_bn190114873_v00.fit outfile=__temp_ft1.fits ra=54.51 dec=-26.939 rad=15.0 tmin=569192226.626 tmax=569193228.626 emin=10.0 emax=300000.0 zmin=0.0 zmax=110.0 evclass="INDEF" evtype="INDEF" convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=2 clobber=yes debug=no gui=no mode="ql"
Done.
real 0.12
user 0.09
sys 0.02
Writing ./bn190114873/gll_cspec_tr_bn190114873_v00.pha...
 *  Get energy binning from the response matrix...

    done.

 *  Run gtbindef and gtbin and bin in energy and time...

time -p gtbindef bintype="E" binfile=__ebins.txt outfile=__energyBins.fits energyunits="keV" chatter=2 clobber=yes debug=no gui=no mode="ql"
This is gtbindef version HEAD
real 0.05
user 0.02
sys 0.01
time -p gtbin evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/__temp_ft1.fits scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit outfile=__gtllebin__pha2.pha algorithm="PHA2" ebinalg="FILE" emin=30.0 emax=200000.0 ebinfile=__energyBins.fits tbinalg="LIN" tstart=569192227.626 tstop=569193227.626 dtime=4.096 tbinfile=NONE coordsys="CEL" axisrot=0.0 rafield="RA" decfield="DEC" proj="AIT" hpx_ordering_scheme="RING" hpx_order=3 hpx_ebin=yes hpx_region="" evtable="EVENTS" sctable="SC_DATA" efield="ENERGY" tfield="TIME" chatter=1 clobber=yes debug=no gui=no mode="ql"
This is gtbin version HEAD
real 2.39
user 2.24
sys 0.14

    done.

 *  Transform gtbin output in CSPEC format...

    done.

 *  Updating keywords in the headers of the CSPEC file...

    done.

gtllebin done!
WARNING: VerifyWarning: Card is too long, comment will be truncated. [astropy.io.fits.card]

We want perform a time resolved analysis. So, first we look at the data. We can play with the ROI selection and the cut.

[7]:
roi = 10
zmax = 110.0
thetamax = 180.0
irfs = "p8_transient020e"
strategy = "time"
myLATdataset.extract_events(roi, zmax, irfs, thetamax, strategy=strategy)
time -p gtmktime scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" filter="(DATA_QUAL>0 || DATA_QUAL==-1) && LAT_CONFIG==1 && IN_SAA!=T && LIVETIME>0 && (ANGSEP(RA_ZENITH,DEC_ZENITH,54.51,-26.939)<=(110.0-10))" roicut=no evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit evtable="EVENTS" outfile="gll_ft1_tr_bn190114873_v00_mkt.fit" apply_filter=yes overwrite=no header_obstimes=yes tstart=569192227.626 tstop=569193227.626 gtifile="default" chatter=2 clobber=yes debug=no gui=no mode="ql"
real 0.09
user 0.06
sys 0.02

Using 305 data

time -p gtselect infile=gll_ft1_tr_bn190114873_v00_mkt.fit outfile=gll_ft1_tr_bn190114873_v00_filt.fit ra=54.51 dec=-26.939 rad=10.0 tmin=569192227.626 tmax=569193227.626 emin=100.0 emax=10000.0 zmin=0.0 zmax=110.0 evclass=8 evtype=3 convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=2 clobber=yes debug=no gui=no mode="ql"
Done.
real 0.11
user 0.09
sys 0.01

Selected 251 events.
00:11:05 INFO      Extracted 251 events                                                    download_LAT_data.py:670
[8]:
%matplotlib inline
with pyfits.open(myLATdataset.filt_file) as event_file:
    lat_events = event_file["EVENTS"].data
event_times = lat_events["TIME"] - myGRB["MET"]

intervals = [0, 10, 30, 80, 180]
fig, axs = plt.subplots(2, 1, sharex=True)
plt.sca(axs[0])
plt.hist(event_times)
plt.hist(event_times, intervals, histtype="step")
plt.ylabel("Events")
plt.sca(axs[1])
plt.scatter(
    event_times,
    lat_events["ENERGY"],
    marker="o",
    c=lat_events["ENERGY"],
    norm="log",
    alpha=0.5,
    zorder=20,
)
plt.yscale("log")
plt.ylabel("Energy [MeV]")
plt.xlabel("Time - T0 [s]")
plt.grid(True)
../_images/notebooks_LAT_Transient_Builder_Example_12_0.png

tstarts and tstops are defined as strings, with somma separated values for the starts and the ends of the time bins: For example tsrats=”0,1,10” and tstops=”1,10,20”. To convert arrays in string we use these few lines of code:

[9]:
tstarts = tstops = ""
for t0, t1 in zip(intervals[:-1], intervals[1:]):
    tstarts += "%.4f," % t0
    tstops += "%.4f," % t1
    pass
tstarts = tstarts[:-1].replace("-", "\\-")
print(tstarts)
tstops = tstops[:-1].replace("-", "\\-")
print(tstops)
0.0000,10.0000,30.0000,80.0000
10.0000,30.0000,80.0000,180.0000

We can now make an instance the LAT transient builder

[10]:
analysis_builder = TransientLATDataBuilder(
    myLATdataset.grb_name,
    outfile=myLATdataset.grb_name,
    roi=roi,
    tstarts=tstarts,
    tstops=tstops,
    irf=irfs,
    zmax=zmax,
    galactic_model="template",
    particle_model="isotr template",
    datarepository=".",
)
df = analysis_builder.display(get=True)
outfile                                      190114873
roi                                                 10
tstarts                 0.0000,10.0000,30.0000,80.0000
tstops                10.0000,30.0000,80.0000,180.0000
zmax                                             110.0
emin                                             100.0
emax                                          100000.0
irf                                   p8_transient020e
galactic_model                                template
particle_model                          isotr template
source_model                                 PowerLaw2
tsmin                                             20.0
strategy                                          time
thetamax                                         180.0
spectralfiles                                       no
liketype                                      unbinned
optimizeposition                                    no
datarepository                                       .
ltcube
expomap
ulphindex                                           -2
flemin                                             100
flemax                                           10000
fgl_mode                                          fast
filter_GTI                                       False
likelihood_profile                               False
remove_fits_files                                False
dtype: object

The run method will run (using gtburst) all the fermitools needed to obtain the needed file for the likelihood analysis (livetimecubes, exposure maps. It will also perfom a simple likelihood analysis with the standard likelihood of the fermitools (pylikelihood). The dataproducts created here will be used by threeML to make the fit.

[11]:
LAT_observations = analysis_builder.run(include_previous_intervals=True)
         INFO      Changing permission to                                              lat_transient_builder.py:635
                  /usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermi                             
                  tools/GtBurst/scripts/doTimeResolvedLike.py                                                      
         INFO      Changing permission to                                              lat_transient_builder.py:635
                  /usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermi                             
                  tools/GtBurst/gtapps_mp/gtdiffrsp_mp.py                                                          
         INFO      Changing permission to                                              lat_transient_builder.py:635
                  /usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermi                             
                  tools/GtBurst/gtapps_mp/gtexpmap_mp.py                                                           
         INFO      Changing permission to                                              lat_transient_builder.py:635
                  /usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermi                             
                  tools/GtBurst/gtapps_mp/gtltcube_mp.py                                                           
         INFO      Changing permission to                                              lat_transient_builder.py:635
                  /usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermi                             
                  tools/GtBurst/gtapps_mp/gttsmap_mp.py                                                            
         INFO      About to run the following command:                                 lat_transient_builder.py:640
                  /usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermi                             
                  tools/GtBurst/scripts/doTimeResolvedLike.py 190114873 --outfile                                  
                  '190114873' --roi 10.000000 --tstarts                                                            
                  '0.0000,10.0000,30.0000,80.0000' --tstops                                                        
                  '10.0000,30.0000,80.0000,180.0000' --zmax 110.000000 --emin                                      
                  100.000000 --emax 100000.000000 --irf 'p8_transient020e'                                         
                  --galactic_model 'template' --particle_model 'isotr template'                                    
                  --source_model 'PowerLaw2' --tsmin 20.000000 --strategy 'time'                                   
                  --thetamax 180.000000 --spectralfiles 'no' --liketype 'unbinned'                                 
                  --optimizeposition 'no' --datarepository '.' --ltcube '' --expomap                               
                  '' --ulphindex -2.000000 --flemin 100.000000 --flemax 10000.000000                               
                  --fgl_mode 'fast'                                                                                
 **********
 **    1 **SET PRINT     .000
 **********
 **********
 **    2 **SET NOWARN
 **********

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Integral  '    .10000E-01   1.0000         .10000E-04   1000.0
     2 'Index     '   -2.0000       1.0000        -6.0000       .10000E-01
     3 'Value     '    1.0000       1.0000         .70000       1.3000
     4 'Normalizat'    1.0000       1.0000         .10000       10.000
 **********
 **    3 **SET ERR    .5000
 **********
 **********
 **    4 **SET GRAD    1.000
 **********
 **********
 **    5 **MINIMIZE    900.0       2.000
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   271.7361     FROM MIGRAD    STATUS=CONVERGED     68 CALLS       69 TOTAL
                     EDM=   .61E-05  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  7.4%

  EXT PARAMETER                                   STEP         FIRST
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE
   1  Integral      11.142        .94341       -.98937E-04   -.15807
   2  Index        -2.2206        .95319E-01    .15877E-03    .25128E-01
   3  Value         1.0001        .14439        .16780E-02   -.16718E-02
   4  Normalizat    9.9985        6.1108        .92305        .20096E-03
                               ERR DEF=  .500
Final values:
  Integral   = 11.1422
  Index      = -2.22061
  Value      = 1.0001
  Normalizat = 9.99854
 **********
 **    6 **HESSE
 **********

 FCN=   271.7361     FROM HESSE     STATUS=OK            25 CALLS       94 TOTAL
                     EDM=   .87E-05    STRATEGY= 1      ERROR MATRIX ACCURATE

  EXT PARAMETER                                INTERNAL      INTERNAL
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE
   1  Integral      11.142        .94266        .13811E-04   -1.3593
   2  Index        -2.2206        .95216E-01    .50468E-04    .26064
   3  Value         1.0001        .14383        .40448E-02    3.1413
   4  Normalizat    9.9985        7.2798        .50000        1.5951
                               ERR DEF=  .500
Minuit fit quality: 3   estimated distance: 8.70708e-06
Minuit parameter uncertainties:
  1  0.942672
  2  0.0952335
  3  0.15
  4  1.33203
/usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermitools/MPLPlot.py:54: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
  self.fig.show()
/usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermitools/MPLPlot.py:65: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
  self.fig.show()
 **********
 **    1 **SET PRINT     .000
 **********
 **********
 **    2 **SET NOWARN
 **********

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Integral  '    .10000E-01   1.0000         .10000E-04   1000.0
     2 'Index     '   -2.0000       1.0000        -6.0000       .10000E-01
     3 'Value     '    1.0000       1.0000         .70000       1.3000
     4 'Normalizat'    1.0000       1.0000         .10000       10.000
 **********
 **    3 **SET ERR    .5000
 **********
 **********
 **    4 **SET GRAD    1.000
 **********
 **********
 **    5 **MINIMIZE    900.0       2.000
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   204.5496     FROM MIGRAD    STATUS=CONVERGED     73 CALLS       74 TOTAL
                     EDM=   .29E-06    STRATEGY= 1      ERROR MATRIX ACCURATE

  EXT PARAMETER                                   STEP         FIRST
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE
   1  Integral      1.7650        .24371        .18035E-02    .51152E-01
   2  Index        -1.7297        .12792        .14601E-01    .93571E-02
   3  Value         1.0002        .14437        .15688       -.32336E-03
   4  Normalizat   10.0000        9.7741        .45249    ** at limit **
                               ERR DEF=  .500
Final values:
  Integral   = 1.76499
  Index      = -1.72966
  Value      = 1.00022
  Normalizat = 10
 **********
 **    6 **HESSE
 **********

 FCN=   204.5496     FROM HESSE     STATUS=OK            23 CALLS       97 TOTAL
                     EDM=   .29E-06    STRATEGY= 1      ERROR MATRIX ACCURATE

  EXT PARAMETER                                INTERNAL      INTERNAL
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE
   1  Integral      1.7650        .24392        .79710E-05   -1.4867
   2  Index        -1.7297        .12804        .64475E-04    .43463
   3  Value         1.0002        .14383        .70207E-03    .73696E-03
   4  Normalizat   10.0000        9.7676        .19711E-01    1.5703
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
                               ERR DEF=  .500
Minuit fit quality: 3   estimated distance: 2.93007e-07
Minuit parameter uncertainties:
  1  0.243918
  2  0.128087
  3  0.149999
  4  0.00742061

Requested intervals:
------------------------------------------------------
0.0                  - 10.0
10.0                 - 30.0
30.0                 - 80.0
80.0                 - 180.0

Data files:
-----------
eventfile            /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit
ft2file              /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit
rspfile              /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp
cspecfile            /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.pha

ROI:
-----
R.A.                 54.51
Dec.                 -26.939
Radius               10.0

Interval # 1 (0.0-10.0):
-----------------------

-> gtdocountsmap.py rad='10.0' eventfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit' zmax='110.0' thetamax='180.0' emin='100.0' emax='100000.0' skymap='190114873_LAT_skymap_0.0-10.0.fit' rspfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' strategy='time' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' tstart='0.0' tstop='10.0' ra='54.51' dec='-26.939' irf='p8_transient020e' allowEmpty='no'
time -p gtmktime scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" filter="(DATA_QUAL>0 || DATA_QUAL==-1) && LAT_CONFIG==1 && IN_SAA!=T && LIVETIME>0 && (ANGSEP(RA_ZENITH,DEC_ZENITH,54.51,-26.939)<=(110.0-10.0))" roicut=no evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit evtable="EVENTS" outfile="gll_ft1_tr_bn190114873_v00_mkt.fit" apply_filter=yes overwrite=no header_obstimes=yes tstart=569192227.626 tstop=569192237.626 gtifile="default" chatter=2 clobber=yes debug=no gui=no mode="ql"
real 0.09
user 0.06
sys 0.02

Using 305 data

time -p gtselect infile=gll_ft1_tr_bn190114873_v00_mkt.fit outfile=gll_ft1_tr_bn190114873_v00_filt.fit ra=54.51 dec=-26.939 rad=10.0 tmin=569192227.626 tmax=569192237.626 emin=100.0 emax=100000.0 zmin=0.0 zmax=110.0 evclass=8 evtype=3 convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=2 clobber=yes debug=no gui=no mode="ql"
Done.
real 0.11
user 0.09
sys 0.01

Selected 154 events.
time -p gtbin evfile=gll_ft1_tr_bn190114873_v00_filt.fit scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit outfile=190114873_LAT_skymap_0.0-10.0.fit algorithm="CMAP" ebinalg="LOG" emin=30.0 emax=200000.0 ebinfile=NONE tbinalg="LIN" tbinfile=NONE nxpix=101 nypix=101 binsz=0.2 coordsys="CEL" xref=54.51 yref=-26.939 axisrot=0.0 rafield="RA" decfield="DEC" proj="AIT" hpx_ordering_scheme="RING" hpx_order=3 hpx_ebin=yes hpx_region="" evtable="EVENTS" sctable="SC_DATA" efield="ENERGY" tfield="TIME" chatter=2 clobber=yes debug=no gui=no mode="ql"
This is gtbin version HEAD
real 0.15
user 0.13
sys 0.01

Total number of events in the counts map: 154
Total time in Good Time Intervals:        10.0
-> gtbuildxmlmodel xmlmodel='190114873_LAT_xmlmodel_0.0-10.0.xml' filteredeventfile='gll_ft1_tr_bn190114873_v00_filt.fit' galactic_model='template' particle_model='isotr template' ra='54.51' dec='-26.939' fgl_mode='fast' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' source_model='PowerLaw2'

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

addFGLsources( 54.51 -26.939 18.0 190114873_LAT_xmlmodel_0.0-10.0.xml 10.0 )
('SpatialMap', True)
Keeping diffuse source 4FGL J0322.6-3712e (10.77 deg away) using template /usr/local/miniconda/envs/test_env/share/fermitools/data/pyBurstAnalysisGUI/templates/FornaxA.fits...
Keeping diffuse source 4FGL J0322.6-3712e (10.77 deg away) using spatial model SpatialMap...
Kept 1 point sources from the FGL catalog
-> gtdolike.py spectralfiles='no' xmlmodel='190114873_LAT_xmlmodel_0.0-10.0.xml' liketype='unbinned' filteredeventfile='gll_ft1_tr_bn190114873_v00_filt.fit' rspfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' showmodelimage='no' tsmin='20.0' optimizeposition='no' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' skymap='190114873_LAT_skymap_0.0-10.0.fit' flemin='100.000000' flemax='10000.000000'
time -p gtltcube evfile="/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit" evtable="EVENTS" scfile=__ft2temp.fits sctable="SC_DATA" outfile=gll_ft1_tr_bn190114873_v00_filt_ltcube.fit dcostheta=0.025 binsz=1.0 phibins=1 tmin=0.0 tmax=0.0 file_version="1" zmin=0.0 zmax=180.0 chatter=2 clobber=yes debug=no gui=no mode="ql"
Working on file __ft2temp.fits
..!
real 0.65
user 0.30
sys 0.33
/usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermitools/GtBurst/gtapps_mp/gtexpmap_mp.py 40 40 2 2 /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit gll_ft1_tr_bn190114873_v00_filt_ltcube.fit P8R3_TRANSIENT020E_V3 20.0 20 gll_ft1_tr_bn190114873_v00_filt_expomap.fit
Starting calculation of region 0.0,0.0 to 20.0,20.0

Completed calculation of region 0.0,0.0 to 20.0,20.0

Starting calculation of region 20.0,0.0 to 40.0,20.0

Completed calculation of region 20.0,0.0 to 40.0,20.0

Starting calculation of region 20.0,20.0 to 40.0,40.0

Completed calculation of region 20.0,20.0 to 40.0,40.0

Starting calculation of region 0.0,20.0 to 20.0,40.0

Completed calculation of region 0.0,20.0 to 20.0,40.0

Spawning 4 jobs...

Combining temporary files...

Deleting temporary files...



time -p gtdiffrsp evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" srcmdl=190114873_LAT_xmlmodel_0.0-10.0.xml irfs="P8R3_TRANSIENT020E_V3" evclsmin="INDEF" evclass="INDEF" evtype="INDEF" convert=no chatter=2 clobber=yes debug=no gui=no mode="ql"
adding source 4FGL J0322.6-3712e
adding source GalacticTemplate
adding source IsotropicTemplate
Working on...
/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit......................!
real 18.77
user 18.23
sys 0.51
Loading python Likelihood interface...

Applying a Gaussian prior with sigma 0.15 on the normalization of the Galactic Template
{'Norm': 1.0, 'Mean': 1.0, 'Sigma': 0.15, 'Offset': 0.0}

Likelihood settings:

Event file(s): /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit
Spacecraft file(s): /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit
Exposure map: gll_ft1_tr_bn190114873_v00_filt_expomap.fit
Exposure cube: gll_ft1_tr_bn190114873_v00_filt_ltcube.fit
IRFs: P8R3_TRANSIENT020E_V3
Source model file: 190114873_LAT_xmlmodel_0.0-10.0.xml
Optimizer: Minuit

Performing likelihood fit...
Data  154.0
srcName  2.752536817872419e-05
srcName  153.6695256964082
srcName  0.012114556040442377
srcName  0.28959458185225645
Resid  154.0 153.97126235966903 1.4893784459209356
plotting GRB spectrum
srcName  153.6695256964082
|--------------------|---------------|----------|  ----------|----------|------|
|         Source name|      Par. Name|     Value|       Error|     Units|    TS|
|--------------------|---------------|----------|------------|----------|------|
|GRB                 |               |          |            |          |  2040|
|                    |       Integral|    0.0111|    0.000943| ph./cm2/s|      |
|                    |          Index|     -2.22|      0.0952|         -|      |
|                    |     LowerLimit|       100|n.a. (fixed)|       MeV|      |
|                    |     UpperLimit|     1e+05|n.a. (fixed)|       MeV|      |
|                    |    Energy flux|   6.3e-06|    7.16e-07| erg/cm2/s|      |
|                    |    Photon flux|    0.0111|    0.000944| ph./cm2/s|      |
|GalacticTemplate    |               |          |            |          |     0|
|                    |          Value|         1|        0.15|         -|      |
|                    |    Energy flux|  3.76e-07|    5.64e-08| erg/cm2/s|      |
|                    |    Photon flux|   0.00052|    7.79e-05| ph./cm2/s|      |
|IsotropicTemplate   |               |          |            |          |     1|
|                    |  Normalization|        10|        1.33|         -|      |
|                    |    Energy flux|  1.19e-06|    1.58e-07| erg/cm2/s|      |
|                    |    Photon flux|   0.00258|    0.000343| ph./cm2/s|      |
--------------------------------------------------------------------------------

*** plus 1 FGL sources with TS<1 (not printed to save space)
*** All fluxes and upper limits have been computed in the 100.0 - 10000.0 energy range.
*** Upper limits (if any) are computed assuming a photon index of -2.0, with the 95.0 % c.l.

Log(likelihood) = 271.7361141926039
time -p gtsrcprob evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" outfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt_prob.fit srcmdl=gll_ft1_tr_bn190114873_v00_filt_likeRes.xml irfs="CALDB" evtype="INDEF" srclist= chatter=2 clobber=yes debug=no gui=no mode="ql"
real 6.73
user 5.19
sys 1.50


Interval # 2 (10.0-30.0):
-----------------------

-> gtdocountsmap.py rad='10.0' eventfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit' zmax='110.0' thetamax='180.0' emin='100.0' emax='100000.0' skymap='190114873_LAT_skymap_10.0-30.0.fit' rspfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' strategy='time' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' tstart='10.0' tstop='30.0' ra='54.51' dec='-26.939' irf='p8_transient020e' allowEmpty='no'
time -p gtmktime scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" filter="(DATA_QUAL>0 || DATA_QUAL==-1) && LAT_CONFIG==1 && IN_SAA!=T && LIVETIME>0 && (ANGSEP(RA_ZENITH,DEC_ZENITH,54.51,-26.939)<=(110.0-10.0))" roicut=no evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit evtable="EVENTS" outfile="gll_ft1_tr_bn190114873_v00_mkt.fit" apply_filter=yes overwrite=no header_obstimes=yes tstart=569192237.626 tstop=569192257.626 gtifile="default" chatter=2 clobber=yes debug=no gui=no mode="ql"
real 0.09
user 0.06
sys 0.02

Using 305 data

time -p gtselect infile=gll_ft1_tr_bn190114873_v00_mkt.fit outfile=gll_ft1_tr_bn190114873_v00_filt.fit ra=54.51 dec=-26.939 rad=10.0 tmin=569192237.626 tmax=569192257.626 emin=100.0 emax=100000.0 zmin=0.0 zmax=110.0 evclass=8 evtype=3 convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=2 clobber=yes debug=no gui=no mode="ql"
Done.
real 0.11
user 0.09
sys 0.01

Selected 56 events.
time -p gtbin evfile=gll_ft1_tr_bn190114873_v00_filt.fit scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit outfile=190114873_LAT_skymap_10.0-30.0.fit algorithm="CMAP" ebinalg="LOG" emin=30.0 emax=200000.0 ebinfile=NONE tbinalg="LIN" tbinfile=NONE nxpix=101 nypix=101 binsz=0.2 coordsys="CEL" xref=54.51 yref=-26.939 axisrot=0.0 rafield="RA" decfield="DEC" proj="AIT" hpx_ordering_scheme="RING" hpx_order=3 hpx_ebin=yes hpx_region="" evtable="EVENTS" sctable="SC_DATA" efield="ENERGY" tfield="TIME" chatter=2 clobber=yes debug=no gui=no mode="ql"
This is gtbin version HEAD
real 0.15
user 0.13
sys 0.02

Total number of events in the counts map: 56
Total time in Good Time Intervals:        20.0
-> gtbuildxmlmodel xmlmodel='190114873_LAT_xmlmodel_10.0-30.0.xml' filteredeventfile='gll_ft1_tr_bn190114873_v00_filt.fit' galactic_model='template' particle_model='isotr template' ra='54.51' dec='-26.939' fgl_mode='fast' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' source_model='PowerLaw2'

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

addFGLsources( 54.51 -26.939 18.0 190114873_LAT_xmlmodel_10.0-30.0.xml 20.0 )
('SpatialMap', True)
Keeping diffuse source 4FGL J0322.6-3712e (10.77 deg away) using template /usr/local/miniconda/envs/test_env/share/fermitools/data/pyBurstAnalysisGUI/templates/FornaxA.fits...
Keeping diffuse source 4FGL J0322.6-3712e (10.77 deg away) using spatial model SpatialMap...
Kept 1 point sources from the FGL catalog
-> gtdolike.py spectralfiles='no' xmlmodel='190114873_LAT_xmlmodel_10.0-30.0.xml' liketype='unbinned' filteredeventfile='gll_ft1_tr_bn190114873_v00_filt.fit' rspfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' showmodelimage='no' tsmin='20.0' optimizeposition='no' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' skymap='190114873_LAT_skymap_10.0-30.0.fit' flemin='100.000000' flemax='10000.000000'
time -p gtltcube evfile="/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit" evtable="EVENTS" scfile=__ft2temp.fits sctable="SC_DATA" outfile=gll_ft1_tr_bn190114873_v00_filt_ltcube.fit dcostheta=0.025 binsz=1.0 phibins=1 tmin=0.0 tmax=0.0 file_version="1" zmin=0.0 zmax=180.0 chatter=2 clobber=yes debug=no gui=no mode="ql"
Working on file __ft2temp.fits
...!
real 0.59
user 0.30
sys 0.27
/usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermitools/GtBurst/gtapps_mp/gtexpmap_mp.py 40 40 2 2 /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit gll_ft1_tr_bn190114873_v00_filt_ltcube.fit P8R3_TRANSIENT020E_V3 20.0 20 gll_ft1_tr_bn190114873_v00_filt_expomap.fit
Starting calculation of region 0.0,20.0 to 20.0,40.0

Completed calculation of region 0.0,20.0 to 20.0,40.0

Starting calculation of region 20.0,0.0 to 40.0,20.0

Completed calculation of region 20.0,0.0 to 40.0,20.0

Starting calculation of region 0.0,0.0 to 20.0,20.0

Completed calculation of region 0.0,0.0 to 20.0,20.0

Starting calculation of region 20.0,20.0 to 40.0,40.0

Completed calculation of region 20.0,20.0 to 40.0,40.0

Spawning 4 jobs...

Combining temporary files...

Deleting temporary files...



 **********
 **    1 **SET PRINT     .000
 **********
 **********
 **    2 **SET NOWARN
 **********

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Integral  '    .10000E-01   1.0000         .10000E-04   1000.0
     2 'Index     '   -2.0000       1.0000        -6.0000       .10000E-01
     3 'Value     '    1.0000       1.0000         .70000       1.3000
     4 'Normalizat'    1.0000       1.0000         .10000       10.000
 **********
 **    3 **SET ERR    .5000
 **********
 **********
 **    4 **SET GRAD    1.000
 **********
 **********
 **    5 **MINIMIZE    900.0       2.000
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   144.6357     FROM MIGRAD    STATUS=CONVERGED     68 CALLS       69 TOTAL
                     EDM=   .83E-05    STRATEGY= 1      ERROR MATRIX ACCURATE

  EXT PARAMETER                                   STEP         FIRST
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE
   1  Integral      .45427        .79159E-01    .98788E-03    .99854E-02
   2  Index        -1.5114        .15387        .15675E-01    .80168E-02
   3  Value         .99916        .14437        .15688        .43175E-04
   4  Normalizat    .10005        7.4302        .41707        .17970E-02
                               ERR DEF=  .500
Final values:
  Integral   = 0.454273
  Index      = -1.51137
  Value      = 0.999163
  Normalizat = 0.100048
 **********
 **    6 **HESSE
 **********

 FCN=   144.6357     FROM HESSE     STATUS=OK            23 CALLS       92 TOTAL
                     EDM=   .81E-05    STRATEGY= 1      ERROR MATRIX ACCURATE

  EXT PARAMETER                                INTERNAL      INTERNAL
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE
   1  Integral      .45427        .79219E-01    .43684E-05   -1.5282
   2  Index        -1.5114        .15398        .69279E-04    .51636
   3  Value         .99916        .14383        .59067E-03   -.27884E-02
   4  Normalizat    .10005        7.4036        .92771E-02   -1.5664
                               ERR DEF=  .500
Minuit fit quality: 3   estimated distance: 8.14995e-06
Minuit parameter uncertainties:
  1  0.0792191
  2  0.154065
  3  0.15
  4  0.0341981
 **********
 **    1 **SET PRINT     .000
 **********
 **********
 **    2 **SET NOWARN
 **********

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Integral  '    .10000E-01   1.0000         .10000E-04   1000.0
     2 'Index     '   -2.0000       1.0000        -6.0000       .10000E-01
     3 'Value     '    1.0000       1.0000         .70000       1.3000
     4 'Normalizat'    1.0000       1.0000         .10000       10.000
 **********
 **    3 **SET ERR    .5000
 **********
 **********
 **    4 **SET GRAD    1.000
 **********
 **********
 **    5 **MINIMIZE    900.0       2.000
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   62.16513     FROM MIGRAD    STATUS=CONVERGED     73 CALLS       74 TOTAL
                     EDM=   .68E-05    STRATEGY= 1      ERROR MATRIX ACCURATE

  EXT PARAMETER                                   STEP         FIRST
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE
   1  Integral      .59027E-01    .28568E-01    .61794E-03    .27050
   2  Index        -1.6518        .40776        .25489E-01    .96930E-02
   3  Value         1.0007        .14399        .87820E-01    .34290E-02
   4  Normalizat   10.0000        8.9675        .39847       -.56334E-03
                               ERR DEF=  .500
Final values:
  Integral   = 0.0590268
  Index      = -1.65182
  Value      = 1.00065
  Normalizat = 9.99998
 **********
 **    6 **HESSE
 **********

 FCN=   62.16513     FROM HESSE     STATUS=OK            23 CALLS       97 TOTAL
                     EDM=   .69E-05    STRATEGY= 1      ERROR MATRIX ACCURATE

  EXT PARAMETER                                INTERNAL      INTERNAL
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE
   1  Integral      .59027E-01    .28513E-01    .27388E-05   -1.5554
   2  Index        -1.6518        .40805        .11255E-03    .46339
   3  Value         1.0007        .14383        .19351E-02    .21694E-02
   4  Normalizat   10.0000        9.0398        .17208E-02    1.5679
                               ERR DEF=  .500
Minuit fit quality: 3   estimated distance: 6.89272e-06
Minuit parameter uncertainties:
  1  0.028513
  2  0.409636
  3  0.149997
  4  0.0329943
time -p gtdiffrsp evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" srcmdl=190114873_LAT_xmlmodel_10.0-30.0.xml irfs="P8R3_TRANSIENT020E_V3" evclsmin="INDEF" evclass="INDEF" evtype="INDEF" convert=no chatter=2 clobber=yes debug=no gui=no mode="ql"
adding source 4FGL J0322.6-3712e
adding source GalacticTemplate
adding source IsotropicTemplate
Working on...
/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit............................!
real 10.01
user 9.49
sys 0.50
Loading python Likelihood interface...

Applying a Gaussian prior with sigma 0.15 on the normalization of the Galactic Template
{'Norm': 1.0, 'Mean': 1.0, 'Sigma': 0.15, 'Offset': 0.0}

Likelihood settings:

Event file(s): /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit
Spacecraft file(s): /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit
Exposure map: gll_ft1_tr_bn190114873_v00_filt_expomap.fit
Exposure cube: gll_ft1_tr_bn190114873_v00_filt_ltcube.fit
IRFs: P8R3_TRANSIENT020E_V3
Source model file: 190114873_LAT_xmlmodel_10.0-30.0.xml
Optimizer: Minuit

Performing likelihood fit...
Data  56.0
srcName  2.752536817872419e-05
srcName  55.13887147698296
srcName  0.024028877866810905
srcName  0.5742465656691031
Resid  56.0 55.73717444588704 -0.6693942200355198
plotting GRB spectrum
srcName  55.13887147698296
|--------------------|---------------|----------|  ----------|----------|------|
|         Source name|      Par. Name|     Value|       Error|     Units|    TS|
|--------------------|---------------|----------|------------|----------|------|
|GRB                 |               |          |            |          |   631|
|                    |       Integral|   0.00176|    0.000244| ph./cm2/s|      |
|                    |          Index|     -1.73|       0.128|         -|      |
|                    |     LowerLimit|       100|n.a. (fixed)|       MeV|      |
|                    |     UpperLimit|     1e+05|n.a. (fixed)|       MeV|      |
|                    |    Energy flux|   1.9e-06|    3.95e-07| erg/cm2/s|      |
|                    |    Photon flux|   0.00171|    0.000244| ph./cm2/s|      |
|GalacticTemplate    |               |          |            |          |     1|
|                    |          Value|         1|        0.15|         -|      |
|                    |    Energy flux|  3.76e-07|    5.64e-08| erg/cm2/s|      |
|                    |    Photon flux|   0.00052|    7.79e-05| ph./cm2/s|      |
|IsotropicTemplate   |               |          |            |          |     1|
|                    |  Normalization|        10|     0.00742|         -|      |
|                    |    Energy flux|  1.19e-06|     8.8e-10| erg/cm2/s|      |
|                    |    Photon flux|   0.00258|    1.91e-06| ph./cm2/s|      |
--------------------------------------------------------------------------------

*** plus 1 FGL sources with TS<1 (not printed to save space)
*** All fluxes and upper limits have been computed in the 100.0 - 10000.0 energy range.
*** Upper limits (if any) are computed assuming a photon index of -2.0, with the 95.0 % c.l.

Log(likelihood) = 204.54960186957717
time -p gtsrcprob evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" outfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt_prob.fit srcmdl=gll_ft1_tr_bn190114873_v00_filt_likeRes.xml irfs="CALDB" evtype="INDEF" srclist= chatter=2 clobber=yes debug=no gui=no mode="ql"
real 5.62
user 5.10
sys 0.50


Interval # 3 (30.0-80.0):
-----------------------

-> gtdocountsmap.py rad='10.0' eventfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit' zmax='110.0' thetamax='180.0' emin='100.0' emax='100000.0' skymap='190114873_LAT_skymap_30.0-80.0.fit' rspfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' strategy='time' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' tstart='30.0' tstop='80.0' ra='54.51' dec='-26.939' irf='p8_transient020e' allowEmpty='no'
time -p gtmktime scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" filter="(DATA_QUAL>0 || DATA_QUAL==-1) && LAT_CONFIG==1 && IN_SAA!=T && LIVETIME>0 && (ANGSEP(RA_ZENITH,DEC_ZENITH,54.51,-26.939)<=(110.0-10.0))" roicut=no evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit evtable="EVENTS" outfile="gll_ft1_tr_bn190114873_v00_mkt.fit" apply_filter=yes overwrite=no header_obstimes=yes tstart=569192257.626 tstop=569192307.626 gtifile="default" chatter=2 clobber=yes debug=no gui=no mode="ql"
real 0.09
user 0.06
sys 0.02

Using 305 data

time -p gtselect infile=gll_ft1_tr_bn190114873_v00_mkt.fit outfile=gll_ft1_tr_bn190114873_v00_filt.fit ra=54.51 dec=-26.939 rad=10.0 tmin=569192257.626 tmax=569192307.626 emin=100.0 emax=100000.0 zmin=0.0 zmax=110.0 evclass=8 evtype=3 convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=2 clobber=yes debug=no gui=no mode="ql"
Done.
real 0.11
user 0.09
sys 0.01

Selected 33 events.
time -p gtbin evfile=gll_ft1_tr_bn190114873_v00_filt.fit scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit outfile=190114873_LAT_skymap_30.0-80.0.fit algorithm="CMAP" ebinalg="LOG" emin=30.0 emax=200000.0 ebinfile=NONE tbinalg="LIN" tbinfile=NONE nxpix=101 nypix=101 binsz=0.2 coordsys="CEL" xref=54.51 yref=-26.939 axisrot=0.0 rafield="RA" decfield="DEC" proj="AIT" hpx_ordering_scheme="RING" hpx_order=3 hpx_ebin=yes hpx_region="" evtable="EVENTS" sctable="SC_DATA" efield="ENERGY" tfield="TIME" chatter=2 clobber=yes debug=no gui=no mode="ql"
This is gtbin version HEAD
real 0.16
user 0.13
sys 0.02

Total number of events in the counts map: 33
Total time in Good Time Intervals:        50.0
-> gtbuildxmlmodel xmlmodel='190114873_LAT_xmlmodel_30.0-80.0.xml' filteredeventfile='gll_ft1_tr_bn190114873_v00_filt.fit' galactic_model='template' particle_model='isotr template' ra='54.51' dec='-26.939' fgl_mode='fast' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' source_model='PowerLaw2'

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

addFGLsources( 54.51 -26.939 18.0 190114873_LAT_xmlmodel_30.0-80.0.xml 50.0 )
('SpatialMap', True)
Keeping diffuse source 4FGL J0322.6-3712e (10.77 deg away) using template /usr/local/miniconda/envs/test_env/share/fermitools/data/pyBurstAnalysisGUI/templates/FornaxA.fits...
Keeping diffuse source 4FGL J0322.6-3712e (10.77 deg away) using spatial model SpatialMap...
Kept 1 point sources from the FGL catalog
-> gtdolike.py spectralfiles='no' xmlmodel='190114873_LAT_xmlmodel_30.0-80.0.xml' liketype='unbinned' filteredeventfile='gll_ft1_tr_bn190114873_v00_filt.fit' rspfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' showmodelimage='no' tsmin='20.0' optimizeposition='no' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' skymap='190114873_LAT_skymap_30.0-80.0.fit' flemin='100.000000' flemax='10000.000000'
time -p gtltcube evfile="/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit" evtable="EVENTS" scfile=__ft2temp.fits sctable="SC_DATA" outfile=gll_ft1_tr_bn190114873_v00_filt_ltcube.fit dcostheta=0.025 binsz=1.0 phibins=1 tmin=0.0 tmax=0.0 file_version="1" zmin=0.0 zmax=180.0 chatter=2 clobber=yes debug=no gui=no mode="ql"
Working on file __ft2temp.fits
...!
real 0.59
user 0.30
sys 0.27
/usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermitools/GtBurst/gtapps_mp/gtexpmap_mp.py 40 40 2 2 /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit gll_ft1_tr_bn190114873_v00_filt_ltcube.fit P8R3_TRANSIENT020E_V3 20.0 20 gll_ft1_tr_bn190114873_v00_filt_expomap.fit
Starting calculation of region 0.0,0.0 to 20.0,20.0

Completed calculation of region 0.0,0.0 to 20.0,20.0

Spawning 4 jobs...

Combining temporary files...

Deleting temporary files...



time -p gtdiffrsp evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" srcmdl=190114873_LAT_xmlmodel_30.0-80.0.xml irfs="P8R3_TRANSIENT020E_V3" evclsmin="INDEF" evclass="INDEF" evtype="INDEF" convert=no chatter=2 clobber=yes debug=no gui=no mode="ql"
adding source 4FGL J0322.6-3712e
adding source GalacticTemplate
adding source IsotropicTemplate
Working on...
/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit.................................!
real 7.73
user 7.23
sys 0.49
Loading python Likelihood interface...

Applying a Gaussian prior with sigma 0.15 on the normalization of the Galactic Template
{'Norm': 1.0, 'Mean': 1.0, 'Sigma': 0.15, 'Offset': 0.0}

Likelihood settings:

Event file(s): /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit
Spacecraft file(s): /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit
Exposure map: gll_ft1_tr_bn190114873_v00_filt_expomap.fit
Exposure cube: gll_ft1_tr_bn190114873_v00_filt_ltcube.fit
IRFs: P8R3_TRANSIENT020E_V3
Source model file: 190114873_LAT_xmlmodel_30.0-80.0.xml
Optimizer: Minuit

Performing likelihood fit...
Data  33.0
srcName  2.752536817872419e-05
srcName  32.980999132579235
srcName  0.0528562848327645
srcName  0.012592011927504101
Resid  33.0 33.046474954707676 -1.549122811565773
plotting GRB spectrum
srcName  32.980999132579235
|--------------------|---------------|----------|  ----------|----------|------|
|         Source name|      Par. Name|     Value|       Error|     Units|    TS|
|--------------------|---------------|----------|------------|----------|------|
|GRB                 |               |          |            |          |   389|
|                    |       Integral|  0.000454|    7.92e-05| ph./cm2/s|      |
|                    |          Index|     -1.51|       0.154|         -|      |
|                    |     LowerLimit|       100|n.a. (fixed)|       MeV|      |
|                    |     UpperLimit|     1e+05|n.a. (fixed)|       MeV|      |
|                    |    Energy flux|  6.66e-07|    1.77e-07| erg/cm2/s|      |
|                    |    Photon flux|  0.000424|    7.68e-05| ph./cm2/s|      |
|GalacticTemplate    |               |          |            |          |     0|
|                    |          Value|     0.999|        0.15|         -|      |
|                    |    Energy flux|  3.76e-07|    5.64e-08| erg/cm2/s|      |
|                    |    Photon flux|  0.000519|    7.79e-05| ph./cm2/s|      |
|IsotropicTemplate   |               |          |            |          |     0|
|                    |  Normalization|       0.1|      0.0342|         -|      |
|                    |    Energy flux|  1.19e-08|    4.05e-09| erg/cm2/s|      |
|                    |    Photon flux|  2.58e-05|    8.82e-06| ph./cm2/s|      |
--------------------------------------------------------------------------------

*** plus 1 FGL sources with TS<1 (not printed to save space)
*** All fluxes and upper limits have been computed in the 100.0 - 10000.0 energy range.
*** Upper limits (if any) are computed assuming a photon index of -2.0, with the 95.0 % c.l.

Log(likelihood) = 144.63571671945422
time -p gtsrcprob evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" outfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt_prob.fit srcmdl=gll_ft1_tr_bn190114873_v00_filt_likeRes.xml irfs="CALDB" evtype="INDEF" srclist= chatter=2 clobber=yes debug=no gui=no mode="ql"
real 5.30
user 4.81
sys 0.47


Interval # 4 (80.0-180.0):
-----------------------

-> gtdocountsmap.py rad='10.0' eventfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit' zmax='110.0' thetamax='180.0' emin='100.0' emax='100000.0' skymap='190114873_LAT_skymap_80.0-180.0.fit' rspfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' strategy='time' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' tstart='80.0' tstop='180.0' ra='54.51' dec='-26.939' irf='p8_transient020e' allowEmpty='no'
time -p gtmktime scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" filter="(DATA_QUAL>0 || DATA_QUAL==-1) && LAT_CONFIG==1 && IN_SAA!=T && LIVETIME>0 && (ANGSEP(RA_ZENITH,DEC_ZENITH,54.51,-26.939)<=(110.0-10.0))" roicut=no evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit evtable="EVENTS" outfile="gll_ft1_tr_bn190114873_v00_mkt.fit" apply_filter=yes overwrite=no header_obstimes=yes tstart=569192307.626 tstop=569192407.626 gtifile="default" chatter=2 clobber=yes debug=no gui=no mode="ql"
real 0.09
user 0.06
sys 0.02

Using 305 data

time -p gtselect infile=gll_ft1_tr_bn190114873_v00_mkt.fit outfile=gll_ft1_tr_bn190114873_v00_filt.fit ra=54.51 dec=-26.939 rad=10.0 tmin=569192307.626 tmax=569192407.626 emin=100.0 emax=100000.0 zmin=0.0 zmax=110.0 evclass=8 evtype=3 convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=2 clobber=yes debug=no gui=no mode="ql"
Done.
real 0.12
user 0.09
sys 0.02

Selected 8 events.
time -p gtbin evfile=gll_ft1_tr_bn190114873_v00_filt.fit scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit outfile=190114873_LAT_skymap_80.0-180.0.fit algorithm="CMAP" ebinalg="LOG" emin=30.0 emax=200000.0 ebinfile=NONE tbinalg="LIN" tbinfile=NONE nxpix=101 nypix=101 binsz=0.2 coordsys="CEL" xref=54.51 yref=-26.939 axisrot=0.0 rafield="RA" decfield="DEC" proj="AIT" hpx_ordering_scheme="RING" hpx_order=3 hpx_ebin=yes hpx_region="" evtable="EVENTS" sctable="SC_DATA" efield="ENERGY" tfield="TIME" chatter=2 clobber=yes debug=no gui=no mode="ql"
This is gtbin version HEAD
real 0.15
user 0.13
sys 0.01

Total number of events in the counts map: 8
Total time in Good Time Intervals:        97.97399997711182
-> gtbuildxmlmodel xmlmodel='190114873_LAT_xmlmodel_80.0-180.0.xml' filteredeventfile='gll_ft1_tr_bn190114873_v00_filt.fit' galactic_model='template' particle_model='isotr template' ra='54.51' dec='-26.939' fgl_mode='fast' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' source_model='PowerLaw2'

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

addFGLsources( 54.51 -26.939 18.0 190114873_LAT_xmlmodel_80.0-180.0.xml 97.97399997711182 )
('SpatialMap', True)
Keeping diffuse source 4FGL J0322.6-3712e (10.77 deg away) using template /usr/local/miniconda/envs/test_env/share/fermitools/data/pyBurstAnalysisGUI/templates/FornaxA.fits...
Keeping diffuse source 4FGL J0322.6-3712e (10.77 deg away) using spatial model SpatialMap...
Kept 1 point sources from the FGL catalog
-> gtdolike.py spectralfiles='no' xmlmodel='190114873_LAT_xmlmodel_80.0-180.0.xml' liketype='unbinned' filteredeventfile='gll_ft1_tr_bn190114873_v00_filt.fit' rspfile='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' showmodelimage='no' tsmin='20.0' optimizeposition='no' ft2file='/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit' skymap='190114873_LAT_skymap_80.0-180.0.fit' flemin='100.000000' flemax='10000.000000'
time -p gtltcube evfile="/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit" evtable="EVENTS" scfile=__ft2temp.fits sctable="SC_DATA" outfile=gll_ft1_tr_bn190114873_v00_filt_ltcube.fit dcostheta=0.025 binsz=1.0 phibins=1 tmin=0.0 tmax=0.0 file_version="1" zmin=0.0 zmax=180.0 chatter=2 clobber=yes debug=no gui=no mode="ql"
Working on file __ft2temp.fits
.....!
real 0.78
user 0.32
sys 0.32
/usr/local/miniconda/envs/test_env/lib/python3.9/site-packages/fermitools/GtBurst/gtapps_mp/gtexpmap_mp.py 40 40 2 2 /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit gll_ft1_tr_bn190114873_v00_filt_ltcube.fit P8R3_TRANSIENT020E_V3 20.0 20 gll_ft1_tr_bn190114873_v00_filt_expomap.fit
Starting calculation of region 20.0,0.0 to 40.0,20.0

Completed calculation of region 20.0,0.0 to 40.0,20.0

Starting calculation of region 0.0,20.0 to 20.0,40.0

Completed calculation of region 0.0,20.0 to 20.0,40.0

Starting calculation of region 0.0,0.0 to 20.0,20.0

Completed calculation of region 0.0,0.0 to 20.0,20.0

Starting calculation of region 20.0,20.0 to 40.0,40.0

Completed calculation of region 20.0,20.0 to 40.0,40.0

Spawning 4 jobs...

Combining temporary files...

Deleting temporary files...



time -p gtdiffrsp evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" srcmdl=190114873_LAT_xmlmodel_80.0-180.0.xml irfs="P8R3_TRANSIENT020E_V3" evclsmin="INDEF" evclass="INDEF" evtype="INDEF" convert=no chatter=2 clobber=yes debug=no gui=no mode="ql"
adding source 4FGL J0322.6-3712e
adding source GalacticTemplate
adding source IsotropicTemplate
Working on...
/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit........!
real 5.94
user 5.47
sys 0.46
Loading python Likelihood interface...

Applying a Gaussian prior with sigma 0.15 on the normalization of the Galactic Template
{'Norm': 1.0, 'Mean': 1.0, 'Sigma': 0.15, 'Offset': 0.0}

Likelihood settings:

Event file(s): /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit
Spacecraft file(s): /Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit
Exposure map: gll_ft1_tr_bn190114873_v00_filt_expomap.fit
Exposure cube: gll_ft1_tr_bn190114873_v00_filt_ltcube.fit
IRFs: P8R3_TRANSIENT020E_V3
Source model file: 190114873_LAT_xmlmodel_80.0-180.0.xml
Optimizer: Minuit

Performing likelihood fit...
Data  8.0
srcName  2.752536817872419e-05
srcName  5.6866707104226135
srcName  0.07756617718825597
srcName  1.8293567276841616
Resid  8.0 7.593621140663209 -2.600263598960609
plotting GRB spectrum
srcName  5.6866707104226135
|--------------------|---------------|----------|  ----------|----------|------|
|         Source name|      Par. Name|     Value|       Error|     Units|    TS|
|--------------------|---------------|----------|------------|----------|------|
|GRB                 |               |          |            |          |    34|
|                    |       Integral|   5.9e-05|    2.85e-05| ph./cm2/s|      |
|                    |          Index|     -1.65|        0.41|         -|      |
|                    |     LowerLimit|       100|n.a. (fixed)|       MeV|      |
|                    |     UpperLimit|     1e+05|n.a. (fixed)|       MeV|      |
|                    |    Energy flux|  7.11e-08|    4.55e-08| erg/cm2/s|      |
|                    |    Photon flux|  5.67e-05|    2.88e-05| ph./cm2/s|      |
|GalacticTemplate    |               |          |            |          |     1|
|                    |          Value|         1|        0.15|         -|      |
|                    |    Energy flux|  3.76e-07|    5.64e-08| erg/cm2/s|      |
|                    |    Photon flux|   0.00052|    7.79e-05| ph./cm2/s|      |
|IsotropicTemplate   |               |          |            |          |     3|
|                    |  Normalization|        10|       0.033|         -|      |
|                    |    Energy flux|  1.19e-06|    3.91e-09| erg/cm2/s|      |
|                    |    Photon flux|   0.00258|    8.51e-06| ph./cm2/s|      |
--------------------------------------------------------------------------------

*** plus 1 FGL sources with TS<1 (not printed to save space)
*** All fluxes and upper limits have been computed in the 100.0 - 10000.0 energy range.
*** Upper limits (if any) are computed assuming a photon index of -2.0, with the 95.0 % c.l.

Log(likelihood) = 62.165128100867115
time -p gtsrcprob evfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" outfile=/Users/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt_prob.fit srcmdl=gll_ft1_tr_bn190114873_v00_filt_likeRes.xml irfs="CALDB" evtype="INDEF" srclist= chatter=2 clobber=yes debug=no gui=no mode="ql"
real 5.60
user 5.07
sys 0.52

00:13:21 INFO      The ft2 file does not exist. Please examine!                        lat_transient_builder.py:726
         INFO      we will grab the data file for you.                                 lat_transient_builder.py:727
         INFO      copied ./bn190114873/gll_ft2_tr_bn190114873_v00.fit to              lat_transient_builder.py:743
                  interval0.0-10.0/gll_ft2_tr_bn190114873_v00.fit                                                  
         INFO      The ft2 file does not exist. Please examine!                        lat_transient_builder.py:726
         INFO      we will grab the data file for you.                                 lat_transient_builder.py:727
         INFO      copied ./bn190114873/gll_ft2_tr_bn190114873_v00.fit to              lat_transient_builder.py:743
                  interval10.0-30.0/gll_ft2_tr_bn190114873_v00.fit                                                 
         INFO      The ft2 file does not exist. Please examine!                        lat_transient_builder.py:726
         INFO      we will grab the data file for you.                                 lat_transient_builder.py:727
         INFO      copied ./bn190114873/gll_ft2_tr_bn190114873_v00.fit to              lat_transient_builder.py:743
                  interval30.0-80.0/gll_ft2_tr_bn190114873_v00.fit                                                 
         INFO      The ft2 file does not exist. Please examine!                        lat_transient_builder.py:726
         INFO      we will grab the data file for you.                                 lat_transient_builder.py:727
         INFO      copied ./bn190114873/gll_ft2_tr_bn190114873_v00.fit to              lat_transient_builder.py:743
                  interval80.0-180.0/gll_ft2_tr_bn190114873_v00.fit                                                

At this point we can create the FermiLATLike plugins from each of the observation:

[12]:
LAT_plugins = {}
for l in LAT_observations:
    LAT_name = "LAT_%06.3f-%06.3f" % (float(l.tstart), float(l.tstop))
    LAT_plugins[LAT_name] = l.to_LATLike()
    pass
FermiLATLike - GTI SUM =  10.0
FermiLATLike - GTI SUM =  20.0
FermiLATLike - GTI SUM =  50.0
FermiLATLike - GTI SUM =  97.97399997711182

For reference, these are the keys save in the dictionary.

[13]:
LAT_plugins.keys()
[13]:
dict_keys(['LAT_00.000-10.000', 'LAT_10.000-30.000', 'LAT_30.000-80.000', 'LAT_80.000-180.000'])

Now we can perform the fit in each bin. Note that we set the model, and we set some initial values. All the resulting joint likelihood objects are stored in a dictioonary to be used later for plotting.

[14]:
results = {}
# update_logging_level("DEBUG")

for T0, T1 in zip(intervals[:-1], intervals[1:]):
    GRB = PointSource(
        "GRB", ra=myGRB["RA"], dec=myGRB["DEC"], spectral_shape=Powerlaw_flux()
    )
    model = Model(GRB)
    model.GRB.spectrum.main.Powerlaw_flux.a = 100.0 * u.MeV
    model.GRB.spectrum.main.Powerlaw_flux.b = 10000.0 * u.MeV
    model.GRB.spectrum.main.Powerlaw_flux.F = 1.0
    LAT_name = "LAT_%06.3f-%06.3f" % (T0, T1)
    LAT_model_name = ("LAT%dX%d" % (T0, T1)).replace("-", "n")
    datalist = DataList(LAT_plugins[LAT_name])
    model["GRB.spectrum.main.Powerlaw_flux.F"].bounds = (1e-6, 1e6)
    model["GRB.spectrum.main.Powerlaw_flux.F"].value = 1e-2
    model["GRB.spectrum.main.Powerlaw_flux.index"].value = -2.2
    model["GRB.spectrum.main.Powerlaw_flux.index"].bounds = (-3, 0)
    jl = JointLikelihood(model, datalist, verbose=False)
    model[LAT_model_name + "_GalacticTemplate_Value"].value = 1.0
    model[LAT_model_name + "_GalacticTemplate_Value"].fix = True
    model[LAT_model_name + "_GalacticTemplate_Value"].fix = True
    # model.display( complete=True )
    jl.set_minimizer("minuit")
    jl.fit(compute_covariance=True)
    results[LAT_name] = jl
    pass
00:13:22 WARNING   We have set the min_value of GRB.spectrum.main.Powerlaw_flux.F to 1e-99 because parameter.py:704
                  there was a postive transform                                                                    

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

00:13:30 INFO      set the minimizer to minuit                                             joint_likelihood.py:1045
         INFO      set the minimizer to MINUIT                                             joint_likelihood.py:1062
00:13:31 WARNING   50.42 percent of samples have been thrown away because they failed the  analysis_results.py:1740
                  constraints on the parameters. This results might not be suitable for                            
                  error propagation. Enlarge the boundaries until you loose less than 1                            
                  percent of the samples.                                                                          
Best fit values:

result unit
parameter
GRB.spectrum.main.Powerlaw_flux.F (1.11 -0.09 +0.10) x 10^-2 1 / (cm2 s)
GRB.spectrum.main.Powerlaw_flux.index -2.22 +/- 0.10
LAT0X10_IsotropicTemplate_Normalization 5.00 +/- 0.08
Correlation matrix:

1.00-0.31-0.00
-0.311.000.00
-0.000.001.00
Values of -log(likelihood) at the minimum:

-log(likelihood)
LAT0X10 896.873532
total 896.873532
Values of statistical measures:

statistical measures
AIC 1799.907064
BIC 1808.857922
00:13:31 WARNING   We have set the min_value of GRB.spectrum.main.Powerlaw_flux.F to 1e-99 because parameter.py:704
                  there was a postive transform                                                                    

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

00:13:37 INFO      set the minimizer to minuit                                             joint_likelihood.py:1045
         INFO      set the minimizer to MINUIT                                             joint_likelihood.py:1062
         WARNING   48.58 percent of samples have been thrown away because they failed the  analysis_results.py:1740
                  constraints on the parameters. This results might not be suitable for                            
                  error propagation. Enlarge the boundaries until you loose less than 1                            
                  percent of the samples.                                                                          
Best fit values:

result unit
parameter
GRB.spectrum.main.Powerlaw_flux.F (1.73 -0.23 +0.26) x 10^-3 1 / (cm2 s)
GRB.spectrum.main.Powerlaw_flux.index -1.73 +/- 0.13
LAT10X30_IsotropicTemplate_Normalization 5.000 +/- 0.006
Correlation matrix:

1.00-0.30-0.00
-0.301.000.00
-0.000.001.00
Values of -log(likelihood) at the minimum:

-log(likelihood)
LAT10X30 377.045804
total 377.045804
Values of statistical measures:

statistical measures
AIC 760.553147
BIC 766.167663
00:13:37 WARNING   We have set the min_value of GRB.spectrum.main.Powerlaw_flux.F to 1e-99 because parameter.py:704
                  there was a postive transform                                                                    

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

00:13:44 INFO      set the minimizer to minuit                                             joint_likelihood.py:1045
         INFO      set the minimizer to MINUIT                                             joint_likelihood.py:1062
         WARNING   49.32 percent of samples have been thrown away because they failed the  analysis_results.py:1740
                  constraints on the parameters. This results might not be suitable for                            
                  error propagation. Enlarge the boundaries until you loose less than 1                            
                  percent of the samples.                                                                          
Best fit values:

result unit
parameter
GRB.spectrum.main.Powerlaw_flux.F (4.2 -0.7 +0.8) x 10^-4 1 / (cm2 s)
GRB.spectrum.main.Powerlaw_flux.index -1.51 +/- 0.15
LAT30X80_IsotropicTemplate_Normalization (1.0 +/- 1.0) x 10^-1
Correlation matrix:

1.00-0.28-0.00
-0.281.000.00
-0.000.001.00
Values of -log(likelihood) at the minimum:

-log(likelihood)
LAT30X80 229.690242
total 229.690242
Values of statistical measures:

statistical measures
AIC 466.208071
BIC 469.870007
00:13:45 WARNING   We have set the min_value of GRB.spectrum.main.Powerlaw_flux.F to 1e-99 because parameter.py:704
                  there was a postive transform                                                                    

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /usr/local/miniconda/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

00:13:53 INFO      set the minimizer to minuit                                             joint_likelihood.py:1045
         INFO      set the minimizer to MINUIT                                             joint_likelihood.py:1062
         WARNING   50.22 percent of samples have been thrown away because they failed the  analysis_results.py:1740
                  constraints on the parameters. This results might not be suitable for                            
                  error propagation. Enlarge the boundaries until you loose less than 1                            
                  percent of the samples.                                                                          
Best fit values:

result unit
parameter
GRB.spectrum.main.Powerlaw_flux.F (6.7 -2.5 +4) x 10^-5 1 / (cm2 s)
GRB.spectrum.main.Powerlaw_flux.index -1.7 +/- 0.4
LAT80X180_IsotropicTemplate_Normalization 5.00 +/- 0.05
Correlation matrix:

1.00-0.40-0.00
-0.401.000.00
-0.000.001.00
Values of -log(likelihood) at the minimum:

-log(likelihood)
LAT80X180 73.102184
total 73.102184
Values of statistical measures:

statistical measures
AIC 158.204369
BIC 152.442693

You can usethis function to graphically display the results of your fit (folded model, data and residuals)

[15]:
i = 0
T0, T1 = intervals[i], intervals[i + 1]
LAT_name = "LAT_%06.3f-%06.3f" % (T0, T1)
jl = results[LAT_name]
jl.results.display()
display_spectrum_model_counts(jl, figsize=(10, 8))
Best fit values:

result unit
parameter
GRB.spectrum.main.Powerlaw_flux.F (1.11 -0.09 +0.10) x 10^-2 1 / (cm2 s)
GRB.spectrum.main.Powerlaw_flux.index -2.22 +/- 0.10
LAT0X10_IsotropicTemplate_Normalization 5.00 +/- 0.08
Correlation matrix:

1.00-0.31-0.00
-0.311.000.00
-0.000.001.00
Values of -log(likelihood) at the minimum:

-log(likelihood)
LAT0X10 896.873532
total 896.873532
Values of statistical measures:

statistical measures
AIC 1799.907064
BIC 1808.857922
[15]:
../_images/notebooks_LAT_Transient_Builder_Example_26_8.png
../_images/notebooks_LAT_Transient_Builder_Example_26_9.png

We can see the evolution of the spectrum with time (not all the bins are diplayed):

[16]:
fig = plot_spectra(
    *[a.results for a in results.values()],
    ene_min=100 * u.MeV,
    ene_max=10 * u.GeV,
    flux_unit="erg2/(cm2 s MeV)",
    energy_unit="MeV",
    fit_cmap="viridis",
    contour_cmap="viridis",
    contour_style_kwargs=dict(alpha=0.1)
)
fig.set_size_inches(10, 8)
../_images/notebooks_LAT_Transient_Builder_Example_28_5.png

Finally, we can display flux lightcurves and index evolution with time.

[17]:
variates = ["F", "index"]
y = {}
for n in variates:
    y[n] = []
    y[n + "_p"] = []
    y[n + "_n"] = []
x = []
dx = []

for T0, T1 in zip(intervals[:-1], intervals[1:]):
    LAT_name = "LAT_%06.3f-%06.3f" % (T0, T1)
    x.append((T1 + T0) / 2)
    dx.append((T1 - T0) / 2)
    jl = results[LAT_name]
    res = jl.results
    mod = res.optimized_model
    ps = mod.point_sources

    for n in variates:
        my_variate = res.get_variates("GRB.spectrum.main.Powerlaw_flux.%s" % n)
        y[n].append(my_variate.median)
        y[n + "_p"].append(my_variate.equal_tail_interval()[1] - my_variate.median)
        y[n + "_n"].append(my_variate.median - my_variate.equal_tail_interval()[0])

fig = plt.figure(figsize=(8, 12))
colors = ["r", "b"]
ylabels = ["Flux [100MeV - 10GeV] \n $\gamma$ cm$^{-2}$ s$^{-1}$", "index"]
for i, n in enumerate(variates):
    plt.subplot(len(variates) + 1, 1, i + 1)
    plt.errorbar(x, y[n], xerr=dx, yerr=(y[n + "_n"], y[n + "_p"]), ls="", c=colors[i])
    if i == 0:
        plt.yscale("log")
    plt.ylabel(ylabels[i])
../_images/notebooks_LAT_Transient_Builder_Example_30_0.png