/nfs/farm/g/glast/g/LCRepository/bin/miniconda2/envs/fermitools_v1.0.5/lib/python2.7/site-packages/pyfits/__init__.py:22: PyFITSDeprecationWarning: PyFITS is deprecated, please use astropy.io.fits
  PyFITSDeprecationWarning)  # noqa

Likelihood Analysis Tool
Support Contact: Daniel Kocevski (daniel.kocevski@nasa.gov)


Waiting 220 seconds before starting...
Proceeding.

Importing modules...
This is make3FGLxml version 01r0.
The default diffuse model files and names are for pass 8 and assume you have v10r00p05 of the Fermi Science Tools or higher.
This is make4FGLxml version 01r04.
The default diffuse model files and names are for pass 8 and 4FGL and assume you have v11r5p3 of the Fermi Science Tools or higher.

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

/nfs/farm/g/glast/g/LCRepository/bin/miniconda2/envs/fermitools_v1.0.5/lib/python2.7/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: The mpl_toolkits.axes_grid module was deprecated in version 2.1. Use mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist provies the same functionality instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

number of points = 7422
number of fields = 27
No RA_SUN column yet. Adding RA_SUN/DEC_SUN columns.
Done.


Performing analysis on: 4FGL_J2040.5-1705_daily_bin158
RA = 310.136, Dec = -17.0901
tmin = 280281601, tmax = 280540801
emin = 100.0, emax = 100000.0
irfs = P8R3_SOURCE_V2
ROI = 12
zmax = 90

Fitting strategies:
Fix sources to their catalog values = True
Leave variable source normalizations free = True
Perform pre-fit where ALL sources are frozen to catalog values = False
Perform secondary fit with a free spectral index = True
Remove all catalog sources = False
Remove weak (TS < 2) catalog sources = False
Freeze Galactic component = False

Likelihood fit parameters:
Statistic: UNBINNED
Optimizer: MINUIT

Catalog: 4FGL

Repository Job = True

LAT data Source:
Data catalog

Updating database...

UPDATE lightcurve_data_v2 SET job_id='106935', job_status='RUN', time_executed='2021-09-25 15:44:12.426427', time_epoch_executed='1632609852.43' WHERE source_name='4FGL J2040.5-1705' and cadence='daily' and bin_id='158'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/106935

Creating custom pfile directory:
/scratch/kocevski/106935/pfiles/

Retrieving the FT1 file...

Issuing command:
/afs/slac.stanford.edu/g/glast/ground/bin/datacat find --group FT1 --filter 'nMetStop>=280281601.0 && nMetStart<280540801.0' /Data/Flight/Reprocess/P305

Issuing command:
/afs/slac.stanford.edu/g/glast/ground/bin/datacat find --group FT1 --filter 'nMetStart>564945418 && nMetStop>=280281601.0 && nMetStart<280540801.0' /Data/Flight/Level1/LPA

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/106935/ft1_4FGL_J2040.5-1705_daily_bin158.fits


Retrieving the FT1 file...

Issuing command:
/afs/slac.stanford.edu/g/glast/ground/bin/datacat find --group FT2 --filter 'nMetStop>=280281601.0 && nMetStart<280540801.0' /Data/Flight/Level1/LPA

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/106935/ft1_4FGL_J2040.5-1705_daily_bin158.fits outfile=/scratch/kocevski/106935/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin158.fits ra=310.136 dec=-17.0901 rad=12.0 tmin=280281601.0 tmax=280540801.0 emin=100.0 emax=100000.0 zmin=0.0 zmax=90.0 evclass=128 evtype="INDEF" convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=2 clobber=yes debug=no gui=no mode="ql"

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

Done.
real 4.43
user 4.19
sys 0.20

Adding sun position to ft2 file:
/nfs/farm/g/glast/g/LCRepository/Repository/bin/sunpos /scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits sctable="SC_DATA" filter="IN_SAA!=T && LIVETIME>0 && gtifilter('/nfs/farm/g/glast/g/LCRepository/Likelihood/GTIs/nogrb.gti',(START+STOP)/2) && (angsep(RA_SUN,DEC_SUN,RA_ZENITH,DEC_ZENITH)>115 || gtifilter('/nfs/farm/g/glast/g/LCRepository/Likelihood/GTIs/nosolarflares.gti',(START+STOP)/2))" roicut=no evfile=/scratch/kocevski/106935/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin158.fits evtable="EVENTS" outfile="/scratch/kocevski/106935/ft1_filtered_4FGL_J2040.5-1705_daily_bin158.fits" apply_filter=yes overwrite=yes header_obstimes=yes tstart=0.0 tstop=0.0 gtifile="default" chatter=3 clobber=yes debug=no gui=no mode="ql"

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

