/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 5 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 = 7484
number of fields = 27
No RA_SUN column yet. Adding RA_SUN/DEC_SUN columns.
Done.


Performing analysis on: 4FGL_J1040.5+0617_daily_bin364
RA = 160.15, Dec = 6.2848
tmin = 333676801, tmax = 333936001
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='64218', job_status='RUN', time_executed='2021-09-02 08:16:33.870803', time_epoch_executed='1630595793.87' WHERE source_name='4FGL J1040.5+0617' and cadence='daily' and bin_id='364'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/64218

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

Retrieving the FT1 file...

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

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

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/64218/ft1_4FGL_J1040.5+0617_daily_bin364.fits


Retrieving the FT1 file...

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

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/64218/ft2_4FGL_J1040.5+0617_daily_bin364.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/64218/ft1_4FGL_J1040.5+0617_daily_bin364.fits outfile=/scratch/kocevski/64218/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin364.fits ra=160.15 dec=6.2848 rad=12.0 tmin=333676801.0 tmax=333936001.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.87
user 3.58
sys 0.25

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

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/64218/ft2_4FGL_J1040.5+0617_daily_bin364.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/64218/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin364.fits evtable="EVENTS" outfile="/scratch/kocevski/64218/ft1_filtered_4FGL_J1040.5+0617_daily_bin364.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.56
user 0.34
sys 0.16

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/64218/ft1_filtered_4FGL_J1040.5+0617_daily_bin364.fits" evtable="EVENTS" scfile=/scratch/kocevski/64218/ft2_4FGL_J1040.5+0617_daily_bin364.fits sctable="SC_DATA" outfile=/scratch/kocevski/64218/ltcube_333676801_333936001_4FGL_J1040.5+0617_daily_bin364.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/64218/ft2_4FGL_J1040.5+0617_daily_bin364.fits
.....................!
real 14.95
user 14.51
sys 0.38

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/64218/ft1_filtered_4FGL_J1040.5+0617_daily_bin364.fits evtable="EVENTS" scfile=/scratch/kocevski/64218/ft2_4FGL_J1040.5+0617_daily_bin364.fits sctable="SC_DATA" expcube=/scratch/kocevski/64218/ltcube_333676801_333936001_4FGL_J1040.5+0617_daily_bin364.fits outfile=/scratch/kocevski/64218/expmap_333676801_333936001_4FGL_J1040.5+0617_daily_bin364.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/64218/ltcube_333676801_333936001_4FGL_J1040.5+0617_daily_bin364.fits
.....................!
real 192.60
user 186.74
sys 5.33

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/64218/ft1_filtered_4FGL_J1040.5+0617_daily_bin364.fits scfile=/scratch/kocevski/64218/ft2_4FGL_J1040.5+0617_daily_bin364.fits outfile=/scratch/kocevski/64218/cmap_333676801_333936001_4FGL_J1040.5+0617_daily_bin364.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.55
user 0.38
sys 0.16

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/64218/ft1_filtered_4FGL_J1040.5+0617_daily_bin364.fits scfile=/scratch/kocevski/64218/ft2_4FGL_J1040.5+0617_daily_bin364.fits outfile=/scratch/kocevski/64218/cmap_HighResolution_333676801_333936001_4FGL_J1040.5+0617_daily_bin364.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.56
user 0.37
sys 0.19

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

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

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    60.197       1.0000         .10000E-03   10000.    
     2 'Prefactor '    .13852       1.0000         .10000E-03   10000.    
     3 'norm      '    11.474       1.0000         .10000E-03   10000.    
     4 'Prefactor '    10.747       1.0000         .10000E-03   10000.    
     5 'Prefactor '    .22673E-03   1.0000         .10000E-03   10000.    
     6 'Prefactor '    25.968       1.0000         .10000E-03   10000.    
     7 'Prefactor '    .12482E-03   1.0000         .10000E-03   10000.    
     8 'norm      '    1.4345       1.0000         .10000E-03   10000.    
     9 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
    10 'Prefactor '    .10004E-03   1.0000         .10000E-03   10000.    
    11 'Prefactor '    .10004E-03   1.0000         .10000E-03   10000.    
    12 'Prefactor '    18.945       1.0000         .10000E-03   10000.    
    13 'norm      '    3.0312       1.0000         .10000E-03   10000.    
    14 'Prefactor '    4.2870       1.0000         .10000E-03   10000.    
    15 'norm      '    1.8391       1.0000         .10000E-03   10000.    
    16 'Prefactor '    .10166E-03   1.0000         .10000E-03   10000.    
    17 'norm      '    .10306E-03   1.0000         .10000E-03   10000.    
    18 'Normalizat'    1.3712       1.0000         .10000E-01   10.000    
    19 'Prefactor '    .95842       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.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   6430.754     FROM MIGRAD    STATUS=CONVERGED    714 CALLS     2554 TOTAL
                     EDM=   .97E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     60.228        24.769        .51713E-04   -.65953E-05
   2  Prefactor     .10467E-03    53.547        .16350    ** at limit **
   3  norm          11.470        19.595        .11827E-03    .11622E-03
   4  Prefactor     10.749        17.539        .12221E-03   -.42149E-03
   5  Prefactor     .10001E-03    637.01        .36285E-03** at limit **
   6  Prefactor     25.887        109.13        .78611E-04   -.10887E-03
   7  Prefactor     .10001E-03    45.586        .18142E-02** at limit **
   8  norm          1.4347        1.3653        .89081E-04   -.60621E-04
   9  Prefactor     .10000E-03    1.7689        .10410E-02** at limit **
  10  Prefactor     .10000E-03    1.6656        .10026E-02** at limit **
  11  Prefactor     .10000E-03    3.2294        .14018E-02** at limit **
  12  Prefactor     18.950        10.992        .92019E-04   -.17222E-03
  13  norm          3.0311        1.0306        .18780E-03    .75611E-03
  14  Prefactor     4.2859        14.111        .19458E-03    .65847E-04
  15  norm          1.8389        1.4902        .84722E-04    .13191E-03
  16  Prefactor     .10000E-03    60.076        .18142E-02** at limit **
  17  norm          .10000E-03    30.046        .36285E-03** at limit **
  18  Normalizat    1.3715        .26186        .28138E-03   -.50349E-03
  19  Prefactor     .95829        .21213        .27495E-03   -.34141E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 60.2278
  Prefactor  = 0.00010467
  norm       = 11.4701
  Prefactor  = 10.7487
  Prefactor  = 0.000100006
  Prefactor  = 25.8874
  Prefactor  = 0.000100006
  norm       = 1.4347
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 18.9503
  norm       = 3.0311
  Prefactor  = 4.28592
  norm       = 1.83888
  Prefactor  = 0.000100001
  norm       = 0.0001
  Normalizat = 1.37147
  Prefactor  = 0.958292
 **********
 **   18 **HESSE 
 **********

 FCN=   6430.754     FROM HESSE     STATUS=OK           258 CALLS     2812 TOTAL
                     EDM=   .97E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     60.228        24.771        .20685E-05   -1.4154    
   2  Prefactor     .10467E-03    55.753        .15922       -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   3  norm          11.470        19.597        .47307E-05   -1.5030    
   4  Prefactor     10.749        17.542        .48885E-05   -1.5052    
   5  Prefactor     .10001E-03    637.07        .72569E-04   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  Prefactor     25.887        109.16        .15722E-04   -1.4690    
   7  Prefactor     .10001E-03    45.592        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          1.4347        1.3653        .35632E-05   -1.5468    
   9  Prefactor     .10000E-03    1.7689        .20820E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     .10000E-03    1.6658        .20052E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  Prefactor     .10000E-03    3.2299        .28036E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor     18.950        10.991        .36808E-05   -1.4837    
  13  norm          3.0311        1.0308        .75119E-05   -1.5360    
  14  Prefactor     4.2859        14.110        .77832E-05   -1.5294    
  15  norm          1.8389        1.4902        .33889E-05   -1.5437    
  16  Prefactor     .10000E-03    60.114        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  17  norm          .10000E-03    30.049        .72569E-04   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Normalizat    1.3715        .26208        .56276E-04   -.81457    
  19  Prefactor     .95829        .21232        .54991E-04   -.94133    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 9.74891e-10
