Fermipy tools to improve a model

In this notebook I show how to use Fermipy in order to improve the model for an roi. This is done in a ROI centered on M31 (Andromeda Galaxy).

I report below the configuration file that we are going to use.

data: evfile : '/u/gl/mdimauro/dmcat/workdir/mattia/LogNLogS_Ebins/files_bins/bin031000/P8_SOURCE_zmax90_03_1000_gtselect.fits' scfile : '/u/gl/mdimauro/kipac/workdir/files/SC/P8_104months_ft2.fits' ltcube : '/u/gl/mdimauro/dmcat/workdir/mattia/LogNLogS_Ebins/files_bins/bin13/P8_SOURCE_zmax105_1_3_ltcube.fits' binning: roiwidth : 12.0 binsz : 0.06 binsperdec : 8 coordsys : 'GAL' selection : emin : 300 emax : 1000000 tmin : 239557417 tmax : 512994417 zmax : 105 evclass : 128 evtype : 3 glon: 121.174 glat: -21.572 gtlike: edisp : True irfs : 'P8R2_SOURCE_V6' edisp_disable : ['isodiff','galdiff'] model: src_roiwidth : 12.0 galdiff : '$FERMI_DIFFUSE_DIR/gll_iem_v06.fits' isodiff : '$FERMI_DIFFUSE_DIR/iso_P8R2_SOURCE_V6_v06.txt' catalogs: gll_psc_v16.fit fileio: usescratch: False

We first import a few packages:


In [30]:
%matplotlib inline

import os
import numpy as np
from fermipy.gtanalysis import GTAnalysis
from fermipy.plotting import ROIPlotter, SEDPlotter
import matplotlib.pyplot as plt
import matplotlib
from IPython.display import Image
from math import *

We can save in the folder this configuration file making


In [13]:
if os.path.isfile('../data/M31_data.tar.gz'):
    !tar xzf ../data/M31_data.tar.gz
else:
    !curl -OL https://raw.githubusercontent.com/fermiPy/fermipy-extras/master/data/M31_data.tar.gz
    !tar xzf M31_data.tar.gz

In [15]:
gta = GTAnalysis('config_M31.yaml')
matplotlib.interactive(True)
gta.setup()


