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


Performing analysis on: 4FGL_J1040.5+0617_daily_bin242
RA = 160.15, Dec = 6.2848
tmin = 302054401, tmax = 302313601
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='62802', job_status='RUN', time_executed='2021-09-02 08:13:00.955550', time_epoch_executed='1630595580.96' WHERE source_name='4FGL J1040.5+0617' and cadence='daily' and bin_id='242'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/62802

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

Retrieving the FT1 file...

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

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

Retrieving 47 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/62802/ft1_4FGL_J1040.5+0617_daily_bin242.fits


Retrieving the FT1 file...

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

Retrieving 47 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/62802/ft2_4FGL_J1040.5+0617_daily_bin242.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/62802/ft1_4FGL_J1040.5+0617_daily_bin242.fits outfile=/scratch/kocevski/62802/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin242.fits ra=160.15 dec=6.2848 rad=12.0 tmin=302054401.0 tmax=302313601.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.86
user 3.41
sys 0.18

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

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/62802/ft2_4FGL_J1040.5+0617_daily_bin242.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/62802/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin242.fits evtable="EVENTS" outfile="/scratch/kocevski/62802/ft1_filtered_4FGL_J1040.5+0617_daily_bin242.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/62802/ft1_filtered_4FGL_J1040.5+0617_daily_bin242.fits" evtable="EVENTS" scfile=/scratch/kocevski/62802/ft2_4FGL_J1040.5+0617_daily_bin242.fits sctable="SC_DATA" outfile=/scratch/kocevski/62802/ltcube_302054401_302313601_4FGL_J1040.5+0617_daily_bin242.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/62802/ft2_4FGL_J1040.5+0617_daily_bin242.fits
.....................!
real 12.95
user 12.57
sys 0.34

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/62802/ft1_filtered_4FGL_J1040.5+0617_daily_bin242.fits evtable="EVENTS" scfile=/scratch/kocevski/62802/ft2_4FGL_J1040.5+0617_daily_bin242.fits sctable="SC_DATA" expcube=/scratch/kocevski/62802/ltcube_302054401_302313601_4FGL_J1040.5+0617_daily_bin242.fits outfile=/scratch/kocevski/62802/expmap_302054401_302313601_4FGL_J1040.5+0617_daily_bin242.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/62802/ltcube_302054401_302313601_4FGL_J1040.5+0617_daily_bin242.fits
.....................!
real 191.14
user 185.87
sys 4.76

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/62802/ft1_filtered_4FGL_J1040.5+0617_daily_bin242.fits scfile=/scratch/kocevski/62802/ft2_4FGL_J1040.5+0617_daily_bin242.fits outfile=/scratch/kocevski/62802/cmap_302054401_302313601_4FGL_J1040.5+0617_daily_bin242.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/62802/ft1_filtered_4FGL_J1040.5+0617_daily_bin242.fits scfile=/scratch/kocevski/62802/ft2_4FGL_J1040.5+0617_daily_bin242.fits outfile=/scratch/kocevski/62802/cmap_HighResolution_302054401_302313601_4FGL_J1040.5+0617_daily_bin242.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.54
user 0.39
sys 0.15

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

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

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .91946E-03   1.0000         .10000E-03   10000.    
     2 'Prefactor '    .10002E-03   1.0000         .10000E-03   10000.    
     3 'norm      '    .10008E-03   1.0000         .10000E-03   10000.    
     4 'Prefactor '    36.989       1.0000         .10000E-03   10000.    
     5 'Prefactor '    .10022E-03   1.0000         .10000E-03   10000.    
     6 'Prefactor '    33.844       1.0000         .10000E-03   10000.    
     7 'Prefactor '    .11196E-03   1.0000         .10000E-03   10000.    
     8 'norm      '    .41588       1.0000         .10000E-03   10000.    
     9 'Prefactor '    .10002E-03   1.0000         .10000E-03   10000.    
    10 'Prefactor '    1.0812       1.0000         .10000E-03   10000.    
    11 'Prefactor '    4.8803       1.0000         .10000E-03   10000.    
    12 'Prefactor '    .10063E-03   1.0000         .10000E-03   10000.    
    13 'norm      '    .59869       1.0000         .10000E-03   10000.    
    14 'Prefactor '    22.841       1.0000         .10000E-03   10000.    
    15 'norm      '    1.2209       1.0000         .10000E-03   10000.    
    16 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
    17 'norm      '    .10005E-03   1.0000         .10000E-03   10000.    
    18 'Normalizat'    .97108       1.0000         .10000E-01   10.000    
    19 'Prefactor '    1.1193       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=   6660.318     FROM MIGRAD    STATUS=CONVERGED    375 CALLS     1888 TOTAL
                     EDM=   .93E-09  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  5.7%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10001E-03    33.951       -.10036E-04** at limit **
   2  Prefactor     .10000E-03    14.358       -.27614E-06** at limit **
   3  norm          .10000E-03    10.584        .18534E-06** at limit **
   4  Prefactor     36.980        17.096       -.47711E-06    .41870E-03
   5  Prefactor     .10000E-03    19.886       -.18886E-08** at limit **
   6  Prefactor     33.787        59.610        .19358E-05    .12000E-03
   7  Prefactor     .10000E-03    8.4992        .32647E-06** at limit **
   8  norm          .41586        .81206       -.63028E-06   -.18223E-02
   9  Prefactor     .10000E-03    2.5185       -.13329E-07** at limit **
  10  Prefactor     1.0807        3.4933       -.44482E-06    .56797E-03
  11  Prefactor     4.8807        6.6755       -.13037E-06    .14435E-03
  12  Prefactor     .10000E-03    3.7113        .17884E-06** at limit **
  13  norm          .59835        .63275       -.10063E-06    .18790E-03
  14  Prefactor     22.845        11.188        .16607E-06    .15306E-03
  15  norm          1.2211        1.3112       -.85680E-07    .38546E-03
  16  Prefactor     .10000E-03    12.426        .18924E-07** at limit **
  17  norm          .10000E-03    5.8773       -.26404E-07** at limit **
  18  Normalizat    .97115        .20150        .98493E-06    .45933E-03
  19  Prefactor     1.1192        .16597       -.25259E-07    .32778E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.000100007
  Prefactor  = 0.0001
  norm       = 0.0001
  Prefactor  = 36.9797
  Prefactor  = 0.0001
  Prefactor  = 33.7874
  Prefactor  = 0.000100002
  norm       = 0.415864
  Prefactor  = 0.0001
  Prefactor  = 1.08074
  Prefactor  = 4.88068
  Prefactor  = 0.0001
  norm       = 0.598346
  Prefactor  = 22.8452
  norm       = 1.22108
  Prefactor  = 0.0001
  norm       = 0.0001
  Normalizat = 0.971149
  Prefactor  = 1.11918
 **********
 **   18 **HESSE 
 **********

 FCN=   6660.318     FROM HESSE     STATUS=OK           266 CALLS     2154 TOTAL
                     EDM=   .15E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10001E-03    33.574        .42028E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Prefactor     .10000E-03    14.368        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   3  norm          .10000E-03    10.615        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     36.980        16.760        .65898E-04   -1.4491    
   5  Prefactor     .10000E-03    19.899        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  Prefactor     33.787        59.780        .68882E-04   -1.4545    
   7  Prefactor     .10000E-03    8.4654        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          .41586        .77656        .11099E-02   -1.5579    
   9  Prefactor     .10000E-03    2.5302        .12644E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     1.0807        3.4687        .25208E-03   -1.5500    
  11  Prefactor     4.8807        6.6682        .18208E-03   -1.5266    
  12  Prefactor     .10000E-03    3.7364        .15345E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  13  norm          .59835        .59680        .55625E-03   -1.5553    
  14  Prefactor     22.845        10.956        .83812E-04   -1.4752    
  15  norm          1.2211        1.2885        .91727E-04   -1.5487    
  16  Prefactor     .10000E-03    12.467        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  17  norm          .10000E-03    5.9252        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Normalizat    .97115        .23279        .28274E-03   -.94003    
  19  Prefactor     1.1192        .19185        .22806E-03   -.88856    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.52976e-09