Minuit parameter uncertainties:
  1  24.7757
  2  0.0323008
  3  19.6077
  4  17.5506
  5  0.00396605
  6  106.65
  7  0.00104004
  8  1.3653
  9  5.67853e-06
  10  9.54613e-06
  11  1.74891e-05
  12  10.9925
  13  1.03078
  14  14.1211
  15  1.49021
  16  0.000530192
  17  0.00020744
  18  0.262333
  19  0.2125
Done.

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

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.000e-04  9.546e-06  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.583e-01  2.125e-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.371e+00  2.623e-01  1.000e-02  1.000e+01 ( 1.000e+00)


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

Saving results to:
/scratch/kocevski/64218/likelihoodResults_333676801_333936001_4FGL_J1040.5+0617_daily_bin364.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): 102
logL (Free Index) = 6430.75729899
delta logL = -0.0028404126906

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 6430.75445866
delta logL = -7.79091351433e-08

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .10003E-03   1.0000         .10000E-03   10000.    
     2 'Index     '    2.3637       1.0000          .0000       10.000    
     3 'Normalizat'    1.3715       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .95832       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.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MIGRAD TERMINATED WITHOUT CONVERGENCE.

 FCN=   6430.754     FROM MIGRAD    STATUS=FAILED        87 CALLS      238 TOTAL
                     EDM=   .21E-04    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10018E-03    119.83        .10034E-02** at limit **
   2  Index         2.2714        6.1847        .50000        .58311E-05
   3  Normalizat    1.3715        .50833E-01    .28138E-03   -.11879E-04
   4  Prefactor     .95829        .42597E-01    .27495E-03    .21087E-05
                               ERR DEF=  .500    
 START SIMPLEX MINIMIZATION.    CONVERGENCE WHEN EDM .LT.   .20E-04
 SIMPLEX MINIMIZATION HAS CONVERGED.

 FCN=   6430.754     FROM SIMPLEX   STATUS=UNCHANGED    141 CALLS      379 TOTAL
                     EDM=   .16E-04    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10018E-03    119.83        .25239E-03** at limit **
   2  Index         2.2714        6.1847        .60061E-04    .58311E-05
   3  Normalizat    1.3715        .50833E-01    .18057E-05   -.11879E-04
   4  Prefactor     .95829        .42597E-01    .12121E-05    .21087E-05
                               ERR DEF=  .500    

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   6430.754     FROM MIGRAD    STATUS=CONVERGED     36 CALLS      415 TOTAL
                     EDM=   .40E-11    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    1.6875        .20068E-03** at limit **
   2  Index         2.2379        7.3141        .20000E-01   -.21600E-07
   3  Normalizat    1.3715        .25107        .11255E-04   -.47070E-04
   4  Prefactor     .95829        .21079        .10998E-04   -.38040E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Index      = 2.23785
  Normalizat = 1.37148
  Prefactor  = 0.958291
 **********
 **   18 **HESSE 
 **********

 FCN=   6430.754     FROM HESSE     STATUS=OK            23 CALLS      438 TOTAL
                     EDM=   .41E-11    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    1.6854        .40136E-04   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         2.2379        7.3497        .80000E-03   -.58528    
   3  Normalizat    1.3715        .25073        .22510E-05   -.81457    
   4  Prefactor     .95829        .21052        .21996E-05   -.94133    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 4.06276e-12