2018-03-31 16:43:51 INFO    GTAnalysis.__init__(): 
--------------------------------------------------------------------------------
fermipy version 0.16.0+175.ge34f 
ScienceTools version ScienceTools-11-07-00
2018-03-31 16:43:53 INFO    GTAnalysis.setup(): Running setup.
2018-03-31 16:43:53 INFO    GTBinnedAnalysis.setup(): Running setup for component 00
2018-03-31 16:43:53 INFO    GTBinnedAnalysis.run_gtapp(): Running gtselect.
2018-03-31 16:43:53 INFO    GTBinnedAnalysis.run_gtapp(): time -p gtselect infile=/u/gl/mdimauro/dmcat/workdir/mattia/LogNLogS_Ebins/files_bins/bin031000/P8_SOURCE_zmax90_03_1000_gtselect.fits outfile=/nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/ft1_00.fits ra=10.6842382149 dec=41.2700468202 rad=8.98528137424 tmin=239557417.0 tmax=512994417.0 emin=300.0 emax=500000.0 zmin=0.0 zmax=105.0 evclass=128 evtype=3 convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=3 clobber=yes debug=no gui=no mode="ql"
2018-03-31 16:46:58 INFO    GTBinnedAnalysis.run_gtapp(): This is gtselect version ScienceTools-11-07-00
2018-03-31 16:46:58 INFO    GTBinnedAnalysis.run_gtapp(): Applying filter string: ((EVENT_CLASS&o200) != o0) && ((EVENT_TYPE&o3) != o0) && angsep(RA,DEC,10.68423821,41.27004682) < 8.985281374 && 300 < ENERGY && ENERGY <= 500000 && 239557417 < TIME && TIME <= 512994417 && 0 < ZENITH_ANGLE && ZENITH_ANGLE <= 90 && gtifilter()
2018-03-31 16:46:58 INFO    GTBinnedAnalysis.run_gtapp(): Done.
2018-03-31 16:46:58 INFO    GTBinnedAnalysis.run_gtapp(): Finished gtselect. Execution time: 185.00 s
2018-03-31 16:46:58 INFO    GTBinnedAnalysis.setup(): Using external LT cube.
2018-03-31 16:46:59 INFO    GTBinnedAnalysis.run_gtapp(): Running gtbin.
2018-03-31 16:46:59 INFO    GTBinnedAnalysis.run_gtapp(): time -p gtbin evfile=/nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/ft1_00.fits scfile=/u/gl/mdimauro/kipac/workdir/files/SC/P8_104months_ft2.fits outfile=/nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/ccube_00.fits algorithm="ccube" ebinalg="LOG" emin=300.0 emax=500000.0 enumbins=26 ebinfile=NONE tbinalg="LIN" tbinfile=NONE nxpix=200 nypix=200 binsz=0.06 coordsys="GAL" xref=121.174 yref=-21.572 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=3 clobber=yes debug=no gui=no mode="ql"
2018-03-31 16:47:08 INFO    GTBinnedAnalysis.run_gtapp(): This is gtbin version ScienceTools-11-07-00
2018-03-31 16:47:08 INFO    GTBinnedAnalysis.run_gtapp(): Finished gtbin. Execution time: 8.46 s
2018-03-31 16:47:08 INFO    GTBinnedAnalysis.run_gtapp(): Running gtexpcube2.
2018-03-31 16:47:08 INFO    GTBinnedAnalysis.run_gtapp(): time -p gtexpcube2 infile=/u/gl/mdimauro/dmcat/workdir/mattia/LogNLogS_Ebins/files_bins/bin13/P8_SOURCE_zmax105_1_3_ltcube.fits cmap=none outfile=/nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/bexpmap_00.fits irfs="P8R2_SOURCE_V6" evtype=3 nxpix=360 nypix=180 binsz=1.0 coordsys="GAL" xref=0.0 yref=0.0 axisrot=0.0 proj="CAR" ebinalg="LOG" emin=300.0 emax=500000.0 enumbins=26 ebinfile="NONE" hpx_ordering_scheme="RING" hpx_order=6 bincalc="EDGE" ignorephi=no thmax=180.0 thmin=0.0 table="EXPOSURE" chatter=3 clobber=yes debug=no mode="ql"
2018-03-31 16:47:26 INFO    GTBinnedAnalysis.run_gtapp(): This is gtexpcube2 version ScienceTools-11-07-00
2018-03-31 16:47:26 INFO    GTBinnedAnalysis.run_gtapp(): Using evtype=3 (i.e., FRONT/BACK irfs)
2018-03-31 16:47:26 INFO    GTBinnedAnalysis.run_gtapp(): ResponseFunctions::load: IRF used: P8R2_SOURCE_V6
2018-03-31 16:47:26 INFO    GTBinnedAnalysis.run_gtapp(): event_types:  0  1
2018-03-31 16:47:26 INFO    GTBinnedAnalysis.run_gtapp(): Computing binned exposure map....................!
2018-03-31 16:47:26 INFO    GTBinnedAnalysis.run_gtapp(): Finished gtexpcube2. Execution time: 18.22 s
2018-03-31 16:47:26 INFO    GTBinnedAnalysis.run_gtapp(): Running gtexpcube2.
2018-03-31 16:47:26 INFO    GTBinnedAnalysis.run_gtapp(): time -p gtexpcube2 infile=/u/gl/mdimauro/dmcat/workdir/mattia/LogNLogS_Ebins/files_bins/bin13/P8_SOURCE_zmax105_1_3_ltcube.fits cmap=none outfile=/nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/bexpmap_roi_00.fits irfs="P8R2_SOURCE_V6" evtype=3 nxpix=200 nypix=200 binsz=0.06 coordsys="GAL" xref=121.174 yref=-21.572 axisrot=0.0 proj="CAR" ebinalg="LOG" emin=300.0 emax=500000.0 enumbins=26 ebinfile="NONE" hpx_ordering_scheme="RING" hpx_order=6 bincalc="EDGE" ignorephi=no thmax=180.0 thmin=0.0 table="EXPOSURE" chatter=3 clobber=yes debug=no mode="ql"
2018-03-31 16:47:38 INFO    GTBinnedAnalysis.run_gtapp(): This is gtexpcube2 version ScienceTools-11-07-00
2018-03-31 16:47:38 INFO    GTBinnedAnalysis.run_gtapp(): Using evtype=3 (i.e., FRONT/BACK irfs)
2018-03-31 16:47:38 INFO    GTBinnedAnalysis.run_gtapp(): ResponseFunctions::load: IRF used: P8R2_SOURCE_V6
2018-03-31 16:47:38 INFO    GTBinnedAnalysis.run_gtapp(): event_types:  0  1
2018-03-31 16:47:38 INFO    GTBinnedAnalysis.run_gtapp(): Computing binned exposure map....................!
2018-03-31 16:47:38 INFO    GTBinnedAnalysis.run_gtapp(): Finished gtexpcube2. Execution time: 12.12 s
2018-03-31 16:47:38 INFO    GTBinnedAnalysis.run_gtapp(): Running gtsrcmaps.
2018-03-31 16:47:38 INFO    GTBinnedAnalysis.run_gtapp(): time -p gtsrcmaps scfile=/u/gl/mdimauro/kipac/workdir/files/SC/P8_104months_ft2.fits sctable="SC_DATA" expcube=/u/gl/mdimauro/dmcat/workdir/mattia/LogNLogS_Ebins/files_bins/bin13/P8_SOURCE_zmax105_1_3_ltcube.fits cmap=/nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/ccube_00.fits srcmdl=/nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/srcmdl_00.xml bexpmap=/nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/bexpmap_00.fits wmap=none outfile=/nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/srcmap_00.fits irfs="P8R2_SOURCE_V6" evtype=3 convol=yes resample=yes rfactor=2 minbinsz=0.05 ptsrc=yes psfcorr=yes emapbnds=no copyall=no chatter=3 clobber=yes debug=no gui=no mode="ql"
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): This is gtsrcmaps version ScienceTools-11-07-00
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Using evtype=3 (i.e., FRONT/BACK irfs)
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): ResponseFunctions::load: IRF used: P8R2_SOURCE_V6
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): event_types:  0  1
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): difference in gti interval found
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): 
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): WARNING:
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): AppHelpers::checkTimeCuts:
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Time range cuts and GTI extensions in files /nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/ccube_00.fitsand /u/gl/mdimauro/dmcat/workdir/mattia/LogNLogS_Ebins/files_bins/bin13/P8_SOURCE_zmax105_1_3_ltcube.fits[Exposure] do not agree.
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Aggregate absolute differences in GTI start times (s): 1.96803e+10
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Aggregate absolute differences in GTI stop times (s): 1.96802e+10
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): 
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): 
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0042.5+4117
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0040.3+4049
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0049.0+4224
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0048.0+3950
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0039.1+4330
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0032.5+3912
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0102.3+4217
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0041.9+3639
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0105.3+3928
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0023.5+4454
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0102.1+4458
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named 3FGL J0022.7+4651
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named isodiff
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Creating source named galdiff
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0022.7+4651....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0023.5+4454....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0032.5+3912....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0039.1+4330....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0040.3+4049....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0041.9+3639....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0042.5+4117....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0048.0+3950....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0049.0+4224....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0102.1+4458....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0102.3+4217....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for 3FGL J0105.3+3928....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for galdiff....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Generating SourceMap for isodiff....................!
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.run_gtapp(): Finished gtsrcmaps. Execution time: 339.84 s
2018-03-31 16:53:18 INFO    GTBinnedAnalysis.setup(): Finished setup for component 00
2018-03-31 16:53:18 INFO    GTBinnedAnalysis._create_binned_analysis(): Creating BinnedAnalysis for component 00.
2018-03-31 16:53:45 INFO    GTAnalysis.setup(): Initializing source properties
2018-03-31 16:53:45 INFO    GTAnalysis.setup(): Finished setup.

The model includes the IEM, isotropic template and 3FGL sources.


In [16]:
gta.print_model()


