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")
error

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)
Only one FT1 file provided. Skipping the merge...
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=1000000.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.04
user 0.03
sys 0.00
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.00
user 0.00
sys 0.00
time -p gtbin evfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/__temp_ft1.fits scfile=/home/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 1.41
user 1.37
sys 0.03

    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=/home/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=/home/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.03
user 0.02
sys 0.00

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.04
user 0.03
sys 0.00

Selected 251 events.
[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)
100  6363.07
104.762  6836.44
109.75  7318.3
114.976  7807.69
120.45  8312.42
126.186  8848.68
132.194  9429.85
138.489  9956.52
145.083  10486.7
151.991  11054.6
159.228  11632.1
166.81  12211
174.753  12759
183.074  13346.9
191.791  13909.2
200.923  14435.5
210.49  14970.1
220.513  15512.9
231.013  16026.9
242.013  16506.4
253.536  16937.4
265.609  17331.6
278.256  17723.7
291.505  18118.4
305.386  18463.1
319.927  18874.9
335.16  19211.5
351.119  19484.5
367.838  19731.1
385.353  19979.2
403.702  20211.6
422.924  20431.2
443.062  20606.4
464.159  20771.6
486.26  20927.5
509.414  21083.6
533.67  21243.6
559.081  21408.7
585.702  21525
613.591  21725.5
642.807  21998.7
673.415  22272.5
705.48  22535.5
739.072  22762.8
774.264  22978
811.131  23153.3
849.753  23117.9
890.215  23082.5
932.603  23059.4
977.01  23287.9
1023.53  23590.5
1072.27  23819.1
1123.32  24108.7
1176.81  24402
1232.85  24697.1
1291.55  24645.5
1353.05  24534.6
1417.47  24418
1484.97  24488.7
1555.68  24616.8
1629.75  24745
1707.35  24817.6
1788.65  24962.5
1873.82  25008.5
1963.04  24900.6
2056.51  24680.2
2154.43  24459.7
2257.02  24314.3
2364.49  24248.7
2477.08  24180.6
2595.02  24009.8
2718.59  23679.4
2848.04  23348.9
2983.65  23087.8
3125.72  22990.8
3274.55  23011.4
3430.47  22898
3593.81  22724.4
3764.94  22550.9
3944.21  22332.3
4132.01  21746.6
4328.76  21160.8
4534.88  20582.9
4750.81  20514.8
4977.02  20446.7
5214.01  20378.6
5462.28  20237.9
5722.37  19980.6
5994.84  19837.1
6280.29  19707.3
6579.33  19580.4
6892.61  19453.4
7220.81  19546.9
7564.63  19720.1
7924.83  19893.1
8302.18  19992.2
8697.49  20049.9
9111.63  20107.5
9545.48  20060.6
10000  19861.1
 **********
 **    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

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

Data files:
-----------
eventfile            /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft1_tr_bn190114873_v00.fit
ft2file              /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit
rspfile              /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp
cspecfile            /home/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='/home/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='/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' strategy='time' ft2file='/home/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=/home/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=/home/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.03
user 0.02
sys 0.00

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.04
user 0.03
sys 0.00

Selected 154 events.
time -p gtbin evfile=gll_ft1_tr_bn190114873_v00_filt.fit scfile=/home/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.05
user 0.04
sys 0.00
Counts map saved in 190114873_LAT_skymap_0.0-10.0.fit

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='/home/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: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/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 /home/runner/miniconda3/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='/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' showmodelimage='no' tsmin='20.0' optimizeposition='no' ft2file='/home/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="/home/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.24
user 0.13
sys 0.11
/home/runner/miniconda3/envs/test_env/lib/python3.12/site-packages/fermitools/GtBurst/gtapps_mp/gtexpmap_mp.py 40 40 2 2 /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit /home/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,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

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

Spawning 4 jobs...

Combining temporary files...

Deleting temporary files...