This is gtmktime version HEAD
Applying GTI filter:
IN_SAA!=T && LIVETIME>0 && gtifilter('/nfs/farm/g/glast/g/LCRepository/Likelihood/GTIs/nogrb.gti',(START+STOP)/2) && (angsep(RA_SUN,DEC_SUN,RA_ZENITH,DEC_ZENITH)>115 || gtifilter('/nfs/farm/g/glast/g/LCRepository/Likelihood/GTIs/nosolarflares.gti',(START+STOP)/2))
real 0.54
user 0.34
sys 0.15

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/106935/ft1_filtered_4FGL_J2040.5-1705_daily_bin158.fits" evtable="EVENTS" scfile=/scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits sctable="SC_DATA" outfile=/scratch/kocevski/106935/ltcube_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits dcostheta=0.025 binsz=1.0 phibins=0 tmin=0.0 tmax=0.0 file_version="1" zmin=0.0 zmax=90.0 chatter=2 clobber=yes debug=no gui=no mode="ql"

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

Working on file /scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits
.....................!
real 13.91
user 13.53
sys 0.33

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/106935/ft1_filtered_4FGL_J2040.5-1705_daily_bin158.fits evtable="EVENTS" scfile=/scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits sctable="SC_DATA" expcube=/scratch/kocevski/106935/ltcube_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits outfile=/scratch/kocevski/106935/expmap_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits irfs="P8R3_SOURCE_V2" evtype="INDEF" srcrad=30.0 nlong=88 nlat=88 nenergies=10 submap=no nlongmin=0 nlongmax=0 nlatmin=0 nlatmax=0 chatter=2 clobber=yes debug=no gui=no mode="ql"

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

The exposure maps generated by this tool are meant
to be used for *unbinned* likelihood analysis only.
Do not use them for binned analyses.
Computing the ExposureMap using /scratch/kocevski/106935/ltcube_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits
.....................!
real 191.63
user 185.74
sys 5.32

Generating the xml model:
radLim = 0.001
maxRad = 12
normsOnly = True
freeVariableSources = True
Fixing all sources to their catalog values, except variable sources
Creating file and adding sources from 4FGL
Added 181 point sources and 0 extended sources

Setting source of interest to:
4FGL J2040.5-1705 @ 310.136 -17.0901

Creating the counts map:
time -p gtbin evfile=/scratch/kocevski/106935/ft1_filtered_4FGL_J2040.5-1705_daily_bin158.fits scfile=/scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits outfile=/scratch/kocevski/106935/cmap_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits algorithm="CMAP" ebinalg="LOG" emin=30.0 emax=200000.0 ebinfile=NONE tbinalg="LIN" tbinfile=NONE nxpix=160 nypix=160 binsz=0.25 coordsys="CEL" xref=310.136 yref=-17.0901 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"

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

This is gtbin version HEAD
real 0.55
user 0.40
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/106935/ft1_filtered_4FGL_J2040.5-1705_daily_bin158.fits scfile=/scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits outfile=/scratch/kocevski/106935/cmap_HighResolution_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits algorithm="CMAP" ebinalg="LOG" emin=30.0 emax=200000.0 ebinfile=NONE tbinalg="LIN" tbinfile=NONE nxpix=500 nypix=500 binsz=0.1 coordsys="CEL" xref=310.136 yref=-17.0901 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"

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

This is gtbin version HEAD
real 0.55
user 0.38
sys 0.17

Computing the diffuse response:
time -p gtdiffrsp evfile=/scratch/kocevski/106935/ft1_filtered_4FGL_J2040.5-1705_daily_bin158.fits evtable="EVENTS" scfile=/scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits sctable="SC_DATA" srcmdl=/scratch/kocevski/106935/Model_4FGL_J2040.5-1705_daily_bin158.xml irfs="P8R3_SOURCE_V2" evclsmin=0 evclass="INDEF" evtype="INDEF" convert=yes chatter=2 clobber=yes debug=no gui=no mode="ql"

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

adding source EG_v02
adding source GAL_V02
Working on...
/scratch/kocevski/106935/ft1_filtered_4FGL_J2040.5-1705_daily_bin158.fits.....................!
real 57.39
user 55.86
sys 1.21