2018-03-31 16:55:02 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.049   2.409  1.99e-06   2.56       nan       707.1     
3FGL J0040.3+4049      0.640   0.422   6.4e-06   1.13       nan        52.4     
3FGL J0049.0+4224      1.635   0.856  3.11e-06   1.77       nan       223.6     
3FGL J0048.0+3950      1.745   0.429  4.65e-06   1.88       nan       461.3     
3FGL J0039.1+4330      2.326   0.445  2.67e-06   1.96       nan       346.5     
3FGL J0032.5+3912      2.825   0.791  1.28e-06   2.56       nan       444.1     
3FGL J0102.3+4217      3.800   0.982  2.94e-06   2.69       nan      1139.8     
3FGL J0041.9+3639      4.611   1.768   1.7e-06   1.98       nan       205.6     
3FGL J0105.3+3928      4.661   0.591  2.43e-06   2.33       nan       614.4     
3FGL J0023.5+4454      5.052   2.474  2.49e-06   2.57       nan       867.2     
3FGL J0102.1+4458      5.121   1.034  1.43e-06   2.27       nan       346.4     
3FGL J0022.7+4651      6.635   2.881   1.1e-06   2.78       nan       304.5     
isodiff                  ---   1.000    0.0444   2.12       nan     36342.1     
galdiff                  ---   1.000     0.206   0.00       nan     87589.0     

We will make first a fit of the roi. I free sources and then I use gta.optimize()


In [17]:
gta.free_sources()
gta.optimize()


2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0032.5+3912     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0102.3+4217     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0041.9+3639     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0105.3+3928     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0023.5+4454     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0102.1+4458     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0022.7+4651     : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 16:56:00 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 16:56:00 INFO    GTAnalysis.optimize(): Starting
Joint fit  ['galdiff', 'isodiff']
/u/gl/mdimauro/kipac/software/anaconda/lib/python2.7/site-packages/scipy/interpolate/fitpack2.py:226: UserWarning: 
The maximal number of iterations maxit (set to 20 by the program)
allowed for finding a smoothing spline with fp=s has been reached: s
too small.
There is an approximation returned but the corresponding weighted sum
of squared residuals does not satisfy the condition abs(fp-s)/s < tol.
  warnings.warn(message)
Fitting shape galdiff TS:   5052.125
Fitting shape isodiff TS:   1305.996
Fitting shape 3FGL J0048.0+3950 TS:    450.476
Fitting shape 3FGL J0023.5+4454 TS:    200.014
Fitting shape 3FGL J0105.3+3928 TS:    180.109
Fitting shape 3FGL J0102.3+4217 TS:    161.168
Fitting shape 3FGL J0042.5+4117 TS:    101.650
Fitting shape 3FGL J0041.9+3639 TS:     72.654
Fitting shape 3FGL J0039.1+4330 TS:     71.413
Fitting shape 3FGL J0040.3+4049 TS:     55.198
Fitting shape 3FGL J0049.0+4224 TS:     36.209
Fitting shape 3FGL J0032.5+3912 TS:     26.955
2018-03-31 16:56:24 INFO    GTAnalysis.optimize(): Finished
2018-03-31 16:56:24 INFO    GTAnalysis.optimize(): LogLike: -241428.100799 Delta-LogLike: 486.588669
2018-03-31 16:56:24 INFO    GTAnalysis.optimize(): Execution time: 24.44 s
Out[17]:
{'config': {'max_free_sources': 5,
  'npred_frac': 0.95,
  'npred_threshold': 1.0,
  'optimizer': {'init_lambda': 0.0001,
   'max_iter': 100,
   'min_fit_quality': 2,
   'optimizer': 'MINUIT',
   'retries': 3,
   'tol': 0.001,
   'verbosity': 0},
  'shape_ts_threshold': 25.0,
  'skip': []},
 'dloglike': 486.58866886023316,
 'loglike0': -241914.68946829514,
 'loglike1': -241428.1007994349}

Then, I use gta.fit() to make a more robust fit.


In [18]:
gta.fit()
gta.print_model()
gta.write_roi('initial',make_plots=True,save_model_map=True)


2018-03-31 16:57:16 INFO    GTAnalysis.fit(): Starting fit.
2018-03-31 16:59:32 ERROR   GTAnalysis.fit(): MINUIT failed with status code 102 fit quality 2
2018-03-31 16:59:32 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.049   2.232  1.56e-06   2.77    100.16       650.2    *
3FGL J0040.3+4049      0.640   0.207  1.85e-06   1.76     65.34       129.4    *
3FGL J0049.0+4224      1.635   0.345  1.21e-06   1.78     33.11        92.7    *
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5    *
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2    *
3FGL J0032.5+3912      2.825   0.485  6.82e-07   2.87     22.82       293.3    *
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8    *
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1    *
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3    *
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8    *
3FGL J0102.1+4458      5.121   0.423  5.83e-07   2.27     17.48       141.7    *
3FGL J0022.7+4651      6.635   1.167  4.45e-07   2.78      7.52       123.4    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *

2018-03-31 16:59:32 INFO    GTBinnedAnalysis.write_xml(): Writing /nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/initial_00.xml...
2018-03-31 16:59:32 INFO    GTAnalysis.write_fits(): Writing /nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/initial.fits...
WARNING: AstropyDeprecationWarning: "clobber" was deprecated in version 2.0 and will be removed in a future version. Use argument "overwrite" instead. [astropy.utils.decorators]
2018-03-31 16:59:34 INFO    GTBinnedAnalysis.write_model_map(): Generating model map for component 00.
2018-03-31 16:59:38 INFO    GTAnalysis.write_roi(): Writing /nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/initial.npy...

We see how the model is a good representation of the ROI computing the TS map using gta.tsmap.


In [19]:
tsmap_postfit = gta.tsmap(prefix='TSmap_start',make_plots=True,write_fits=True,write_npy=True)
%matplotlib inline
fig = plt.figure(figsize=(14,6))
ROIPlotter(tsmap_postfit['sqrt_ts'],roi=gta.roi).plot(levels=[0,3,5,7],vmin=0,vmax=5,subplot=121,cmap='magma')
plt.gca().set_title('Sqrt(TS)')
ROIPlotter(tsmap_postfit['npred'],roi=gta.roi).plot(vmin=0,vmax=100,subplot=122,cmap='magma')
plt.gca().set_title('NPred')