Minuit parameter uncertainties:
  1  0.000978301
  2  2.60149e-05
  3  4.26488e-07
  4  16.7618
  5  8.03204e-05
  6  59.8865
  7  0.000285019
  8  0.77658
  9  2.67044e-06
  10  3.46933
  11  6.66925
  12  1.86008e-05
  13  0.596806
  14  10.9572
  15  1.28855
  16  1.00616e-05
  17  7.8612e-08
  18  0.233034
  19  0.191967
Done.

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

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.081e+00  3.469e+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.119e+00  1.920e-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.711e-01  2.330e-01  1.000e-02  1.000e+01 ( 1.000e+00)


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

Saving results to:
/scratch/kocevski/62802/likelihoodResults_302054401_302313601_4FGL_J1040.5+0617_daily_bin242.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) = 6659.53018819
delta logL = 0.78762555402

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 6659.13371864
delta logL = 1.18409510293

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .10002E-03   1.0000         .10000E-03   10000.    
     2 'Index     '    8.2441       1.0000          .0000       10.000    
     3 'Normalizat'    .88271       1.0000         .10000E-01   10.000    
     4 'Prefactor '    1.1780       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=   6659.134     FROM MIGRAD    STATUS=FAILED       280 CALLS      639 TOTAL
                     EDM=   .41E-06    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    .19540E-01    .16440E-03** at limit **
   2  Index         8.2440        8.1706        .70749E-02    .45448E-03
   3  Normalizat    .88236        .11056        .29512E-03   -.48323E-03
   4  Prefactor     1.1784        .94806E-01    .22313E-03   -.80729E-03
                               ERR DEF=  .500    
 START SIMPLEX MINIMIZATION.    CONVERGENCE WHEN EDM .LT.   .20E-04
 SIMPLEX MINIMIZATION HAS CONVERGED.

 FCN=   6659.134     FROM SIMPLEX   STATUS=UNCHANGED    163 CALLS      802 TOTAL
                     EDM=   .11E-04    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    .19540E-01    .68928E-05** at limit **
   2  Index         8.2440        8.1706        .25530E-03    .45448E-03
   3  Normalizat    .88236        .11056        .98129E-05   -.48323E-03
   4  Prefactor     1.1784        .94806E-01    .81681E-05   -.80729E-03
                               ERR DEF=  .500    

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   6659.134     FROM MIGRAD    STATUS=CONVERGED     40 CALLS      842 TOTAL
                     EDM=   .73E-09    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    .13304E-01    .20382E-03** at limit **
   2  Index         8.2440        8.1086        .14150E-02   -.24570E-04
   3  Normalizat    .88236        .10018        .59025E-04   -.49208E-03
   4  Prefactor     1.1784        .86110E-01    .44626E-04   -.80880E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Index      = 8.24397
  Normalizat = 0.88236
  Prefactor  = 1.17837
 **********
 **   18 **HESSE 
 **********

 FCN=   6659.134     FROM HESSE     STATUS=NOT POSDEF    33 CALLS      875 TOTAL
                     EDM=   .77E-09    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE     INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    .15484E-01    .18838E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         8.2440        8.1488        .56599E-04    .70600    
   3  Normalizat    .88236        .10631        .11805E-04   -.97083    
   4  Prefactor     1.1784        .91319E-01    .89252E-05   -.86999    
                               ERR DEF=  .500    