Creating the likelihood object...
obs = UnbinnedObs('/scratch/kocevski/106935/ft1_filtered_4FGL_J2040.5-1705_daily_bin158.fits', '/scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits', expMap='/scratch/kocevski/106935/expmap_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits', expCube='/scratch/kocevski/106935/ltcube_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/scratch/kocevski/106935/Model_4FGL_J2040.5-1705_daily_bin158.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J2040.5-1705'

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  1.223e+00  0.000e+00  1.000e-04  1.000e+04 ( 1.000e-12)
324        Index:  2.541e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
325        Scale:  7.724e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /scratch/kocevski/106935/ft1_filtered_4FGL_J2040.5-1705_daily_bin158.fits
Spacecraft file(s): /scratch/kocevski/106935/ft2_4FGL_J2040.5-1705_daily_bin158.fits
Exposure map: /scratch/kocevski/106935/expmap_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits
Exposure cube: /scratch/kocevski/106935/ltcube_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.fits
IRFs: P8R3_SOURCE_V2
Source model file: /scratch/kocevski/106935/Model_4FGL_J2040.5-1705_daily_bin158.xml
Optimizer: MINUIT
Statistic: UNBINNED

Performing an iterative likelihood fit...

Fit tolerance = 1

Performing likelihood fit...
Done.

MINUIT Return Code (Fixed Index): 0
logL (Fixed Index) = 6142.19604154

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Fixed Index): 0
logL (Fixed Index) = 6142.15953855

Fit tolerance = 1e-08

Performing likelihood fit...
 **********
 **   14 **SET NOWARN 
 **********

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    36.063       1.0000         .10000E-03   10000.    
     2 'Prefactor '    50.563       1.0000         .10000E-03   10000.    
     3 'Prefactor '    .15611       1.0000         .10000E-03   10000.    
     4 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
     5 'norm      '    38.328       1.0000         .10000E-03   10000.    
     6 'norm      '    2.4572       1.0000         .10000E-03   10000.    
     7 'Prefactor '    14.019       1.0000         .10000E-03   10000.    
     8 'norm      '    .10003E-03   1.0000         .10000E-03   10000.    
     9 'norm      '    .10002E-03   1.0000         .10000E-03   10000.    
    10 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
    11 'Prefactor '    3.6096       1.0000         .10000E-03   10000.    
    12 'Prefactor '    .10008E-03   1.0000         .10000E-03   10000.    
    13 'norm      '    .57474       1.0000         .10000E-03   10000.    
    14 'Prefactor '    9.2656       1.0000         .10000E-03   10000.    
    15 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    16 'norm      '    .10091E-03   1.0000         .10000E-03   10000.    
    17 'Prefactor '    11.585       1.0000         .10000E-03   10000.    
    18 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
    19 'Prefactor '    .10008E-03   1.0000         .10000E-03   10000.    
    20 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    21 'Normalizat'    .97430       1.0000         .10000E-01   10.000    
    22 'Prefactor '    .94340       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5990E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   6142.160     FROM MIGRAD    STATUS=CONVERGED    492 CALLS     2405 TOTAL
                     EDM=   .63E-09  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  1.1%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     36.071        31.551        .16138E-07   -.11143E-04
   2  Prefactor     50.577        48.842        .54836E-06    .12527E-04
   3  Prefactor     .15586        1.1967        .93023E-07   -.18107E-03
   4  Prefactor     .10000E-03    17.651       -.17993E-06** at limit **
   5  norm          38.332        20.544        .28414E-06   -.39096E-04
   6  norm          2.4567        8.5798        .17940E-05   -.24385E-04
   7  Prefactor     14.172        138.52        .40311E-05    .10371E-03
   8  norm          .10000E-03    4.6110       -.90389E-08** at limit **
   9  norm          .10000E-03    12.184        .11999E-06** at limit **
  10  norm          .10000E-03    .49128       -.28233E-06** at limit **
  11  Prefactor     3.6100        10.441        .10635E-04    .31477E-04
  12  Prefactor     .10000E-03    3.9721       -.46261E-07** at limit **
  13  norm          .56811        2.9717        .56257E-06   -.50153E-03
  14  Prefactor     9.2634        6.1195        .89445E-07   -.87948E-04
  15  Prefactor     .10000E-03    88.906       -.33580E-06** at limit **
  16  norm          .10000E-03    120.93        .38433E-06** at limit **
  17  Prefactor     11.586        14.470        .42743E-07   -.31202E-04
  18  Prefactor     .10000E-03    4.4191       -.68880E-07** at limit **
  19  Prefactor     .10000E-03    6.2725       -.23977E-07** at limit **
  20  Prefactor     .10000E-03    3.4622       -.15313E-07** at limit **
  21  Normalizat    .97493        .26486        .26434E-05   -.17315E-03
  22  Prefactor     .94312        .11431       -.20553E-05    .65072E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 36.0707
  Prefactor  = 50.5769
  Prefactor  = 0.155858
  Prefactor  = 0.0001
  norm       = 38.3322
  norm       = 2.45668
  Prefactor  = 14.1718
  norm       = 0.0001
  norm       = 0.0001
  norm       = 0.0001
  Prefactor  = 3.60997
  Prefactor  = 0.0001
  norm       = 0.568115
  Prefactor  = 9.26344
  Prefactor  = 0.0001
  norm       = 0.000100001
  Prefactor  = 11.5857
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Normalizat = 0.974929
  Prefactor  = 0.943121
 **********
 **   18 **HESSE 
 **********

 FCN=   6142.160     FROM HESSE     STATUS=OK           342 CALLS     2747 TOTAL
                     EDM=   .17E-07    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     36.071        31.494        .66735E-04   -1.4506    
   2  Prefactor     50.577        48.940        .56398E-04   -1.4284    
   3  Prefactor     .15586        5.7686        .15825E-02   -1.5629    
   4  Prefactor     .10000E-03    17.722        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  norm          38.332        20.566        .64740E-04   -1.4469    
   6  norm          2.4567        8.4922        .26092E-03   -1.5394    
   7  Prefactor     14.172        136.41        .10698E-03   -1.4955    
   8  norm          .10000E-03    4.6128        .16436E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  norm          .10000E-03    12.191        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  norm          .10000E-03    .50668        .10758E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  Prefactor     3.6100        10.526        .10633E-02   -1.5328    
  12  Prefactor     .10000E-03    3.9919        .15253E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  13  norm          .56811        12.122        .25195E-02   -1.5557    
  14  Prefactor     9.2634        6.1467        .13166E-03   -1.5099    
  15  Prefactor     .10000E-03    89.035        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  16  norm          .10000E-03    123.37        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  17  Prefactor     11.586        14.472        .11770E-03   -1.5027    
  18  Prefactor     .10000E-03    4.4566        .16085E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  19  Prefactor     .10000E-03    6.2800        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  20  Prefactor     .10000E-03    3.4639        .14242E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  21  Normalizat    .97493        .31360        .37866E-03   -.93875    
  22  Prefactor     .94312        .13653        .16383E-03   -.94650    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.68189e-08