2018-03-31 16:59:56 INFO    GTAnalysis.tsmap(): Generating TS map
WARNING: AstropyDeprecationWarning: "clobber" was deprecated in version 2.0 and will be removed in a future version. Use argument "overwrite" instead. [astropy.utils.decorators]
2018-03-31 17:00:02 INFO    GTAnalysis._make_tsmap_fast(): Fitting test source.
2018-03-31 17:05:05 INFO    GTAnalysis.tsmap(): Finished TS map
2018-03-31 17:05:05 INFO    GTAnalysis.tsmap(): Execution time: 308.46 s
Out[19]:
Text(0.5,1,u'NPred')

Then, we can use the tool gta.residmap to calculatge the residuals.


In [25]:
resid = gta.residmap('SMC_postfit',model={'SpatialModel' : 'PointSource', 'Index' : 2.0},write_fits=True,write_npy=True,make_plots=True)
fig = plt.figure(figsize=(14,6))
ROIPlotter(resid['data'],roi=gta.roi).plot(vmin=1000,vmax=3000,subplot=121,cmap='magma')
plt.gca().set_title('Data')
ROIPlotter(resid['model'],roi=gta.roi).plot(vmin=1000,vmax=3000,subplot=122,cmap='magma')
plt.gca().set_title('Model')

fig = plt.figure(figsize=(14,6))
ROIPlotter(resid['sigma'],roi=gta.roi).plot(vmin=-5,vmax=5,levels=[-5,-3,3,5],subplot=121,cmap='RdBu_r')
plt.gca().set_title('Significance')
ROIPlotter(resid['excess'],roi=gta.roi).plot(vmin=-100,vmax=100,subplot=122,cmap='RdBu_r')
plt.gca().set_title('Excess')


2018-03-31 17:08:16 INFO    GTAnalysis.residmap(): Generating residual maps
2018-03-31 17:08:16 INFO    GTAnalysis.add_source(): Adding source residmap_testsource
2018-03-31 17:08:20 INFO    GTAnalysis.delete_source(): Deleting source residmap_testsource
2018-03-31 17:08:26 INFO    GTAnalysis.residmap(): Finished residual maps
2018-03-31 17:08:26 INFO    GTAnalysis.residmap(): Execution time: 10.26 s
Out[25]:
Text(0.5,1,u'Excess')

As we can see there are large residuals in the TS map and in the residuals map. Therefore, we certainly have to improve our model.


In [32]:
gta.delete_sources(minmax_ts=[None,25])


2018-03-31 17:20:23 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0032.5+3912
2018-03-31 17:20:23 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0102.1+4458
2018-03-31 17:20:23 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0022.7+4651
Out[32]:
[<fermipy.roi_model.Source at 0x7fd1a224b9d0>,
 <fermipy.roi_model.Source at 0x7fd1a066ce10>,
 <fermipy.roi_model.Source at 0x7fd1a2822610>]

In [31]:
gta.load_roi('initial')


2018-03-31 17:19:32 INFO    GTAnalysis.load_roi(): Loading ROI file: /nfs/slac/kipac/fs1/u/mdimauro/software/fermipy-extra/notebooks/initial.npy
2018-03-31 17:19:33 INFO    GTBinnedAnalysis._create_binned_analysis(): Creating BinnedAnalysis for component 00.
2018-03-31 17:19:59 INFO    GTAnalysis.load_roi(): Finished Loading ROI

Source Localization

The first thing to do in order to improve the model is to relocalize the sources of your model. In particular in our case where we have 3FGL source this is particularly requested.

The localize() method can be used to spatially localize a source. Localization is performed by scanning the likelihood surface in source position in a local patch around the nominal source position. The fit to the source position proceeds in two iterations: TS Map Scan: Obtain a first estimate of the source position by generating a likelihood map of the region using the tsmap method. In this step all background parameters are fixed to their nominal values. The size of the search region used for this step is set with the dtheta_max parameter. Likelihood Scan: Refine the position of the source by performing a scan of the likelihood surface in a box centered on the best-fit position found in the first iteration. The size of the search region is set to encompass the 99% positional uncertainty contour. This method uses a full likelihood fit at each point in the likelihood scan and will re-fit all free parameters of the model. If a peak is found in the search region and the positional fit succeeds, the method will update the position of the source in the model to the new best-fit position.

We will localize all the sources in the model. We include a function to calculate the angular distance from two directions in the sky.


In [27]:
def angular_distance_gal(L_1,L_2,B_1,B_2):
    xx = sqrt(2.-2.*sin(B_1)*sin(B_2)-2.*cos(B_1)*cos(B_2)*cos(L_1-L_2))
    return xx

In [33]:
glon0 = np.zeros(len(gta.roi.sources))
glat0 = np.zeros(len(gta.roi.sources))
glon1 = np.zeros(len(gta.roi.sources))
glat1 = np.zeros(len(gta.roi.sources))
offset = np.zeros(len(gta.roi.sources))

for t in range(len(gta.roi.sources)-2):
    print ""
    print "Renormalization of source %s"%gta.roi.sources[t].name
    print ""
    glon0[t] = gta.roi[gta.roi.sources[t].name]['glon']
    glat0[t] = gta.roi[gta.roi.sources[t].name]['glat']
    gta.free_sources(free=False)
    gta.print_model()
    gta.free_sources(skydir=gta.roi[gta.roi.sources[t].name].skydir,distance=[3.0],free=True)
    gta.print_model()
    gta.localize(gta.roi.sources[t].name, update=True, make_plots=True)
    glon1[t] = gta.roi[gta.roi.sources[t].name]['glon']
    glat1[t] = gta.roi[gta.roi.sources[t].name]['glat']
    offset[t] = angular_distance_gal(glon0[t],glon1[t],glat0[t],glat1[t])
    gta.print_model()


2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0102.3+4217     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0041.9+3639     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0105.3+3928     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0023.5+4454     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Fixing parameters for isodiff               : ['Normalization']
2018-03-31 17:20:28 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.049   2.232  1.56e-06   2.77    100.16       650.2     
3FGL J0040.3+4049      0.640   0.207  1.85e-06   1.76     65.34       129.4     
3FGL J0049.0+4224      1.635   0.345  1.21e-06   1.78     33.11        92.7     
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5     
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2     
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8     
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9     

2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:20:28 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 17:20:28 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.049   2.232  1.56e-06   2.77    100.16       650.2    *
3FGL J0040.3+4049      0.640   0.207  1.85e-06   1.76     65.34       129.4    *
3FGL J0049.0+4224      1.635   0.345  1.21e-06   1.78     33.11        92.7    *
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5    *
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2    *
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:20:28 INFO    GTAnalysis.localize(): Running localization for 3FGL J0042.5+4117
Renormalization of source 3FGL J0042.5+4117