Minuit parameter uncertainties:
  1  2.37855e-06
  2  153.025
  3  0.250951
  4  0.210697
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/64218': 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) = 6430.75445823
delta logL = 3.48151843355e-07

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.000e-04  2.379e-06  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  2.238e+00  1.530e+02  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.583e-01  2.107e-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.371e+00  2.510e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): -0.00
Ra Dec: 160.150 6.285

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/64218/cmap_HighResolution_333676801_333936001_4FGL_J1040.5+0617_daily_bin364.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='5.93e-03', job_status='DONE', photon_flux_upper_limit='7.69e-08', time_completed='2021-09-02 08:27:19.696075', job_id='64218', GAL2='0.96', fit_tolerance='1e-08', EG2='1.37', EG='1.37', time_epoch_completed='1630596439.7', return_code2='0', ts='-0.00', comment='SUCCESS', return_code='0', GAL='0.96', dlogl='3.48e-07', ts2='-0.00', photon_index_error='0.00', photon_index='2.37' WHERE bin_id='364' AND source_name='4FGL J1040.5+0617' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Sep  2 08:27:19 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0122>
Subject: Job 64218: <4FGL_J1040.5+0617_daily_bin364> in cluster <slac> Done

Job <4FGL_J1040.5+0617_daily_bin364> was submitted from host <rhel6-64p> by user <kocevski> in cluster <slac> at Thu Sep  2 08:16:14 2021
Job was executed on host(s) <bullet0122>, in queue <medium>, as user <kocevski> in cluster <slac> at Thu Sep  2 08:16:20 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:16:20 2021
Terminated at Thu Sep  2 08:27:20 2021
Results reported at Thu Sep  2 08:27:20 2021

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1040.5+0617_daily_bin364 160.15 6.2848 333676801 333936001 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 :                                   642.00 sec.
    Max Memory :                                 1094 MB
    Average Memory :                             323.91 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   660 sec.
    Turnaround time :                            666 sec.

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