time -p gtdiffrsp evfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/home/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...
/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit......................!
real 13.93
user 13.57
sys 0.35
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): /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit
Spacecraft file(s): /home/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.7525368186075935e-05
srcName  153.66952569606119
srcName  0.012114556040444906
srcName  0.2895945818525812
Resid  154.0 153.9712623593224 1.4893784459509818
plotting GRB spectrum
srcName  153.66952569606119
|--------------------|---------------|----------|  ----------|----------|------|
|         Source name|      Par. Name|     Value|       Error|     Units|    TS|
|--------------------|---------------|----------|------------|----------|------|
|GRB                 |               |          |            |          |  2040|
|                    |       Integral|    0.0111|n.a. (fixed)| ph./cm2/s|      |
|                    |          Index|     -2.22|n.a. (fixed)|         -|      |
|                    |     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|n.a. (fixed)|         -|      |
|                    |    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|n.a. (fixed)|         -|      |
|                    |    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.100  12744.5
104.762  13692.3
109.75  14657.1
114.976  15637
120.45  16647.5
126.186  17721.1
132.194  18884.6
138.489  19938.9
145.083  21000.2
151.991  22137
159.228  23293.1
166.81  24451.7
174.753  25548.5
183.074  26725.2
191.791  27850.6
200.923  28904
210.49  29974.4
220.513  31060.9
231.013  32089.8
242.013  33049.8
253.536  33912.4
265.609  34701.4
278.256  35486.2
291.505  36276.3
305.386  36966.2
319.927  37790.3
335.16  38464
351.119  39010.2
367.838  39503.8
385.353  40000.1
403.702  40465.3
422.924  40904.5
443.062  41255.1
464.159  41585.5
486.26  41897.2
509.414  42209.6
533.67  42529.6
559.081  42859.7
585.702  43092.3
613.591  43493.3
642.807  44040
673.415  44587.7
705.48  45114
739.072  45568.6
774.264  45999.2
811.131  46349.6
849.753  46278.5
890.215  46207.3
932.603  46160.8
977.01  46617.8
1023.53  47223.3
1072.27  47680.6
1123.32  48259.9
1176.81  48846.8
1232.85  49437.4
1291.55  49334.1
1353.05  49112
1417.47  48878.6
1484.97  49020.1
1555.68  49276.4
1629.75  49532.9
1707.35  49678.1
1788.65  49968.2
1873.82  50060.3
1963.04  49844.1
2056.51  49402.9
2154.43  48961.5
2257.02  48670.3
2364.49  48539.1
2477.08  48402.6
2595.02  48060.8
2718.59  47399.3
2848.04  46737.7
2983.65  46214.9
3125.72  46020.6
3274.55  46061.9
3430.47  45834.8
3593.81  45487.4
3764.94  45140
3944.21  44702.3
4132.01  43529.9
4328.76  42357.2
4534.88  41200.5
4750.81  41064.1
4977.02  40927.7
5214.01  40791.3
5462.28  40509.6
5722.37  39994.5
5994.84  39707.4
6280.29  39447.5
6579.33  39193.3
6892.61  38939
7220.81  39126.2
7564.63  39472.9
7924.83  39819.1
8302.18  40017.4
8697.49  40132.8
9111.63  40248.2
9545.48  40154.1
10000  39754.8
 **********
 **    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


Log(likelihood) = 271.7361141926041
time -p gtsrcprob evfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval0.0-10.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" outfile=/home/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 3.87
user 3.42
sys 0.44


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

-> gtdocountsmap.py rad='10.0' eventfile='/home/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='/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' strategy='time' ft2file='/home/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=/home/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=/home/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.03
user 0.02
sys 0.00

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.04
user 0.03
sys 0.00

Selected 56 events.
time -p gtbin evfile=gll_ft1_tr_bn190114873_v00_filt.fit scfile=/home/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.05
user 0.04
sys 0.00
Counts map saved in 190114873_LAT_skymap_10.0-30.0.fit

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='/home/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: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/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 /home/runner/miniconda3/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='/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' showmodelimage='no' tsmin='20.0' optimizeposition='no' ft2file='/home/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="/home/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.25
user 0.15
sys 0.09
/home/runner/miniconda3/envs/test_env/lib/python3.12/site-packages/fermitools/GtBurst/gtapps_mp/gtexpmap_mp.py 40 40 2 2 /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit /home/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,0.0 to 20.0,20.0

Completed calculation of region 0.0,0.0 to 20.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 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

Spawning 4 jobs...

Combining temporary files...

Deleting temporary files...









time -p gtdiffrsp evfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/home/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...
/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit............................!
real 7.44
user 7.06
sys 0.38
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): /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit
Spacecraft file(s): /home/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.7525368186075935e-05
srcName  55.13887147693988
srcName  0.024028877866807397
srcName  0.5742465656691058
Resid  56.0 55.737174445844005 -0.6693942200073393
plotting GRB spectrum
srcName  55.13887147693988
|--------------------|---------------|----------|  ----------|----------|------|
|         Source name|      Par. Name|     Value|       Error|     Units|    TS|
|--------------------|---------------|----------|------------|----------|------|
|GRB                 |               |          |            |          |   631|
|                    |       Integral|   0.00176|n.a. (fixed)| ph./cm2/s|      |
|                    |          Index|     -1.73|n.a. (fixed)|         -|      |
|                    |     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|n.a. (fixed)|         -|      |
|                    |    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|n.a. (fixed)|         -|      |
|                    |    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.100  27440.2
104.762  29467.1
109.75  31583.1
114.976  33796.3
120.45  36080.3
126.186  38526.1
132.194  41211
138.489  43654.1
145.083  46091.7
151.991  48634.5
159.228  51223.1
166.81  53816.2
174.753  56253.1
183.074  58858.2
191.791  61379
200.923  63960.7
210.49  66587.7
220.513  69257.7
231.013  71786.4
242.013  74155.2
253.536  76294.4
265.609  78153.3
278.256  79989.5
291.505  81839.2
305.386  83571.9
319.927  85632.2
335.16  87360.9
351.119  88787
367.838  90088.8
385.353  91398.2
403.702  92547.8
422.924  93580.2
443.062  94396.1
464.159  95194.3
486.26  95976.2
509.414  96759.8
533.67  97492.2
559.081  98153.8
585.702  98592
613.591  99358.6
642.807  100338
673.415  101319
705.48  102383
739.072  103715
774.264  104987
811.131  106100
849.753  106417
890.215  106734
932.603  107077
977.01  107920
1023.53  109129
1072.27  109974
1123.32  110944
1176.81  111925
1232.85  112918
1291.55  112627
1353.05  112112
1417.47  111568
1484.97  111881
1555.68  112455
1629.75  113029
1707.35  113229
1788.65  113673
1873.82  113688
1963.04  113330
2056.51  112699
2154.43  112067
2257.02  111365
2364.49  110587
2477.08  109797
2595.02  109195
2718.59  108887
2848.04  108579
2983.65  107987
3125.72  106723
3274.55  105950
3430.47  104692
3593.81  103496
3764.94  102301
3944.21  100983
4132.01  98662.6
4328.76  96341.7
4534.88  94049.7
4750.81  93604.7
4977.02  93159.7
5214.01  92714.6
5462.28  91479.5
5722.37  89701.6
5994.84  88414.7
6280.29  87875.6
6579.33  87491.8
6892.61  87107.9
7220.81  87173.6
7564.63  87401.5
7924.83  87627.4
8302.18  87904.7
8697.49  88210.8
9111.63  88517
9545.48  88229.6
10000  87176.2
 **********
 **    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