2018-03-31 17:21:03 INFO    GTAnalysis._localize(): Localization succeeded.
2018-03-31 17:21:03 INFO    GTAnalysis._localize(): Updating source 3FGL J0042.5+4117 to localized position.
2018-03-31 17:21:03 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0042.5+4117
2018-03-31 17:21:03 INFO    GTAnalysis.add_source(): Adding source 3FGL J0042.5+4117
2018-03-31 17:21:08 INFO    GTAnalysis._localize(): Localization completed with new position:
(  ra, dec) = (   10.5251 +/-   0.0676,   41.2709 +/-   0.0597)
(glon,glat) = (  121.0455 +/-   0.0673,  -21.5667 +/-   0.0601)
offset =   0.0821 r68 =   0.0957 r95 =   0.1545 r99 =   0.1916
2018-03-31 17:21:08 INFO    GTAnalysis._localize(): LogLike:  -241448.921 DeltaLogLike:        0.119
2018-03-31 17:21:08 INFO    GTAnalysis.localize(): Finished localization.
2018-03-31 17:21:10 INFO    GTAnalysis.localize(): Execution time: 41.86 s
2018-03-31 17:21:10 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7    *
3FGL J0040.3+4049      0.640   0.207  1.85e-06   1.76     65.34       129.4    *
3FGL J0049.0+4224      1.635   0.345  1.21e-06   1.78     33.11        92.7    *
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5    *
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2    *
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Fixing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Fixing parameters for isodiff               : ['Normalization']
2018-03-31 17:21:10 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.640   0.207  1.85e-06   1.76     65.34       129.4     
3FGL J0049.0+4224      1.635   0.345  1.21e-06   1.78     33.11        92.7     
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5     
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2     
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8     
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9     

2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:21:10 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 17:21:10 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7    *
3FGL J0040.3+4049      0.640   0.207  1.85e-06   1.76     65.34       129.4    *
3FGL J0049.0+4224      1.635   0.345  1.21e-06   1.78     33.11        92.7    *
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5    *
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2    *
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:21:10 INFO    GTAnalysis.localize(): Running localization for 3FGL J0040.3+4049
Renormalization of source 3FGL J0040.3+4049

2018-03-31 17:22:06 INFO    GTAnalysis._localize(): Localization succeeded.
2018-03-31 17:22:06 INFO    GTAnalysis._localize(): Updating source 3FGL J0040.3+4049 to localized position.
2018-03-31 17:22:06 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0040.3+4049
2018-03-31 17:22:06 INFO    GTAnalysis.add_source(): Adding source 3FGL J0040.3+4049
2018-03-31 17:22:10 INFO    GTAnalysis._localize(): Localization completed with new position:
(  ra, dec) = (   10.0986 +/-   0.0178,   40.8216 +/-   0.0174)
(glon,glat) = (  120.6788 +/-   0.0178,  -22.0018 +/-   0.0174)
offset =   0.0124 r68 =   0.0266 r95 =   0.0430 r99 =   0.0533
2018-03-31 17:22:10 INFO    GTAnalysis._localize(): LogLike:  -241448.701 DeltaLogLike:        0.220
2018-03-31 17:22:10 INFO    GTAnalysis.localize(): Finished localization.
2018-03-31 17:22:13 INFO    GTAnalysis.localize(): Execution time: 62.12 s
2018-03-31 17:22:13 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7    *
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0    *
3FGL J0049.0+4224      1.635   0.345  1.21e-06   1.78     33.11        92.7    *
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5    *
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2    *
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Fixing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Fixing parameters for isodiff               : ['Normalization']
2018-03-31 17:22:13 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.635   0.345  1.21e-06   1.78     33.11        92.7     
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5     
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2     
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8     
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9     

2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0102.3+4217     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:22:13 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 17:22:13 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7    *
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0    *
3FGL J0049.0+4224      1.635   0.345  1.21e-06   1.78     33.11        92.7    *
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5    *
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2    *
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8    *
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:22:13 INFO    GTAnalysis.localize(): Running localization for 3FGL J0049.0+4224
Renormalization of source 3FGL J0049.0+4224

2018-03-31 17:22:46 INFO    GTAnalysis._localize(): Localization succeeded.
2018-03-31 17:22:46 INFO    GTAnalysis._localize(): Updating source 3FGL J0049.0+4224 to localized position.
2018-03-31 17:22:46 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0049.0+4224
2018-03-31 17:22:46 INFO    GTAnalysis.add_source(): Adding source 3FGL J0049.0+4224
2018-03-31 17:22:51 INFO    GTAnalysis._localize(): Localization completed with new position:
(  ra, dec) = (   12.2921 +/-   0.0257,   42.3921 +/-   0.0304)
(glon,glat) = (  122.4846 +/-   0.0257,  -20.4776 +/-   0.0304)
offset =   0.0356 r68 =   0.0424 r95 =   0.0684 r99 =   0.0848
2018-03-31 17:22:51 INFO    GTAnalysis._localize(): LogLike:  -241447.600 DeltaLogLike:        1.101
2018-03-31 17:22:51 INFO    GTAnalysis.localize(): Finished localization.
2018-03-31 17:22:53 INFO    GTAnalysis.localize(): Execution time: 40.88 s
2018-03-31 17:22:53 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7    *
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0    *
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3    *
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5    *
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2    *
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8    *
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0102.3+4217     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Fixing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Fixing parameters for isodiff               : ['Normalization']
2018-03-31 17:22:53 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5     
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2     
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8     
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9     

2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:22:53 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 17:22:53 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7    *
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0    *
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3    *
3FGL J0048.0+3950      1.745   0.558  5.65e-06   1.92    438.69       627.5    *
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2     
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:22:53 INFO    GTAnalysis.localize(): Running localization for 3FGL J0048.0+3950
Renormalization of source 3FGL J0048.0+3950