Minuit parameter uncertainties:
  1  31.5086
  2  48.979
  3  1.89598
  4  8.89813e-06
  5  20.5696
  6  8.49639
  7  88.1993
  8  1.11632e-06
  9  1.39499e-07
  10  9.82379e-06
  11  10.5314
  12  2.81814e-06
  13  5.24917
  14  6.14716
  15  0.000174267
  16  0.000840651
  17  14.4762
  18  2.89717e-06
  19  5.94048e-07
  20  2.09094e-07
  21  0.314188
  22  0.13658
Done.

MINUIT Return Code (Fixed Index): 0
logL (Fixed Index) = 6142.15953413

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  9.263e+00  6.147e+00  1.000e-04  1.000e+04 ( 1.000e-12)
324        Index:  2.541e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
325        Scale:  7.724e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
596    Prefactor:  9.431e-01  1.366e-01  0.000e+00  1.000e+01 ( 1.000e+00)
597        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
598        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
595   Normalization:  9.749e-01  3.142e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 3.47
Ra Dec: 310.136 -17.090
Photon Index (Fixed Index): 2.54 +/- 0.00
Photon Flux (Fixed Index): 1.09e-07 +/- 7.19e-08
Energy Flux (Fixed Index): 3.01e-05 +/- 2.00e-05

TS (Fixed Index): 3.47
Ra Dec: 310.136 -17.090
Photon Flux Upper Limit: 2.50e-07 ph cm-2 s-1
Energy Flux Upper Limit: 1.95e-02 MeV cm-2 s-1

Saving results to:
/scratch/kocevski/106935/likelihoodResults_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.txt

Performing a free index iterative likelihood fit...

Freezing all point sources, except source of interest...

Done.

Freeing candidate source...
Done.

Fit tolerance = 1

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 6141.29418704
delta logL = 0.865347099341

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 6141.28221629
delta logL = 0.877317846597

Fit tolerance = 1e-08