Log(likelihood) = 204.54960186957726
time -p gtsrcprob evfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval10.0-30.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" outfile=/home/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 3.87
user 3.45
sys 0.41


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

-> gtdocountsmap.py rad='10.0' eventfile='/home/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='/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' strategy='time' ft2file='/home/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=/home/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=/home/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.03
user 0.02
sys 0.00

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.04
user 0.03
sys 0.00

Selected 33 events.
time -p gtbin evfile=gll_ft1_tr_bn190114873_v00_filt.fit scfile=/home/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.05
user 0.04
sys 0.00
Counts map saved in 190114873_LAT_skymap_30.0-80.0.fit

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='/home/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: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/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 /home/runner/miniconda3/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='/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' showmodelimage='no' tsmin='20.0' optimizeposition='no' ft2file='/home/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="/home/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.26
user 0.15
sys 0.10
/home/runner/miniconda3/envs/test_env/lib/python3.12/site-packages/fermitools/GtBurst/gtapps_mp/gtexpmap_mp.py 40 40 2 2 /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit /home/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 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 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

Spawning 4 jobs...

Combining temporary files...

Deleting temporary files...




time -p gtdiffrsp evfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/home/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...
/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit.................................!
real 5.77
user 5.40
sys 0.36
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): /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit
Spacecraft file(s): /home/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.7525368186075935e-05
srcName  32.980999132575384
srcName  0.052856284832764194
srcName  0.012592011927498571
Resid  33.0 33.04647495470384 -1.5491228115644295
plotting GRB spectrum
srcName  32.980999132575384
|--------------------|---------------|----------|  ----------|----------|------|
|         Source name|      Par. Name|     Value|       Error|     Units|    TS|
|--------------------|---------------|----------|------------|----------|------|
|GRB                 |               |          |            |          |   389|
|                    |       Integral|  0.000454|n.a. (fixed)| ph./cm2/s|      |
|                    |          Index|     -1.51|n.a. (fixed)|         -|      |
|                    |     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|n.a. (fixed)|         -|      |
|                    |    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|n.a. (fixed)|         -|      |
|                    |    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.100  31526.7
104.762  34087
109.75  36773.9
114.976  39591.3
120.45  42508.5
126.186  45717.7
132.194  49389.2
138.489  52772.5
145.083  56077.3
151.991  59277
159.228  62548
166.81  65934.4
174.753  69611
183.074  73597.1
191.791  77436.4
200.923  81308
210.49  85261.6
220.513  89293.9
231.013  93437.8
242.013  97349.7
253.536  100906
265.609  104219
278.256  107530
291.505  110873
305.386  113859
319.927  117187
335.16  120137
351.119  122945
367.838  125706
385.353  128490
403.702  130628
422.924  132321
443.062  133620
464.159  134801
486.26  135869
509.414  136941
533.67  137999
559.081  139039
585.702  139572
613.591  140575
642.807  141500
673.415  142426
705.48  143787
739.072  146576
774.264  149247
811.131  151651
849.753  152760
890.215  153870
932.603  154981
977.01  156090
1023.53  158515
1072.27  159639
1123.32  159895
1176.81  160114
1232.85  160351
1291.55  160684
1353.05  161006
1417.47  161269
1484.97  161392
1555.68  161471
1629.75  161550
1707.35  161322
1788.65  160913
1873.82  160530
1963.04  160303
2056.51  160189
2154.43  160076
2257.02  159003
2364.49  156908
2477.08  154800
2595.02  153707
2718.59  154200
2848.04  154692
2983.65  154251
3125.72  151604
3274.55  149820
3430.47  147238
3593.81  144994
3764.94  142750
3944.21  140322
4132.01  136394
4328.76  132463
4534.88  128576
4750.81  127600
4977.02  126624
5214.01  125648
5462.28  122443
5722.37  118556
5994.84  115182
6280.29  114697
6579.33  114813
6892.61  114928
7220.81  114120
7564.63  112976
7924.83  111823
8302.18  111634
8697.49  111985
9111.63  112336
9545.48  111965
10000  109344
 **********
 **    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


Log(likelihood) = 144.63571671945436
time -p gtsrcprob evfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval30.0-80.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" outfile=/home/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 3.88
user 3.43
sys 0.44


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