2018-03-31 17:23:27 INFO    GTAnalysis._localize(): Localization succeeded.
2018-03-31 17:23:27 INFO    GTAnalysis._localize(): Updating source 3FGL J0048.0+3950 to localized position.
2018-03-31 17:23:27 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0048.0+3950
2018-03-31 17:23:27 INFO    GTAnalysis.add_source(): Adding source 3FGL J0048.0+3950
2018-03-31 17:23:32 INFO    GTAnalysis._localize(): Localization completed with new position:
(  ra, dec) = (   11.9725 +/-   0.0094,   39.7953 +/-   0.0095)
(glon,glat) = (  122.1912 +/-   0.0094,  -23.0713 +/-   0.0095)
offset =   0.0545 r68 =   0.0144 r95 =   0.0232 r99 =   0.0287
2018-03-31 17:23:32 INFO    GTAnalysis._localize(): LogLike:  -241432.648 DeltaLogLike:       14.952
2018-03-31 17:23:32 INFO    GTAnalysis.localize(): Finished localization.
2018-03-31 17:23:34 INFO    GTAnalysis.localize(): Execution time: 40.57 s
2018-03-31 17:23:34 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7    *
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0    *
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3    *
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3    *
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2     
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0048.0+3950     : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Fixing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Fixing parameters for isodiff               : ['Normalization']
2018-03-31 17:23:34 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2     
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8     
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9     

2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:23:34 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 17:23:34 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7    *
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0    *
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3    *
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.326   0.256  1.49e-06   1.98     67.02       203.2    *
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:23:34 INFO    GTAnalysis.localize(): Running localization for 3FGL J0039.1+4330
Renormalization of source 3FGL J0039.1+4330

2018-03-31 17:24:08 INFO    GTAnalysis._localize(): Localization succeeded.
2018-03-31 17:24:08 INFO    GTAnalysis._localize(): Updating source 3FGL J0039.1+4330 to localized position.
2018-03-31 17:24:08 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0039.1+4330
2018-03-31 17:24:08 INFO    GTAnalysis.add_source(): Adding source 3FGL J0039.1+4330
2018-03-31 17:24:13 INFO    GTAnalysis._localize(): Localization completed with new position:
(  ra, dec) = (    9.7810 +/-   0.0188,   43.5149 +/-   0.0189)
(glon,glat) = (  120.5670 +/-   0.0188,  -19.3003 +/-   0.0189)
offset =   0.0181 r68 =   0.0286 r95 =   0.0461 r99 =   0.0572
2018-03-31 17:24:13 INFO    GTAnalysis._localize(): LogLike:  -241432.137 DeltaLogLike:        0.511
2018-03-31 17:24:13 INFO    GTAnalysis.localize(): Finished localization.
2018-03-31 17:24:15 INFO    GTAnalysis.localize(): Execution time: 40.86 s
2018-03-31 17:24:15 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7    *
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0    *
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3    *
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8    *
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0042.5+4117     : ['Prefactor', 'Index']
2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0040.3+4049     : ['Prefactor', 'Index']
2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0039.1+4330     : ['Prefactor', 'Index']
2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Fixing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Fixing parameters for isodiff               : ['Normalization']
2018-03-31 17:24:15 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8     
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9     

2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0102.3+4217     : ['Prefactor', 'Index']
2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0105.3+3928     : ['Prefactor', 'Index']
2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:24:15 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 17:24:15 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3    *
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.800   0.744  1.88e-06   2.87    159.25       813.8    *
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3    *
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:24:15 INFO    GTAnalysis.localize(): Running localization for 3FGL J0102.3+4217
Renormalization of source 3FGL J0102.3+4217

2018-03-31 17:24:50 INFO    GTAnalysis._localize(): Localization succeeded.
2018-03-31 17:24:50 INFO    GTAnalysis._localize(): Updating source 3FGL J0102.3+4217 to localized position.
2018-03-31 17:24:50 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0102.3+4217
2018-03-31 17:24:50 INFO    GTAnalysis.add_source(): Adding source 3FGL J0102.3+4217
2018-03-31 17:24:55 INFO    GTAnalysis._localize(): Localization completed with new position:
(  ra, dec) = (   15.6213 +/-   0.0277,   42.2130 +/-   0.0245)
(glon,glat) = (  125.1170 +/-   0.0279,  -20.6119 +/-   0.0243)
offset =   0.0784 r68 =   0.0393 r95 =   0.0634 r99 =   0.0787
2018-03-31 17:24:55 INFO    GTAnalysis._localize(): LogLike:  -241427.657 DeltaLogLike:        4.480
2018-03-31 17:24:55 INFO    GTAnalysis.localize(): Finished localization.
2018-03-31 17:24:57 INFO    GTAnalysis.localize(): Execution time: 42.09 s
2018-03-31 17:24:57 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3    *
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3    *
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3    *
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:24:57 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0049.0+4224     : ['Prefactor', 'Index']
2018-03-31 17:24:57 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0102.3+4217     : ['Prefactor', 'Index']
2018-03-31 17:24:57 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0105.3+3928     : ['Prefactor', 'Index']
2018-03-31 17:24:57 INFO    GTAnalysis.free_source(): Fixing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:24:57 INFO    GTAnalysis.free_source(): Fixing parameters for isodiff               : ['Normalization']
2018-03-31 17:24:57 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8     
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9     

2018-03-31 17:24:57 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0041.9+3639     : ['Prefactor', 'Index']
2018-03-31 17:24:57 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:24:57 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 17:24:57 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3     
3FGL J0041.9+3639      4.611   1.679  1.32e-06   2.33     73.37       324.1    *
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:24:57 INFO    GTAnalysis.localize(): Running localization for 3FGL J0041.9+3639
Renormalization of source 3FGL J0041.9+3639

2018-03-31 17:25:30 INFO    GTAnalysis._localize(): Localization succeeded.
2018-03-31 17:25:30 INFO    GTAnalysis._localize(): Updating source 3FGL J0041.9+3639 to localized position.
2018-03-31 17:25:30 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0041.9+3639
2018-03-31 17:25:30 INFO    GTAnalysis.add_source(): Adding source 3FGL J0041.9+3639
2018-03-31 17:25:35 INFO    GTAnalysis._localize(): Localization completed with new position:
(  ra, dec) = (   10.5215 +/-   0.0213,   36.6757 +/-   0.0196)
(glon,glat) = (  120.8430 +/-   0.0213,  -26.1582 +/-   0.0196)
offset =   0.0224 r68 =   0.0309 r95 =   0.0499 r99 =   0.0619
2018-03-31 17:25:35 INFO    GTAnalysis._localize(): LogLike:  -241426.793 DeltaLogLike:        0.864
2018-03-31 17:25:35 INFO    GTAnalysis.localize(): Finished localization.
2018-03-31 17:25:37 INFO    GTAnalysis.localize(): Execution time: 40.14 s
2018-03-31 17:25:37 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3     
3FGL J0041.9+3639      4.596   1.694  1.34e-06   2.33     76.49       328.9    *
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:25:37 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0041.9+3639     : ['Prefactor', 'Index']
2018-03-31 17:25:37 INFO    GTAnalysis.free_source(): Fixing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:25:37 INFO    GTAnalysis.free_source(): Fixing parameters for isodiff               : ['Normalization']
2018-03-31 17:25:37 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3     
3FGL J0041.9+3639      4.596   1.694  1.34e-06   2.33     76.49       328.9     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8     
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9     