Performing likelihood fit...
 **********
 **   14 **SET NOWARN 
 **********

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    2.8327       1.0000         .10000E-03   10000.    
     2 'Index     '    3.6697       1.0000          .0000       10.000    
     3 'Normalizat'    .86324       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .97636       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5990E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   6141.282     FROM MIGRAD    STATUS=CONVERGED     55 CALLS      254 TOTAL
                     EDM=   .31E-08    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     2.8303        22.268        .60405E-02    .38324E-03
   2  Index         3.6702        2.8787        .10907        .14320E-03
   3  Normalizat    .86323        .96837E-01    .90202E-01    .28620E-04
   4  Prefactor     .97638        .39984E-01    .45971E-01    .97979E-05
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 2.83035
  Index      = 3.67019
  Normalizat = 0.86323
  Prefactor  = 0.976379
 **********
 **   18 **HESSE 
 **********

 FCN=   6141.282     FROM HESSE     STATUS=OK            33 CALLS      287 TOTAL
                     EDM=   .53E-07    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     2.8303        8.6246        .63508E-04   -1.5371    
   2  Index         3.6702        1.8535        .42964E-02   -.26920    
   3  Normalizat    .86323        .32328        .39952E-03   -.97764    
   4  Prefactor     .97638        .13492        .16124E-03   -.93521    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 5.26136e-08
Minuit parameter uncertainties:
  1  8.62838
  2  1.9025
  3  0.324008
  4  0.134963
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/106935': No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 6141.28221612
delta logL = 0.877318011379

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  2.830e+00  8.628e+00  1.000e-04  1.000e+04 ( 1.000e-12)
324        Index:  3.670e+00  1.903e+00  0.000e+00  1.000e+01 (-1.000e+00)
325        Scale:  7.724e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
596    Prefactor:  9.764e-01  1.350e-01  0.000e+00  1.000e+01 ( 1.000e+00)
597        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
598        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
595   Normalization:  8.632e-01  3.240e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 5.58
Ra Dec: 310.136 -17.090
Photon Index (Free Index): 3.67 +/- 1.90
Photon Flux (Free Index): 1.93e-07 +/- 1.07e-07
Energy Flux (Free Index): 3.08e-05 +/- 1.80e-05

Creating a high resolution counts map...
INFO: Auto-setting vmin to  0.000e+00 [aplpy.core]
INFO: Auto-setting vmax to  0.000e+00 [aplpy.core]
Saving /scratch/kocevski/106935/cmap_HighResolution_280281601_280540801_4FGL_J2040.5-1705_daily_bin158.png

Cleaning up...

** Nuclear option initiated! **
rmdir /scratch/kocevski/106935

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='1.95e-02', comment='SUCCESS', photon_flux='1.09e-07', energy_flux2='3.08e-05', photon_flux_error='7.19e-08', dlogl='8.77e-01', energy_flux='3.01e-05', photon_flux2='1.93e-07', job_status='DONE', time_completed='2021-09-25 15:55:14.037711', photon_index_error2='1.90', photon_index2='3.67', ts='3.47', fit_tolerance='1e-08', GAL='0.94', photon_index_error='0.00', photon_flux_upper_limit='2.50e-07', energy_flux_error2='1.80e-05', EG='0.97', time_epoch_completed='1632610514.04', return_code='0', job_id='106935', GAL2='0.98', EG2='0.86', return_code2='0', energy_flux_error='2.00e-05', photon_flux_error2='1.07e-07', ts2='5.58', photon_index='2.54' WHERE bin_id='158' AND source_name='4FGL J2040.5-1705' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Sat Sep 25 15:55:14 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0274>
Subject: Job 106935: <4FGL_J2040.5-1705_daily_bin158> in cluster <slac> Done

Job <4FGL_J2040.5-1705_daily_bin158> was submitted from host <rhel6-64j> by user <kocevski> in cluster <slac> at Sat Sep 25 15:40:16 2021
Job was executed on host(s) <bullet0274>, in queue <medium>, as user <kocevski> in cluster <slac> at Sat Sep 25 15:40:22 2021
</u/ki/kocevski> was used as the home directory.
</u/ki/kocevski> was used as the working directory.
Started at Sat Sep 25 15:40:22 2021
Terminated at Sat Sep 25 15:55:14 2021
Results reported at Sat Sep 25 15:55:14 2021

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J2040.5-1705_daily_bin158 310.136 -17.0901 280281601 280540801 irfs=P8R3_SOURCE_V2 zmax=90 ROI=12 association=4FGL_J2040.5-1705 fixedModel=True performFreeIndexFit=True freeVariableSources=True nuke=True repositoryJob=True verbose=False
------------------------------------------------------------

Successfully completed.

Resource usage summary:

    CPU time :                                   661.13 sec.
    Max Memory :                                 1256 MB
    Average Memory :                             270.38 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   892 sec.
    Turnaround time :                            898 sec.

The output (if any) is above this job summary.