-> gtdocountsmap.py rad='10.0' eventfile='/home/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='/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' strategy='time' ft2file='/home/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=/home/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=/home/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.03
user 0.02
sys 0.00

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.04
user 0.03
sys 0.00

Selected 8 events.
time -p gtbin evfile=gll_ft1_tr_bn190114873_v00_filt.fit scfile=/home/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.05
user 0.04
sys 0.00
Counts map saved in 190114873_LAT_skymap_80.0-180.0.fit

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='/home/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: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/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 /home/runner/miniconda3/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='/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_cspec_tr_bn190114873_v00.rsp' showmodelimage='no' tsmin='20.0' optimizeposition='no' ft2file='/home/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="/home/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.26
user 0.15
sys 0.11
/home/runner/miniconda3/envs/test_env/lib/python3.12/site-packages/fermitools/GtBurst/gtapps_mp/gtexpmap_mp.py 40 40 2 2 /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit /home/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 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,20.0 to 40.0,40.0

Completed calculation of region 20.0,20.0 to 40.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

Spawning 4 jobs...

Combining temporary files...

Deleting temporary files...









time -p gtdiffrsp evfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/home/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...
/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit........!
real 4.29
user 3.93
sys 0.36
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): /home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit
Spacecraft file(s): /home/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.7525368186075935e-05
srcName  5.686670710427907
srcName  0.07756617718826148
srcName  1.8293567276841642
Resid  8.0 7.593621140668519 -2.6002635989737595
plotting GRB spectrum
srcName  5.686670710427907
|--------------------|---------------|----------|  ----------|----------|------|
|         Source name|      Par. Name|     Value|       Error|     Units|    TS|
|--------------------|---------------|----------|------------|----------|------|
|GRB                 |               |          |            |          |    34|
|                    |       Integral|   5.9e-05|n.a. (fixed)| ph./cm2/s|      |
|                    |          Index|     -1.65|n.a. (fixed)|         -|      |
|                    |     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|n.a. (fixed)|         -|      |
|                    |    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|n.a. (fixed)|         -|      |
|                    |    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=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/interval80.0-180.0/gll_ft1_tr_bn190114873_v00_filt.fit evtable="EVENTS" scfile=/home/runner/work/threeML/threeML/docs/md_docs/slow_execute/bn190114873/gll_ft2_tr_bn190114873_v00.fit sctable="SC_DATA" outfile=/home/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 3.87
user 3.43
sys 0.44

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
We have set the min_value of GRB.spectrum.main.Powerlaw_flux.F to 1e-99 because there was a postive transform

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

100  6363.07
104.762  6836.44
109.75  7318.3
114.976  7807.69
120.45  8312.42
126.186  8848.68
132.194  9429.85
138.489  9956.52
145.083  10486.7
151.991  11054.6
159.228  11632.1
166.81  12211
174.753  12759
183.074  13346.9
191.791  13909.2
200.923  14435.5
210.49  14970.1
220.513  15512.9
231.013  16026.9
242.013  16506.4
253.536  16937.4
265.609  17331.6
278.256  17723.7
291.505  18118.4
305.386  18463.1
319.927  18874.9
335.16  19211.5
351.119  19484.5
367.838  19731.1
385.353  19979.2
403.702  20211.6
422.924  20431.2
443.062  20606.4
464.159  20771.6
486.26  20927.5
509.414  21083.6
533.67  21243.6
559.081  21408.7
585.702  21525
613.591  21725.5
642.807  21998.7
673.415  22272.5
705.48  22535.5
739.072  22762.8
774.264  22978
811.131  23153.3
849.753  23117.9
890.215  23082.5
932.603  23059.4
977.01  23287.9
1023.53  23590.5
1072.27  23819.1
1123.32  24108.7
1176.81  24402
1232.85  24697.1
1291.55  24645.5
1353.05  24534.6
1417.47  24418
1484.97  24488.7
1555.68  24616.8
1629.75  24745
1707.35  24817.6
1788.65  24962.5
1873.82  25008.5
1963.04  24900.6
2056.51  24680.2
2154.43  24459.7
2257.02  24314.3
2364.49  24248.7
2477.08  24180.6
2595.02  24009.8
2718.59  23679.4
2848.04  23348.9
2983.65  23087.8
3125.72  22990.8
3274.55  23011.4
3430.47  22898
3593.81  22724.4
3764.94  22550.9
3944.21  22332.3
4132.01  21746.6
4328.76  21160.8
4534.88  20582.9
4750.81  20514.8
4977.02  20446.7
5214.01  20378.6
5462.28  20237.9
5722.37  19980.6
5994.84  19837.1
6280.29  19707.3
6579.33  19580.4
6892.61  19453.4
7220.81  19546.9
7564.63  19720.1
7924.83  19893.1
8302.18  19992.2
8697.49  20049.9
9111.63  20107.5
9545.48  20060.6
10000  19861.1

WARNING UserWarning: 49.8% of samples have been thrown away because they failed the constraints on the parameters. This result might not be suitable for error propagation. Enlarge the boundaries until you lose less than 1% ofthe samples.
Discarded samples in excluded parameter space (2489 samples):
  F: mean=0.01114, std=0.0009411, bounds=[1e-06, 1e+06]
  index: mean=-2.218, std=0.0949, bounds=[-3, 0]
  LAT0X10_IsotropicTemplate_Normalization: mean=5.065, std=0.05014, bounds=[0.1, 5]