2018-03-31 17:25:37 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0105.3+3928     : ['Prefactor', 'Index']
2018-03-31 17:25:37 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0102.3+4217     : ['Prefactor', 'Index']
2018-03-31 17:25:37 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:25:37 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 17:25:37 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3    *
3FGL J0041.9+3639      4.596   1.694  1.34e-06   2.33     76.49       328.9     
3FGL J0105.3+3928      4.661   0.505  2.34e-06   2.23    170.01       512.3    *
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:25:37 INFO    GTAnalysis.localize(): Running localization for 3FGL J0105.3+3928
Renormalization of source 3FGL J0105.3+3928

2018-03-31 17:26:12 INFO    GTAnalysis._localize(): Localization succeeded.
2018-03-31 17:26:12 INFO    GTAnalysis._localize(): Updating source 3FGL J0105.3+3928 to localized position.
2018-03-31 17:26:12 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0105.3+3928
2018-03-31 17:26:12 INFO    GTAnalysis.add_source(): Adding source 3FGL J0105.3+3928
2018-03-31 17:26:16 INFO    GTAnalysis._localize(): Localization completed with new position:
(  ra, dec) = (   16.3037 +/-   0.0193,   39.4906 +/-   0.0229)
(glon,glat) = (  125.8255 +/-   0.0195,  -23.3037 +/-   0.0228)
offset =   0.0275 r68 =   0.0319 r95 =   0.0514 r99 =   0.0638
2018-03-31 17:26:16 INFO    GTAnalysis._localize(): LogLike:  -241425.933 DeltaLogLike:        0.860
2018-03-31 17:26:16 INFO    GTAnalysis.localize(): Finished localization.
2018-03-31 17:26:18 INFO    GTAnalysis.localize(): Execution time: 40.98 s
2018-03-31 17:26:18 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3    *
3FGL J0041.9+3639      4.596   1.694  1.34e-06   2.33     76.49       328.9     
3FGL J0105.3+3928      4.635   0.502  2.36e-06   2.23    170.56       509.2    *
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:26:18 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0102.3+4217     : ['Prefactor', 'Index']
2018-03-31 17:26:18 INFO    GTAnalysis.free_source(): Fixing parameters for 3FGL J0105.3+3928     : ['Prefactor', 'Index']
2018-03-31 17:26:18 INFO    GTAnalysis.free_source(): Fixing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:26:18 INFO    GTAnalysis.free_source(): Fixing parameters for isodiff               : ['Normalization']
2018-03-31 17:26:18 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3     
3FGL J0041.9+3639      4.596   1.694  1.34e-06   2.33     76.49       328.9     
3FGL J0105.3+3928      4.635   0.502  2.36e-06   2.23    170.56       509.2     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8     
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8     
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9     

2018-03-31 17:26:18 INFO    GTAnalysis.free_source(): Freeing parameters for 3FGL J0023.5+4454     : ['Prefactor', 'Index']
2018-03-31 17:26:18 INFO    GTAnalysis.free_source(): Freeing parameters for galdiff               : ['Prefactor', 'Index']
2018-03-31 17:26:18 INFO    GTAnalysis.free_source(): Freeing parameters for isodiff               : ['Normalization']
2018-03-31 17:26:18 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3     
3FGL J0041.9+3639      4.596   1.694  1.34e-06   2.33     76.49       328.9     
3FGL J0105.3+3928      4.635   0.502  2.36e-06   2.23    170.56       509.2     
3FGL J0023.5+4454      5.052   2.060  2.39e-06   2.44    199.67       727.8    *
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

2018-03-31 17:26:18 INFO    GTAnalysis.localize(): Running localization for 3FGL J0023.5+4454
Renormalization of source 3FGL J0023.5+4454

2018-03-31 17:26:50 INFO    GTAnalysis._localize(): Localization succeeded.
2018-03-31 17:26:50 INFO    GTAnalysis._localize(): Updating source 3FGL J0023.5+4454 to localized position.
2018-03-31 17:26:50 INFO    GTAnalysis.delete_source(): Deleting source 3FGL J0023.5+4454
2018-03-31 17:26:50 INFO    GTAnalysis.add_source(): Adding source 3FGL J0023.5+4454
2018-03-31 17:26:55 INFO    GTAnalysis._localize(): Localization completed with new position:
(  ra, dec) = (    5.9678 +/-   0.0247,   44.9612 +/-   0.0185)
(glon,glat) = (  117.8206 +/-   0.0242,  -17.6367 +/-   0.0192)
offset =   0.0845 r68 =   0.0320 r95 =   0.0517 r99 =   0.0641
2018-03-31 17:26:55 INFO    GTAnalysis._localize(): LogLike:  -241416.370 DeltaLogLike:        9.563
2018-03-31 17:26:55 INFO    GTAnalysis.localize(): Finished localization.
2018-03-31 17:26:57 INFO    GTAnalysis.localize(): Execution time: 38.36 s
2018-03-31 17:26:57 INFO    GTAnalysis.print_model(): 
sourcename            offset    norm  eflux     index        ts       npred free
--------------------------------------------------------------------------------
3FGL J0042.5+4117      0.120   2.114  1.47e-06   2.78     89.71       615.7     
3FGL J0040.3+4049      0.629   0.205  1.83e-06   1.77     65.21       130.0     
3FGL J0049.0+4224      1.641   0.362  1.21e-06   1.82     35.85       102.3     
3FGL J0048.0+3950      1.770   0.560  5.75e-06   1.91    467.55       625.3     
3FGL J0039.1+4330      2.342   0.259  1.51e-06   1.98     68.40       205.8     
3FGL J0102.3+4217      3.802   0.726  1.96e-06   2.80    170.56       812.3     
3FGL J0041.9+3639      4.596   1.694  1.34e-06   2.33     76.49       328.9     
3FGL J0105.3+3928      4.635   0.502  2.36e-06   2.23    170.56       509.2     
3FGL J0023.5+4454      5.046   2.195  2.49e-06   2.46    225.00       773.5    *
galdiff                  ---   0.912      0.19  -0.02 110030.43     79449.8    *
isodiff                  ---   0.978    0.0434   2.12  14617.31     35527.9    *

