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


Performing analysis on: 4FGL_J1040.5+0617_daily_bin1583
RA = 160.15, Dec = 6.2848
tmin = 649641601, tmax = 649900801
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='70549', job_status='RUN', time_executed='2021-09-02 08:44:25.609862', time_epoch_executed='1630597465.61' WHERE source_name='4FGL J1040.5+0617' and cadence='daily' and bin_id='1583'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/70549

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

Retrieving the FT1 file...

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

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

Retrieving 47 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/70549/ft1_4FGL_J1040.5+0617_daily_bin1583.fits


Retrieving the FT1 file...

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

Retrieving 47 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/70549/ft1_4FGL_J1040.5+0617_daily_bin1583.fits outfile=/scratch/kocevski/70549/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin1583.fits ra=160.15 dec=6.2848 rad=12.0 tmin=649641601.0 tmax=649900801.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 2.56
user 2.34
sys 0.20

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

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.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/70549/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin1583.fits evtable="EVENTS" outfile="/scratch/kocevski/70549/ft1_filtered_4FGL_J1040.5+0617_daily_bin1583.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.49
user 0.33
sys 0.15

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/70549/ft1_filtered_4FGL_J1040.5+0617_daily_bin1583.fits" evtable="EVENTS" scfile=/scratch/kocevski/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.fits sctable="SC_DATA" outfile=/scratch/kocevski/70549/ltcube_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.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/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.fits
.....................!
real 12.82
user 12.46
sys 0.33

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/70549/ft1_filtered_4FGL_J1040.5+0617_daily_bin1583.fits evtable="EVENTS" scfile=/scratch/kocevski/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.fits sctable="SC_DATA" expcube=/scratch/kocevski/70549/ltcube_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.fits outfile=/scratch/kocevski/70549/expmap_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.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/70549/ltcube_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.fits
.....................!
real 191.61
user 185.03
sys 5.99

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/70549/ft1_filtered_4FGL_J1040.5+0617_daily_bin1583.fits scfile=/scratch/kocevski/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.fits outfile=/scratch/kocevski/70549/cmap_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.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.54
user 0.37
sys 0.15

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/70549/ft1_filtered_4FGL_J1040.5+0617_daily_bin1583.fits scfile=/scratch/kocevski/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.fits outfile=/scratch/kocevski/70549/cmap_HighResolution_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.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/70549/ft1_filtered_4FGL_J1040.5+0617_daily_bin1583.fits evtable="EVENTS" scfile=/scratch/kocevski/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.fits sctable="SC_DATA" srcmdl=/scratch/kocevski/70549/Model_4FGL_J1040.5+0617_daily_bin1583.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/70549/ft1_filtered_4FGL_J1040.5+0617_daily_bin1583.fits.....................!
real 63.26
user 61.85
sys 1.21