Best fit values:

result unit
parameter
GRB.spectrum.main.Powerlaw_flux.F (1.11 -0.09 +0.10) x 10^-2 1 / (s cm2)
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.31 1.00 0.00
-0.00 0.00 1.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
We have set the min_value of GRB.spectrum.main.Powerlaw_flux.F to 1e-99 because there was a postive transform

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

100  12744.5
104.762  13692.3
109.75  14657.1
114.976  15637
120.45  16647.5
126.186  17721.1
132.194  18884.6
138.489  19938.9
145.083  21000.2
151.991  22137
159.228  23293.1
166.81  24451.7
174.753  25548.5
183.074  26725.2
191.791  27850.6
200.923  28904
210.49  29974.4
220.513  31060.9
231.013  32089.8
242.013  33049.8
253.536  33912.4
265.609  34701.4
278.256  35486.2
291.505  36276.3
305.386  36966.2
319.927  37790.3
335.16  38464
351.119  39010.2
367.838  39503.8
385.353  40000.1
403.702  40465.3
422.924  40904.5
443.062  41255.1
464.159  41585.5
486.26  41897.2
509.414  42209.6
533.67  42529.6
559.081  42859.7
585.702  43092.3
613.591  43493.3
642.807  44040
673.415  44587.7
705.48  45114
739.072  45568.6
774.264  45999.2
811.131  46349.6
849.753  46278.5
890.215  46207.3
932.603  46160.8
977.01  46617.8
1023.53  47223.3
1072.27  47680.6
1123.32  48259.9
1176.81  48846.8
1232.85  49437.4
1291.55  49334.1
1353.05  49112
1417.47  48878.6
1484.97  49020.1
1555.68  49276.4
1629.75  49532.9
1707.35  49678.1
1788.65  49968.2
1873.82  50060.3
1963.04  49844.1
2056.51  49402.9
2154.43  48961.5
2257.02  48670.3
2364.49  48539.1
2477.08  48402.6
2595.02  48060.8
2718.59  47399.3
2848.04  46737.7
2983.65  46214.9
3125.72  46020.6
3274.55  46061.9
3430.47  45834.8
3593.81  45487.4
3764.94  45140
3944.21  44702.3
4132.01  43529.9
4328.76  42357.2
4534.88  41200.5
4750.81  41064.1
4977.02  40927.7
5214.01  40791.3
5462.28  40509.6
5722.37  39994.5
5994.84  39707.4
6280.29  39447.5
6579.33  39193.3
6892.61  38939
7220.81  39126.2
7564.63  39472.9
7924.83  39819.1
8302.18  40017.4
8697.49  40132.8
9111.63  40248.2
9545.48  40154.1
10000  39754.8

WARNING UserWarning: 48.1% of samples have been thrown away because they failed the constraints on the parameters. This result might not be suitable for error propagation. Enlarge the boundaries until you lose less than 1% ofthe samples.
Discarded samples in excluded parameter space (2406 samples):
  F: mean=0.001745, std=0.0002442, bounds=[1e-06, 1e+06]
  index: mean=-1.733, std=0.1289, bounds=[-3, 0]
  LAT10X30_IsotropicTemplate_Normalization: mean=5.004, std=0.003436, bounds=[0.1, 5]

Best fit values:

result unit
parameter
GRB.spectrum.main.Powerlaw_flux.F (1.73 -0.23 +0.26) x 10^-3 1 / (s cm2)
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.30 1.00 0.00
-0.00 0.00 1.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
We have set the min_value of GRB.spectrum.main.Powerlaw_flux.F to 1e-99 because there was a postive transform

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

100  27440.2
104.762  29467.1
109.75  31583.1
114.976  33796.3
120.45  36080.3
126.186  38526.1
132.194  41211
138.489  43654.1
145.083  46091.7
151.991  48634.5
159.228  51223.1
166.81  53816.2
174.753  56253.1
183.074  58858.2
191.791  61379
200.923  63960.7
210.49  66587.7
220.513  69257.7
231.013  71786.4
242.013  74155.2
253.536  76294.4
265.609  78153.3
278.256  79989.5
291.505  81839.2
305.386  83571.9
319.927  85632.2
335.16  87360.9
351.119  88787
367.838  90088.8
385.353  91398.2
403.702  92547.8
422.924  93580.2
443.062  94396.1
464.159  95194.3
486.26  95976.2
509.414  96759.8
533.67  97492.2
559.081  98153.8
585.702  98592
613.591  99358.6
642.807  100338
673.415  101319
705.48  102383
739.072  103715
774.264  104987
811.131  106100
849.753  106417
890.215  106734
932.603  107077
977.01  107920
1023.53  109129
1072.27  109974
1123.32  110944
1176.81  111925
1232.85  112918
1291.55  112627
1353.05  112112
1417.47  111568
1484.97  111881
1555.68  112455
1629.75  113029
1707.35  113229
1788.65  113673
1873.82  113688
1963.04  113330
2056.51  112699
2154.43  112067
2257.02  111365
2364.49  110587
2477.08  109797
2595.02  109195
2718.59  108887
2848.04  108579
2983.65  107987
3125.72  106723
3274.55  105950
3430.47  104692
3593.81  103496
3764.94  102301
3944.21  100983
4132.01  98662.6
4328.76  96341.7
4534.88  94049.7
4750.81  93604.7
4977.02  93159.7
5214.01  92714.6
5462.28  91479.5
5722.37  89701.6
5994.84  88414.7
6280.29  87875.6
6579.33  87491.8
6892.61  87107.9
7220.81  87173.6
7564.63  87401.5
7924.83  87627.4
8302.18  87904.7
8697.49  88210.8
9111.63  88517
9545.48  88229.6
10000  87176.2

