/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 127 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 = 7387
number of fields = 30
RA_SUN column already exists. File will not be modified.
Done.


Performing analysis on: 4FGL_J1040.5+0617_daily_bin819
RA = 160.15, Dec = 6.2848
tmin = 451612801, tmax = 451872001
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='66788', job_status='RUN', time_executed='2021-09-02 08:28:52.102311', time_epoch_executed='1630596532.1' WHERE source_name='4FGL J1040.5+0617' and cadence='daily' and bin_id='819'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/66788

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

Retrieving the FT1 file...

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

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

Retrieving 47 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/66788/ft1_4FGL_J1040.5+0617_daily_bin819.fits


Retrieving the FT1 file...

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

Retrieving 47 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/66788/ft1_4FGL_J1040.5+0617_daily_bin819.fits outfile=/scratch/kocevski/66788/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin819.fits ra=160.15 dec=6.2848 rad=12.0 tmin=451612801.0 tmax=451872001.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 3.43
user 3.18
sys 0.18

Adding sun position to ft2 file:
/nfs/farm/g/glast/g/LCRepository/Repository/bin/sunpos /scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.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/66788/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin819.fits evtable="EVENTS" outfile="/scratch/kocevski/66788/ft1_filtered_4FGL_J1040.5+0617_daily_bin819.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.52
user 0.35
sys 0.14

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/66788/ft1_filtered_4FGL_J1040.5+0617_daily_bin819.fits" evtable="EVENTS" scfile=/scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits sctable="SC_DATA" outfile=/scratch/kocevski/66788/ltcube_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.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/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits
.....................!
real 14.62
user 14.25
sys 0.31

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/66788/ft1_filtered_4FGL_J1040.5+0617_daily_bin819.fits evtable="EVENTS" scfile=/scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits sctable="SC_DATA" expcube=/scratch/kocevski/66788/ltcube_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.fits outfile=/scratch/kocevski/66788/expmap_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.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/66788/ltcube_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.fits
.....................!
real 190.83
user 186.21
sys 4.15

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 169 point sources and 0 extended sources

Setting source of interest to:
4FGL J1040.5+0617 @ 160.15 6.2848

Creating the counts map:
time -p gtbin evfile=/scratch/kocevski/66788/ft1_filtered_4FGL_J1040.5+0617_daily_bin819.fits scfile=/scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits outfile=/scratch/kocevski/66788/cmap_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.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=160.15 yref=6.2848 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.57
user 0.38
sys 0.15

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/66788/ft1_filtered_4FGL_J1040.5+0617_daily_bin819.fits scfile=/scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits outfile=/scratch/kocevski/66788/cmap_HighResolution_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.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=160.15 yref=6.2848 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.15

Computing the diffuse response:
time -p gtdiffrsp evfile=/scratch/kocevski/66788/ft1_filtered_4FGL_J1040.5+0617_daily_bin819.fits evtable="EVENTS" scfile=/scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits sctable="SC_DATA" srcmdl=/scratch/kocevski/66788/Model_4FGL_J1040.5+0617_daily_bin819.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/66788/ft1_filtered_4FGL_J1040.5+0617_daily_bin819.fits.....................!
real 51.62
user 49.69
sys 1.29