Here we have relocalized all the sources present in the model in the following way:


In [38]:
print "       Old position,             new position,           offset,        posr68"
for t in range(len(gta.roi.sources)-2):
    print "(l0,b0)=(%.3f,%.3f) (l1,b1)=(%.3f,%.3f), offset=%.3f and pos_r68=%.3f"%(glon0[t],glat0[t],glon1[t],glat1[t],offset[t],gta.roi[gta.roi.sources[t].name]['pos_r68'])


       Old position,             new position,           offset,        posr68
(l0,b0)=(121.131,-21.545) (l1,b1)=(121.045,-21.567), offset=0.080 and pos_r68=0.096
(l0,b0)=(120.666,-22.005) (l1,b1)=(120.679,-22.002), offset=0.013 and pos_r68=0.027
(l0,b0)=(122.454,-20.456) (l1,b1)=(122.485,-20.478), offset=0.021 and pos_r68=0.042
(l0,b0)=(122.221,-23.024) (l1,b1)=(122.191,-23.071), offset=0.049 and pos_r68=0.014
(l0,b0)=(120.579,-19.314) (l1,b1)=(120.567,-19.300), offset=0.018 and pos_r68=0.029
(l0,b0)=(125.092,-20.537) (l1,b1)=(125.117,-20.612), offset=0.075 and pos_r68=0.039
(l0,b0)=(120.823,-26.171) (l1,b1)=(120.843,-26.158), offset=0.017 and pos_r68=0.031
(l0,b0)=(125.849,-23.321) (l1,b1)=(125.825,-23.304), offset=0.018 and pos_r68=0.032
(l0,b0)=(117.748,-17.685) (l1,b1)=(117.821,-17.637), offset=0.055 and pos_r68=0.032

Now that we have renormalized all the 3FGL sources in the ROI we will perform an other fit.


In [39]:
gta.fit()


2018-03-31 17:29:17 INFO    GTAnalysis.fit(): Starting fit.
2018-03-31 17:29:20 INFO    GTAnalysis.fit(): Fit returned successfully. Quality:   3 Status:   0
2018-03-31 17:29:20 INFO    GTAnalysis.fit(): LogLike:  -241415.975 DeltaLogLike:        0.394 
Out[39]:
{'config': {'covar': True,
  'init_lambda': 0.0001,
  'max_iter': 100,
  'min_fit_quality': 2,
  'optimizer': 'MINUIT',
  'reoptimize': False,
  'retries': 3,
  'tol': 0.001,
  'verbosity': 0},
 'correlation': array([[ 1.        ,  0.50503184, -0.05162308, -0.09002682,  0.00671118],
        [ 0.50503184,  1.        , -0.00772396, -0.10019572, -0.00779334],
        [-0.05162308, -0.00772396,  1.        ,  0.18758833, -0.9409017 ],
        [-0.09002682, -0.10019572,  0.18758833,  1.        , -0.32234486],
        [ 0.00671118, -0.00779334, -0.9409017 , -0.32234486,  1.        ]]),
 'covariance': array([[ 4.57763528e-02,  9.13643322e-03, -1.39741974e-04,
         -1.25244819e-04,  4.44063975e-05],
        [ 9.13643322e-03,  7.14948342e-03, -8.26304017e-06,
         -5.50875892e-05, -2.03791982e-05],
        [-1.39741974e-04, -8.26304017e-06,  1.60075462e-04,
          1.54324703e-05, -3.68156899e-04],
        [-1.25244819e-04, -5.50875892e-05,  1.54324703e-05,
          4.22799544e-05, -6.48207901e-05],
        [ 4.44063975e-05, -2.03791982e-05, -3.68156899e-04,
         -6.48207901e-05,  9.56428746e-04]]),
 'dloglike': 0.3942607992212288,
 'edm': 5.9399940785213016e-05,
 'errors': array([0.21395409, 0.08455462, 0.01265209, 0.0065023 , 0.03092618]),
 'fit_quality': 3,
 'fit_status': 0,
 'fit_success': True,
 'indices': array([ 0,  1, 27, 28, 30]),
 'is_norm': array([ True, False,  True, False,  True]),
 'loglike': -241415.9753749763,
 'niter': 1,
 'par_names': ['Prefactor', 'Index', 'Prefactor', 'Index', 'Normalization'],
 'src_names': ['3FGL J0023.5+4454',
  '3FGL J0023.5+4454',
  'galdiff',
  'galdiff',
  'isodiff'],
 'values': array([ 2.16351336,  2.45098852,  0.9091214 , -0.01664457,  0.99203421])}

In [40]:
tsmap_postfit = gta.tsmap(prefix='TSmap_start',make_plots=True,write_fits=True,write_npy=True)
%matplotlib inline
fig = plt.figure(figsize=(14,6))
ROIPlotter(tsmap_postfit['sqrt_ts'],roi=gta.roi).plot(levels=[0,3,5,7],vmin=0,vmax=5,subplot=121,cmap='magma')
plt.gca().set_title('Sqrt(TS)')
ROIPlotter(tsmap_postfit['npred'],roi=gta.roi).plot(vmin=0,vmax=100,subplot=122,cmap='magma')
plt.gca().set_title('NPred')


2018-03-31 17:30:13 INFO    GTAnalysis.tsmap(): Generating TS map
2018-03-31 17:30:19 INFO    GTAnalysis._make_tsmap_fast(): Fitting test source.
2018-03-31 17:35:33 INFO    GTAnalysis.tsmap(): Finished TS map
2018-03-31 17:35:33 INFO    GTAnalysis.tsmap(): Execution time: 319.18 s
Out[40]:
Text(0.5,1,u'NPred')