WARNING UserWarning: 50.2% of samples have been thrown away because they failed the constraints on the parameters. This result might not be suitable for error propagation. Enlarge the boundaries until you lose less than 1% ofthe samples.
Discarded samples in excluded parameter space (2508 samples):
  F: mean=0.0004283, std=7.881e-05, bounds=[1e-06, 1e+06]
  index: mean=-1.51, std=0.1536, bounds=[-3, 0]
  LAT30X80_IsotropicTemplate_Normalization: mean=0.0189, std=0.06091, bounds=[0.1, 5]

Best fit values:

result unit
parameter
GRB.spectrum.main.Powerlaw_flux.F (4.2 -0.7 +0.8) x 10^-4 1 / (s cm2)
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.28 1.00 0.00
-0.00 0.00 1.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
We have set the min_value of GRB.spectrum.main.Powerlaw_flux.F to 1e-99 because there was a postive transform

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

100  31526.7
104.762  34087
109.75  36773.9
114.976  39591.3
120.45  42508.5
126.186  45717.7
132.194  49389.2
138.489  52772.5
145.083  56077.3
151.991  59277
159.228  62548
166.81  65934.4
174.753  69611
183.074  73597.1
191.791  77436.4
200.923  81308
210.49  85261.6
220.513  89293.9
231.013  93437.8
242.013  97349.7
253.536  100906
265.609  104219
278.256  107530
291.505  110873
305.386  113859
319.927  117187
335.16  120137
351.119  122945
367.838  125706
385.353  128490
403.702  130628
422.924  132321
443.062  133620
464.159  134801
486.26  135869
509.414  136941
533.67  137999
559.081  139039
585.702  139572
613.591  140575
642.807  141500
673.415  142426
705.48  143787
739.072  146576
774.264  149247
811.131  151651
849.753  152760
890.215  153870
932.603  154981
977.01  156090
1023.53  158515
1072.27  159639
1123.32  159895
1176.81  160114
1232.85  160351
1291.55  160684
1353.05  161006
1417.47  161269
1484.97  161392
1555.68  161471
1629.75  161550
1707.35  161322
1788.65  160913
1873.82  160530
1963.04  160303
2056.51  160189
2154.43  160076
2257.02  159003
2364.49  156908
2477.08  154800
2595.02  153707
2718.59  154200
2848.04  154692
2983.65  154251
3125.72  151604
3274.55  149820
3430.47  147238
3593.81  144994
3764.94  142750
3944.21  140322
4132.01  136394
4328.76  132463
4534.88  128576
4750.81  127600
4977.02  126624
5214.01  125648
5462.28  122443
5722.37  118556
5994.84  115182
6280.29  114697
6579.33  114813
6892.61  114928
7220.81  114120
7564.63  112976
7924.83  111823
8302.18  111634
8697.49  111985
9111.63  112336
9545.48  111965
10000  109344

WARNING UserWarning: 50.4% of samples have been thrown away because they failed the constraints on the parameters. This result might not be suitable for error propagation. Enlarge the boundaries until you lose less than 1% ofthe samples.
Discarded samples in excluded parameter space (2519 samples):
  F: mean=7.392e-05, std=3.525e-05, bounds=[1e-06, 1e+06]
  index: mean=-1.743, std=0.381, bounds=[-3, 0]
  LAT80X180_IsotropicTemplate_Normalization: mean=5.037, std=0.02723, bounds=[0.1, 5]

Best fit values:

result unit
parameter
GRB.spectrum.main.Powerlaw_flux.F (6.7 -2.5 +4) x 10^-5 1 / (s cm2)
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.40 1.00 0.00
-0.00 0.00 1.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 use this 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 / (s cm2)
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.31 1.00 0.00
-0.00 0.00 1.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

Now 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])

WARNING SyntaxWarning: invalid escape sequence '\g'


WARNING SyntaxWarning: invalid escape sequence '\g'


WARNING SyntaxWarning: invalid escape sequence '\g'

../_images/notebooks_LAT_Transient_Builder_Example_30_1.png

Finally, you can also compute the TS in all time intervals and print their values

[18]:
TS = {}
for a in results.values():
    TS[list(a.data_list.keys())[0]] = a.compute_TS(
        "GRB", a.results.get_statistic_frame()
    )["TS"].iloc[0]

for key, value in TS.items():
    print(key, value)

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

External parameter LAT0X10_GalacticTemplate_Value already exist in the model. Overwriting it...
External parameter LAT0X10_IsotropicTemplate_Normalization already exist in the model. Overwriting it...

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