Creating the likelihood object...
obs = UnbinnedObs('/scratch/kocevski/66788/ft1_filtered_4FGL_J1040.5+0617_daily_bin819.fits', '/scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits', expMap='/scratch/kocevski/66788/expmap_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.fits', expCube='/scratch/kocevski/66788/ltcube_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/scratch/kocevski/66788/Model_4FGL_J1040.5+0617_daily_bin819.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J1040.5+0617'

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  2.877e+00  0.000e+00  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  2.368e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
218        Scale:  8.643e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /scratch/kocevski/66788/ft1_filtered_4FGL_J1040.5+0617_daily_bin819.fits
Spacecraft file(s): /scratch/kocevski/66788/ft2_4FGL_J1040.5+0617_daily_bin819.fits
Exposure map: /scratch/kocevski/66788/expmap_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.fits
Exposure cube: /scratch/kocevski/66788/ltcube_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.fits
IRFs: P8R3_SOURCE_V2
Source model file: /scratch/kocevski/66788/Model_4FGL_J1040.5+0617_daily_bin819.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) = 5216.10928078

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    16.762       1.0000         .10000E-03   10000.    
     2 'Prefactor '    .44938E-03   1.0000         .10000E-03   10000.    
     3 'norm      '    .11299E-03   1.0000         .10000E-03   10000.    
     4 'Prefactor '    .10040E-03   1.0000         .10000E-03   10000.    
     5 'Prefactor '    .10019E-03   1.0000         .10000E-03   10000.    
     6 'Prefactor '    .10080E-03   1.0000         .10000E-03   10000.    
     7 'Prefactor '    .10003E-03   1.0000         .10000E-03   10000.    
     8 'norm      '    5.1410       1.0000         .10000E-03   10000.    
     9 'Prefactor '    3.0160       1.0000         .10000E-03   10000.    
    10 'Prefactor '    1.4347       1.0000         .10000E-03   10000.    
    11 'Prefactor '    .60027E-03   1.0000         .10000E-03   10000.    
    12 'Prefactor '    .22744E-03   1.0000         .10000E-03   10000.    
    13 'norm      '    1.5496       1.0000         .10000E-03   10000.    
    14 'Prefactor '    12.409       1.0000         .10000E-03   10000.    
    15 'norm      '    3.5680       1.0000         .10000E-03   10000.    
    16 'Prefactor '    44.651       1.0000         .10000E-03   10000.    
    17 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
    18 'Normalizat'    .91439       1.0000         .10000E-01   10.000    
    19 'Prefactor '    .99143       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5360E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   5215.970     FROM MIGRAD    STATUS=CONVERGED    384 CALLS     1645 TOTAL
                     EDM=   .23E-09  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .5%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     16.773        13.759       -.67922E-05   -.20960E-03
   2  Prefactor     .10000E-03    155.85       -.69702E-04** at limit **
   3  norm          .10000E-03    17.506        .12911E-04** at limit **
   4  Prefactor     .10000E-03    5.8130        .12078E-05** at limit **
   5  Prefactor     .10000E-03    13.850        .18463E-05** at limit **
   6  Prefactor     .10000E-03    15.849       -.18531E-04** at limit **
   7  Prefactor     .10000E-03    5.9577       -.10006E-05** at limit **
   8  norm          5.1415        1.8057        .36386E-07    .44630E-03
   9  Prefactor     3.0166        3.9959       -.66703E-06   -.53669E-05
  10  Prefactor     1.4350        1.6712       -.76458E-07   -.15837E-03
  11  Prefactor     .10003E-03    2.9545       -.75443E-06** at limit **
  12  Prefactor     .10000E-03    13.278        .57259E-05** at limit **
  13  norm          1.5496        .89818        .15208E-06   -.10924E-02
  14  Prefactor     12.413        11.552       -.28231E-05   -.14491E-03
  15  norm          3.5674        1.6628       -.15475E-06    .15045E-04
  16  Prefactor     44.660        24.189        .29986E-05   -.36236E-04
  17  norm          .10000E-03    3.1958        .95688E-08** at limit **
  18  Normalizat    .91456        .20148        .20129E-05    .83735E-04
  19  Prefactor     .99141        .17052       -.18219E-06    .19993E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 16.7725
  Prefactor  = 0.000100003
  norm       = 0.000100001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  norm       = 5.14151
  Prefactor  = 3.01665
  Prefactor  = 1.43504
  Prefactor  = 0.000100026
  Prefactor  = 0.0001
  norm       = 1.54959
  Prefactor  = 12.4131
  norm       = 3.56735
  Prefactor  = 44.6599
  norm       = 0.0001
  Normalizat = 0.914565
  Prefactor  = 0.991406
 **********
 **   18 **HESSE 
 **********

 FCN=   5215.970     FROM HESSE     STATUS=OK           268 CALLS     1913 TOTAL
                     EDM=   .15E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     16.773        13.859        .97827E-04   -1.4889    
   2  Prefactor     .10000E-03    156.45        .21209E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   3  norm          .10000E-03    17.884        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     .10000E-03    5.8569        .17008E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  Prefactor     .10000E-03    13.856        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  Prefactor     .10000E-03    15.794        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   7  Prefactor     .10000E-03    5.9617        .17215E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          5.1415        1.8051        .55477E-04   -1.5254    
   9  Prefactor     3.0166        3.9866        .16146E-03   -1.5361    
  10  Prefactor     1.4350        1.6631        .97844E-04   -1.5468    
  11  Prefactor     .10003E-03    21.252        .23864E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor     .10000E-03    13.716        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  13  norm          1.5496        .89531        .44219E-04   -1.5459    
  14  Prefactor     12.413        11.635        .11372E-03   -1.5003    
  15  norm          3.5674        1.6643        .60109E-04   -1.5330    
  16  Prefactor     44.660        24.177        .59999E-04   -1.4370    
  17  norm          .10000E-03    3.1974        .12609E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Normalizat    .91456        .23030        .27176E-03   -.95950    
  19  Prefactor     .99141        .19601        .23063E-03   -.93017    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.52358e-09
Minuit parameter uncertainties:
  1  13.8614
  2  0.00139217
  3  0.000293246
  4  5.0582e-05
  5  2.40176e-05
  6  2.92668e-05
  7  1.1315e-05
  8  1.80513
  9  3.98692
  10  1.66311
  11  0.00149986
  12  7.61595e-05
  13  0.895314
  14  11.6371
  15  1.66434
  16  24.1827
  17  1.94761e-06
  18  0.230551
  19  0.196148