Creating the likelihood object...
obs = UnbinnedObs('/scratch/kocevski/70549/ft1_filtered_4FGL_J1040.5+0617_daily_bin1583.fits', '/scratch/kocevski/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.fits', expMap='/scratch/kocevski/70549/expmap_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.fits', expCube='/scratch/kocevski/70549/ltcube_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/scratch/kocevski/70549/Model_4FGL_J1040.5+0617_daily_bin1583.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/70549/ft1_filtered_4FGL_J1040.5+0617_daily_bin1583.fits
Spacecraft file(s): /scratch/kocevski/70549/ft2_4FGL_J1040.5+0617_daily_bin1583.fits
Exposure map: /scratch/kocevski/70549/expmap_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.fits
Exposure cube: /scratch/kocevski/70549/ltcube_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.fits
IRFs: P8R3_SOURCE_V2
Source model file: /scratch/kocevski/70549/Model_4FGL_J1040.5+0617_daily_bin1583.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) = 6792.66182284

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    12.993       1.0000         .10000E-03   10000.    
     2 'Prefactor '    23.726       1.0000         .10000E-03   10000.    
     3 'norm      '    .10275E-03   1.0000         .10000E-03   10000.    
     4 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
     5 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
     6 'Prefactor '    .10550E-03   1.0000         .10000E-03   10000.    
     7 'Prefactor '    10.239       1.0000         .10000E-03   10000.    
     8 'norm      '    1.4577       1.0000         .10000E-03   10000.    
     9 'Prefactor '    .10019E-03   1.0000         .10000E-03   10000.    
    10 'Prefactor '    2.8635       1.0000         .10000E-03   10000.    
    11 'Prefactor '    24.671       1.0000         .10000E-03   10000.    
    12 'Prefactor '    3.5793       1.0000         .10000E-03   10000.    
    13 'norm      '    .10004E-03   1.0000         .10000E-03   10000.    
    14 'Prefactor '    .10007E-03   1.0000         .10000E-03   10000.    
    15 'norm      '    .10022E-03   1.0000         .10000E-03   10000.    
    16 'Prefactor '    47.718       1.0000         .10000E-03   10000.    
    17 'norm      '    .10005E-03   1.0000         .10000E-03   10000.    
    18 'Normalizat'    1.0752       1.0000         .10000E-01   10.000    
    19 'Prefactor '    1.2080       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=   6792.640     FROM MIGRAD    STATUS=CONVERGED    410 CALLS     1971 TOTAL
                     EDM=   .45E-09  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .5%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     12.991        12.162        .11463E-04    .28393E-03
   2  Prefactor     23.718        41.909       -.62894E-05    .10565E-05
   3  norm          .10001E-03    48.075       -.26140E-04** at limit **
   4  Prefactor     .10000E-03    6.9147       -.63320E-06** at limit **
   5  Prefactor     .10000E-03    61.689        .34444E-04** at limit **
   6  Prefactor     .10002E-03    176.51       -.37620E-04** at limit **
   7  Prefactor     10.218        27.481        .61688E-05    .15421E-03
   8  norm          1.4576        1.1319       -.95409E-07   -.20534E-03
   9  Prefactor     .10000E-03    3.4755       -.70945E-07** at limit **
  10  Prefactor     2.8639        3.0333       -.38999E-06   -.28270E-03
  11  Prefactor     24.671        10.745       -.66157E-05   -.13873E-03
  12  Prefactor     3.5796        5.0051        .20731E-05   -.19528E-03
  13  norm          .10000E-03    .19357       -.48155E-07** at limit **
  14  Prefactor     .10000E-03    4.1687       -.87209E-07** at limit **
  15  norm          .10000E-03    .69214        .46745E-06** at limit **
  16  Prefactor     47.717        27.019       -.79205E-06   -.47568E-04
  17  norm          .10000E-03    5.8379       -.98702E-08** at limit **
  18  Normalizat    1.0750        .20481        .11100E-05   -.97662E-05
  19  Prefactor     1.2081        .16662       -.28823E-06    .15092E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 12.9915
  Prefactor  = 23.7179
  norm       = 0.000100011
  Prefactor  = 0.0001
  Prefactor  = 0.000100001
  Prefactor  = 0.000100017
  Prefactor  = 10.2176
  norm       = 1.45755
  Prefactor  = 0.0001
  Prefactor  = 2.8639
  Prefactor  = 24.6713
  Prefactor  = 3.5796
  norm       = 0.0001
  Prefactor  = 0.0001
  norm       = 0.0001
  Prefactor  = 47.7173
  norm       = 0.0001
  Normalizat = 1.07502
  Prefactor  = 1.20812
 **********
 **   18 **HESSE 
 **********

 FCN=   6792.640     FROM HESSE     STATUS=OK           268 CALLS     2239 TOTAL
                     EDM=   .10E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     12.991        12.203        .11113E-03   -1.4987    
   2  Prefactor     23.718        41.899        .82236E-04   -1.4734    
   3  norm          .10001E-03    50.124        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     .10000E-03    6.9338        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  Prefactor     .10000E-03    61.167        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  Prefactor     .10002E-03    177.82        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   7  Prefactor     10.218        27.414        .12522E-03   -1.5069    
   8  norm          1.4576        1.1294        .74369E-04   -1.5467    
   9  Prefactor     .10000E-03    3.5292        .14998E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     2.8639        3.0284        .14079E-03   -1.5369    
  11  Prefactor     24.671        10.742        .80648E-04   -1.4714    
  12  Prefactor     3.5796        4.9828        .20898E-03   -1.5330    
  13  norm          .10000E-03    .43897        .70024E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor     .10000E-03    4.2242        .16415E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  norm          .10000E-03    1.8723        .13254E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  16  Prefactor     47.717        27.084        .58047E-04   -1.4325    
  17  norm          .10000E-03    5.9485        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Normalizat    1.0750        .24474        .29486E-03   -.90558    
  19  Prefactor     1.2081        .19973        .23588E-03   -.86082    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.04556e-09
Minuit parameter uncertainties:
  1  12.2056
  2  41.9512
  3  0.00146514
  4  0.000109566
  5  0.000507926
  6  0.00349311
  7  27.4473
  8  1.12938
  9  3.47027e-07
  10  3.02853
  11  10.7431
  12  4.98338
  13  2.86476e-06
  14  9.42824e-06
  15  6.05119e-05
  16  27.0911
  17  6.79817e-06
  18  0.244997
  19  0.199854