100  6363.07
104.762  6836.44
109.75  7318.3
114.976  7807.69
120.45  8312.42
126.186  8848.68
132.194  9429.85
138.489  9956.52
145.083  10486.7
151.991  11054.6
159.228  11632.1
166.81  12211
174.753  12759
183.074  13346.9
191.791  13909.2
200.923  14435.5
210.49  14970.1
220.513  15512.9
231.013  16026.9
242.013  16506.4
253.536  16937.4
265.609  17331.6
278.256  17723.7
291.505  18118.4
305.386  18463.1
319.927  18874.9
335.16  19211.5
351.119  19484.5
367.838  19731.1
385.353  19979.2
403.702  20211.6
422.924  20431.2
443.062  20606.4
464.159  20771.6
486.26  20927.5
509.414  21083.6
533.67  21243.6
559.081  21408.7
585.702  21525
613.591  21725.5
642.807  21998.7
673.415  22272.5
705.48  22535.5
739.072  22762.8
774.264  22978
811.131  23153.3
849.753  23117.9
890.215  23082.5
932.603  23059.4
977.01  23287.9
1023.53  23590.5
1072.27  23819.1
1123.32  24108.7
1176.81  24402
1232.85  24697.1
1291.55  24645.5
1353.05  24534.6
1417.47  24418
1484.97  24488.7
1555.68  24616.8
1629.75  24745
1707.35  24817.6
1788.65  24962.5
1873.82  25008.5
1963.04  24900.6
2056.51  24680.2
2154.43  24459.7
2257.02  24314.3
2364.49  24248.7
2477.08  24180.6
2595.02  24009.8
2718.59  23679.4
2848.04  23348.9
2983.65  23087.8
3125.72  22990.8
3274.55  23011.4
3430.47  22898
3593.81  22724.4
3764.94  22550.9
3944.21  22332.3
4132.01  21746.6
4328.76  21160.8
4534.88  20582.9
4750.81  20514.8
4977.02  20446.7
5214.01  20378.6
5462.28  20237.9
5722.37  19980.6
5994.84  19837.1
6280.29  19707.3
6579.33  19580.4
6892.61  19453.4
7220.81  19546.9
7564.63  19720.1
7924.83  19893.1
8302.18  19992.2
8697.49  20049.9
9111.63  20107.5
9545.48  20060.6
10000  19861.1
External parameter LAT0X10_GalacticTemplate_Value already exist in the model. Overwriting it...
External parameter LAT0X10_IsotropicTemplate_Normalization already exist in the model. Overwriting it...

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

External parameter LAT10X30_GalacticTemplate_Value already exist in the model. Overwriting it...
External parameter LAT10X30_IsotropicTemplate_Normalization already exist in the model. Overwriting it...

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

External parameter LAT10X30_GalacticTemplate_Value already exist in the model. Overwriting it...
External parameter LAT10X30_IsotropicTemplate_Normalization already exist in the model. Overwriting it...
100  12744.5
104.762  13692.3
109.75  14657.1
114.976  15637
120.45  16647.5
126.186  17721.1
132.194  18884.6
138.489  19938.9
145.083  21000.2
151.991  22137
159.228  23293.1
166.81  24451.7
174.753  25548.5
183.074  26725.2
191.791  27850.6
200.923  28904
210.49  29974.4
220.513  31060.9
231.013  32089.8
242.013  33049.8
253.536  33912.4
265.609  34701.4
278.256  35486.2
291.505  36276.3
305.386  36966.2
319.927  37790.3
335.16  38464
351.119  39010.2
367.838  39503.8
385.353  40000.1
403.702  40465.3
422.924  40904.5
443.062  41255.1
464.159  41585.5
486.26  41897.2
509.414  42209.6
533.67  42529.6
559.081  42859.7
585.702  43092.3
613.591  43493.3
642.807  44040
673.415  44587.7
705.48  45114
739.072  45568.6
774.264  45999.2
811.131  46349.6
849.753  46278.5
890.215  46207.3
932.603  46160.8
977.01  46617.8
1023.53  47223.3
1072.27  47680.6
1123.32  48259.9
1176.81  48846.8
1232.85  49437.4
1291.55  49334.1
1353.05  49112
1417.47  48878.6
1484.97  49020.1
1555.68  49276.4
1629.75  49532.9
1707.35  49678.1
1788.65  49968.2
1873.82  50060.3
1963.04  49844.1
2056.51  49402.9
2154.43  48961.5
2257.02  48670.3
2364.49  48539.1
2477.08  48402.6
2595.02  48060.8
2718.59  47399.3
2848.04  46737.7
2983.65  46214.9
3125.72  46020.6
3274.55  46061.9
3430.47  45834.8
3593.81  45487.4
3764.94  45140
3944.21  44702.3
4132.01  43529.9
4328.76  42357.2
4534.88  41200.5
4750.81  41064.1
4977.02  40927.7
5214.01  40791.3
5462.28  40509.6
5722.37  39994.5
5994.84  39707.4
6280.29  39447.5
6579.33  39193.3
6892.61  38939
7220.81  39126.2
7564.63  39472.9
7924.83  39819.1
8302.18  40017.4
8697.49  40132.8
9111.63  40248.2
9545.48  40154.1
10000  39754.8

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

External parameter LAT30X80_GalacticTemplate_Value already exist in the model. Overwriting it...
External parameter LAT30X80_IsotropicTemplate_Normalization already exist in the model. Overwriting it...

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