Minuit fit quality: 2   estimated distance: 7.67661e-10
Minuit parameter uncertainties:
  1  7.16946e-08
  2  5.1859
  3  0.106331
  4  0.0913315
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/62802': 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): 102
logL (Free Index) = 6659.13371158
delta logL = 1.18410216846

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.000e-04  7.169e-08  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  8.244e+00  5.186e+00  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.178e+00  9.133e-02  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:  8.824e-01  1.063e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 2.66
Ra Dec: 160.150 6.285
Photon Index (Free Index): 8.24 +/- 5.19
Photon Flux (Free Index): 7.43e-08 +/- 7.61e-07
Energy Flux (Free Index): 8.57e-06 +/- 8.74e-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/62802/cmap_HighResolution_302054401_302313601_4FGL_J1040.5+0617_daily_bin242.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='8.34e-03', comment='SUCCESS', energy_flux2='8.57e-06', dlogl='1.18e+00', photon_flux2='7.43e-08', job_status='DONE', time_completed='2021-09-02 08:23:44.824151', photon_index_error2='5.19', photon_index2='8.24', ts='0.11', fit_tolerance='1e-08', GAL='1.12', photon_index_error='0.00', photon_flux_upper_limit='1.08e-07', energy_flux_error2='8.74e-05', EG='0.97', time_epoch_completed='1630596224.82', return_code='0', job_id='62802', GAL2='1.18', EG2='0.88', return_code2='102', photon_flux_error2='7.61e-07', ts2='2.66', photon_index='2.37' WHERE bin_id='242' AND source_name='4FGL J1040.5+0617' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Sep  2 08:23:44 PDT 2021


------------------------------------------------------------
Sender: LSF System <scs@bullet0144>
Subject: Job 62802: <4FGL_J1040.5+0617_daily_bin242> in cluster <slac> Done

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

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1040.5+0617_daily_bin242 160.15 6.2848 302054401 302313601 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 :                                   639.42 sec.
    Max Memory :                                 1256 MB
    Average Memory :                             323.91 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   703 sec.
    Turnaround time :                            751 sec.

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