Done.

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

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.435e+00  1.663e+00  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  2.368e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
218        Scale:  8.643e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
533    Prefactor:  9.914e-01  1.961e-01  0.000e+00  1.000e+01 ( 1.000e+00)
534        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
535        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
532   Normalization:  9.146e-01  2.306e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 1.84
Ra Dec: 160.150 6.285
Photon Index (Fixed Index): 2.37 +/- 0.00
Photon Flux (Fixed Index): 1.73e-08 +/- 2.01e-08
Energy Flux (Fixed Index): 5.93e-06 +/- 6.88e-06

TS (Fixed Index): 1.84
Ra Dec: 160.150 6.285
Photon Flux Upper Limit: 8.03e-08 ph cm-2 s-1
Energy Flux Upper Limit: 6.19e-03 MeV cm-2 s-1

Saving results to:
/scratch/kocevski/66788/likelihoodResults_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.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) = 5214.49708878
delta logL = 1.47274444928

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 5214.47370507
delta logL = 1.49612815976

Fit tolerance = 1e-08

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

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

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   5214.474     FROM MIGRAD    STATUS=CONVERGED     49 CALLS      201 TOTAL
                     EDM=   .77E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     1.0643        1.1167        .11857E-01   -.26947E-03
   2  Index         1.1451        .41547        .21548       -.56506E-04
   3  Normalizat    .92680        .19180        .45242E-01    .84171E-05
   4  Prefactor     .98586        .16968        .46091E-01   -.67066E-05
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 1.06429
  Index      = 1.14506
  Normalizat = 0.926805
  Prefactor  = 0.985862
 **********
 **   18 **HESSE 
 **********

 FCN=   5214.474     FROM HESSE     STATUS=OK            35 CALLS      236 TOTAL
                     EDM=   .42E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     1.0643        1.5685        .72682E-03   -1.5502    
   2  Index         1.1451        .61159        .87857E-02   -.88039    
   3  Normalizat    .92680        .21995        .27003E-03   -.95525    
   4  Prefactor     .98586        .19463        .23108E-03   -.93202    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 4.18579e-10
Minuit parameter uncertainties:
  1  1.56855
  2  0.615416
  3  0.220165
  4  0.194765
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/66788': 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) = 5214.47370384
delta logL = 1.49612939271

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.064e+00  1.569e+00  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  1.145e+00  6.154e-01  0.000e+00  1.000e+01 (-1.000e+00)
218        Scale:  8.643e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
533    Prefactor:  9.859e-01  1.948e-01  0.000e+00  1.000e+01 ( 1.000e+00)
534        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
535        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
532   Normalization:  9.268e-01  2.202e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 4.83
Ra Dec: 160.150 6.285
Photon Index (Free Index): 1.15 +/- 0.62
Photon Flux (Free Index): 5.49e-09 +/- 6.56e-09
Energy Flux (Free Index): 5.39e-05 +/- 8.38e-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/66788/cmap_HighResolution_451612801_451872001_4FGL_J1040.5+0617_daily_bin819.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='6.19e-03', comment='SUCCESS', photon_flux='1.73e-08', energy_flux2='5.39e-05', photon_flux_error='2.01e-08', dlogl='1.50e+00', energy_flux='5.93e-06', photon_flux2='5.49e-09', job_status='DONE', time_completed='2021-09-02 08:37:35.147288', photon_index_error2='0.62', photon_index2='1.15', ts='1.84', fit_tolerance='1e-08', GAL='0.99', photon_index_error='0.00', photon_flux_upper_limit='8.03e-08', energy_flux_error2='8.38e-05', EG='0.91', time_epoch_completed='1630597055.15', return_code='0', job_id='66788', GAL2='0.99', EG2='0.93', return_code2='0', energy_flux_error='6.88e-06', photon_flux_error2='6.56e-09', ts2='4.83', photon_index='2.37' WHERE bin_id='819' AND source_name='4FGL J1040.5+0617' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Sep  2 08:37:35 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0278>
Subject: Job 66788: <4FGL_J1040.5+0617_daily_bin819> in cluster <slac> Done

Job <4FGL_J1040.5+0617_daily_bin819> was submitted from host <rhel6-64l> by user <kocevski> in cluster <slac> at Thu Sep  2 08:26:25 2021
Job was executed on host(s) <bullet0278>, in queue <medium>, as user <kocevski> in cluster <slac> at Thu Sep  2 08:26:28 2021
</u/ki/kocevski> was used as the home directory.
</u/ki/kocevski> was used as the working directory.
Started at Thu Sep  2 08:26:28 2021
Terminated at Thu Sep  2 08:37:35 2021
Results reported at Thu Sep  2 08:37:35 2021

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1040.5+0617_daily_bin819 160.15 6.2848 451612801 451872001 irfs=P8R3_SOURCE_V2 zmax=90 ROI=12 association=4FGL_J1040.5+0617 fixedModel=True performFreeIndexFit=True freeVariableSources=True nuke=True repositoryJob=True verbose=False
------------------------------------------------------------

Successfully completed.

Resource usage summary:

    CPU time :                                   520.23 sec.
    Max Memory :                                 1255 MB
    Average Memory :                             314.90 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   668 sec.
    Turnaround time :                            670 sec.

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