External parameter LAT30X80_GalacticTemplate_Value already exist in the model. Overwriting it...
External parameter LAT30X80_IsotropicTemplate_Normalization already exist in the model. Overwriting it...
100  27440.2
104.762  29467.1
109.75  31583.1
114.976  33796.3
120.45  36080.3
126.186  38526.1
132.194  41211
138.489  43654.1
145.083  46091.7
151.991  48634.5
159.228  51223.1
166.81  53816.2
174.753  56253.1
183.074  58858.2
191.791  61379
200.923  63960.7
210.49  66587.7
220.513  69257.7
231.013  71786.4
242.013  74155.2
253.536  76294.4
265.609  78153.3
278.256  79989.5
291.505  81839.2
305.386  83571.9
319.927  85632.2
335.16  87360.9
351.119  88787
367.838  90088.8
385.353  91398.2
403.702  92547.8
422.924  93580.2
443.062  94396.1
464.159  95194.3
486.26  95976.2
509.414  96759.8
533.67  97492.2
559.081  98153.8
585.702  98592
613.591  99358.6
642.807  100338
673.415  101319
705.48  102383
739.072  103715
774.264  104987
811.131  106100
849.753  106417
890.215  106734
932.603  107077
977.01  107920
1023.53  109129
1072.27  109974
1123.32  110944
1176.81  111925
1232.85  112918
1291.55  112627
1353.05  112112
1417.47  111568
1484.97  111881
1555.68  112455
1629.75  113029
1707.35  113229
1788.65  113673
1873.82  113688
1963.04  113330
2056.51  112699
2154.43  112067
2257.02  111365
2364.49  110587
2477.08  109797
2595.02  109195
2718.59  108887
2848.04  108579
2983.65  107987
3125.72  106723
3274.55  105950
3430.47  104692
3593.81  103496
3764.94  102301
3944.21  100983
4132.01  98662.6
4328.76  96341.7
4534.88  94049.7
4750.81  93604.7
4977.02  93159.7
5214.01  92714.6
5462.28  91479.5
5722.37  89701.6
5994.84  88414.7
6280.29  87875.6
6579.33  87491.8
6892.61  87107.9
7220.81  87173.6
7564.63  87401.5
7924.83  87627.4
8302.18  87904.7
8697.49  88210.8
9111.63  88517
9545.48  88229.6
10000  87176.2

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

External parameter LAT80X180_GalacticTemplate_Value already exist in the model. Overwriting it...
External parameter LAT80X180_IsotropicTemplate_Normalization already exist in the model. Overwriting it...

Found Isotropic template for irf P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/iso_P8R3_TRANSIENT020E_V3_v1.txt

Found Galactic template for IRF. P8R3_TRANSIENT020E_V3: /home/runner/miniconda3/envs/test_env/share/fermitools/refdata/fermi/galdiffuse/gll_iem_v07.fits

Cutting the template around the ROI:

External parameter LAT80X180_GalacticTemplate_Value already exist in the model. Overwriting it...
External parameter LAT80X180_IsotropicTemplate_Normalization already exist in the model. Overwriting it...
100  31526.7
104.762  34087
109.75  36773.9
114.976  39591.3
120.45  42508.5
126.186  45717.7
132.194  49389.2
138.489  52772.5
145.083  56077.3
151.991  59277
159.228  62548
166.81  65934.4
174.753  69611
183.074  73597.1
191.791  77436.4
200.923  81308
210.49  85261.6
220.513  89293.9
231.013  93437.8
242.013  97349.7
253.536  100906
265.609  104219
278.256  107530
291.505  110873
305.386  113859
319.927  117187
335.16  120137
351.119  122945
367.838  125706
385.353  128490
403.702  130628
422.924  132321
443.062  133620
464.159  134801
486.26  135869
509.414  136941
533.67  137999
559.081  139039
585.702  139572
613.591  140575
642.807  141500
673.415  142426
705.48  143787
739.072  146576
774.264  149247
811.131  151651
849.753  152760
890.215  153870
932.603  154981
977.01  156090
1023.53  158515
1072.27  159639
1123.32  159895
1176.81  160114
1232.85  160351
1291.55  160684
1353.05  161006
1417.47  161269
1484.97  161392
1555.68  161471
1629.75  161550
1707.35  161322
1788.65  160913
1873.82  160530
1963.04  160303
2056.51  160189
2154.43  160076
2257.02  159003
2364.49  156908
2477.08  154800
2595.02  153707
2718.59  154200
2848.04  154692
2983.65  154251
3125.72  151604
3274.55  149820
3430.47  147238
3593.81  144994
3764.94  142750
3944.21  140322
4132.01  136394
4328.76  132463
4534.88  128576
4750.81  127600
4977.02  126624
5214.01  125648
5462.28  122443
5722.37  118556
5994.84  115182
6280.29  114697
6579.33  114813
6892.61  114928
7220.81  114120
7564.63  112976
7924.83  111823
8302.18  111634
8697.49  111985
9111.63  112336
9545.48  111965
10000  109344
LAT0X10 2231.993434267472
LAT10X30 699.1820480343359
LAT30X80 427.30998756734414
LAT80X180 40.74619555315499