Done.

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

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  2.864e+00  3.029e+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:  1.208e+00  1.999e-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:  1.075e+00  2.450e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 1.83
Ra Dec: 160.150 6.285
Photon Index (Fixed Index): 2.37 +/- 0.00
Photon Flux (Fixed Index): 3.46e-08 +/- 3.66e-08
Energy Flux (Fixed Index): 1.18e-05 +/- 1.25e-05

TS (Fixed Index): 1.83
Ra Dec: 160.150 6.285
Photon Flux Upper Limit: 1.25e-07 ph cm-2 s-1
Energy Flux Upper Limit: 9.61e-03 MeV cm-2 s-1

Saving results to:
/scratch/kocevski/70549/likelihoodResults_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.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) = 6792.61928222
delta logL = 0.0209358093434

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 6792.61615448
delta logL = 0.0240635583923

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    2.6482       1.0000         .10000E-03   10000.    
     2 'Index     '    2.5692       1.0000          .0000       10.000    
     3 'Normalizat'    1.0642       1.0000         .10000E-01   10.000    
     4 'Prefactor '    1.2136       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=   6792.616     FROM MIGRAD    STATUS=CONVERGED     54 CALLS      207 TOTAL
                     EDM=   .83E-10    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     2.6477        58.966        .62629E-02    .42917E-03
   2  Index         2.5696        6.2847        .23299        .53580E-04
   3  Normalizat    1.0644        .64772E-01    .66942E-01    .62757E-05
   4  Prefactor     1.2135        .47320E-01    .53248E-01   -.33938E-05
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 2.64775
  Index      = 2.56959
  Normalizat = 1.0644
  Prefactor  = 1.21351
 **********
 **   18 **HESSE 
 **********

 FCN=   6792.616     FROM HESSE     STATUS=OK            33 CALLS      240 TOTAL
                     EDM=   .22E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     2.6477        3.1439        .12799E-03   -1.5383    
   2  Index         2.5696        .95778        .89109E-02   -.50760    
   3  Normalizat    1.0644        .24243        .29615E-03   -.90903    
   4  Prefactor     1.2135        .20063        .23543E-03   -.85916    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.19573e-09
Minuit parameter uncertainties:
  1  3.14414
  2  0.965619
  3  0.242683
  4  0.200756
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/70549': 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) = 6792.61615402
delta logL = 0.0240640151505

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  2.648e+00  3.144e+00  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  2.570e+00  9.656e-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:  1.214e+00  2.008e-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:  1.064e+00  2.427e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 1.88
Ra Dec: 160.150 6.285
Photon Index (Free Index): 2.57 +/- 0.97
Photon Flux (Free Index): 4.31e-08 +/- 5.61e-08
Energy Flux (Free Index): 1.16e-05 +/- 1.17e-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/70549/cmap_HighResolution_649641601_649900801_4FGL_J1040.5+0617_daily_bin1583.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='9.61e-03', comment='SUCCESS', photon_flux='3.46e-08', energy_flux2='1.16e-05', photon_flux_error='3.66e-08', dlogl='2.41e-02', energy_flux='1.18e-05', photon_flux2='4.31e-08', job_status='DONE', time_completed='2021-09-02 08:54:40.681358', photon_index_error2='0.97', photon_index2='2.57', ts='1.83', fit_tolerance='1e-08', GAL='1.21', photon_index_error='0.00', photon_flux_upper_limit='1.25e-07', energy_flux_error2='1.17e-05', EG='1.08', time_epoch_completed='1630598080.68', return_code='0', job_id='70549', GAL2='1.21', EG2='1.06', return_code2='0', energy_flux_error='1.25e-05', photon_flux_error2='5.61e-08', ts2='1.88', photon_index='2.37' WHERE bin_id='1583' AND source_name='4FGL J1040.5+0617' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Sep  2 08:54:40 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0236>
Subject: Job 70549: <4FGL_J1040.5+0617_daily_bin1583> in cluster <slac> Done

Job <4FGL_J1040.5+0617_daily_bin1583> was submitted from host <rhel6-64k> by user <kocevski> in cluster <slac> at Thu Sep  2 08:41:12 2021
Job was executed on host(s) <bullet0236>, in queue <medium>, as user <kocevski> in cluster <slac> at Thu Sep  2 08:41:47 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:41:47 2021
Terminated at Thu Sep  2 08:54:41 2021
Results reported at Thu Sep  2 08:54:41 2021

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1040.5+0617_daily_bin1583 160.15 6.2848 649641601 649900801 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 :                                   597.00 sec.
    Max Memory :                                 1093 MB
    Average Memory :                             284.96 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   774 sec.
    Turnaround time :                            809 sec.

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

