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


Performing analysis on: 4FGL_J1040.5+0617_daily_bin969
RA = 160.15, Dec = 6.2848
tmin = 490492801, tmax = 490752001
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='66991', job_status='RUN', time_executed='2021-09-02 08:29:12.736627', time_epoch_executed='1630596552.74' WHERE source_name='4FGL J1040.5+0617' and cadence='daily' and bin_id='969'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/66991

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

Retrieving the FT1 file...

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

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

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/66991/ft1_4FGL_J1040.5+0617_daily_bin969.fits


Retrieving the FT1 file...

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

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/66991/ft2_4FGL_J1040.5+0617_daily_bin969.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/66991/ft1_4FGL_J1040.5+0617_daily_bin969.fits outfile=/scratch/kocevski/66991/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin969.fits ra=160.15 dec=6.2848 rad=12.0 tmin=490492801.0 tmax=490752001.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 5.94
user 5.61
sys 0.24

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

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/66991/ft2_4FGL_J1040.5+0617_daily_bin969.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/66991/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin969.fits evtable="EVENTS" outfile="/scratch/kocevski/66991/ft1_filtered_4FGL_J1040.5+0617_daily_bin969.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.15

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/66991/ft1_filtered_4FGL_J1040.5+0617_daily_bin969.fits" evtable="EVENTS" scfile=/scratch/kocevski/66991/ft2_4FGL_J1040.5+0617_daily_bin969.fits sctable="SC_DATA" outfile=/scratch/kocevski/66991/ltcube_490492801_490752001_4FGL_J1040.5+0617_daily_bin969.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/66991/ft2_4FGL_J1040.5+0617_daily_bin969.fits
.....................!
real 15.68
user 15.29
sys 0.32

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/66991/ft1_filtered_4FGL_J1040.5+0617_daily_bin969.fits evtable="EVENTS" scfile=/scratch/kocevski/66991/ft2_4FGL_J1040.5+0617_daily_bin969.fits sctable="SC_DATA" expcube=/scratch/kocevski/66991/ltcube_490492801_490752001_4FGL_J1040.5+0617_daily_bin969.fits outfile=/scratch/kocevski/66991/expmap_490492801_490752001_4FGL_J1040.5+0617_daily_bin969.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/66991/ltcube_490492801_490752001_4FGL_J1040.5+0617_daily_bin969.fits
.....................!
real 192.08
user 186.34
sys 5.03

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/66991/ft1_filtered_4FGL_J1040.5+0617_daily_bin969.fits scfile=/scratch/kocevski/66991/ft2_4FGL_J1040.5+0617_daily_bin969.fits outfile=/scratch/kocevski/66991/cmap_490492801_490752001_4FGL_J1040.5+0617_daily_bin969.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 2.51
user 0.39
sys 0.18

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/66991/ft1_filtered_4FGL_J1040.5+0617_daily_bin969.fits scfile=/scratch/kocevski/66991/ft2_4FGL_J1040.5+0617_daily_bin969.fits outfile=/scratch/kocevski/66991/cmap_HighResolution_490492801_490752001_4FGL_J1040.5+0617_daily_bin969.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 2.09
user 0.40
sys 0.19

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

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

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    3.3124       1.0000         .10000E-03   10000.    
     2 'Prefactor '    63.625       1.0000         .10000E-03   10000.    
     3 'norm      '    .10973E-03   1.0000         .10000E-03   10000.    
     4 'Prefactor '    .13852E-03   1.0000         .10000E-03   10000.    
     5 'Prefactor '    .21014E-03   1.0000         .10000E-03   10000.    
     6 'Prefactor '    22.079       1.0000         .10000E-03   10000.    
     7 'Prefactor '    .29124E-03   1.0000         .10000E-03   10000.    
     8 'norm      '    1.5813       1.0000         .10000E-03   10000.    
     9 'Prefactor '    .14224E-03   1.0000         .10000E-03   10000.    
    10 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    11 'Prefactor '    .87726E-03   1.0000         .10000E-03   10000.    
    12 'Prefactor '    3.5625       1.0000         .10000E-03   10000.    
    13 'norm      '    2.2836       1.0000         .10000E-03   10000.    
    14 'Prefactor '    .11018E-03   1.0000         .10000E-03   10000.    
    15 'norm      '    .10028E-03   1.0000         .10000E-03   10000.    
    16 'Prefactor '    1.8210       1.0000         .10000E-03   10000.    
    17 'norm      '    6.9815       1.0000         .10000E-03   10000.    
    18 'Normalizat'    1.0374       1.0000         .10000E-01   10.000    
    19 'Prefactor '    .94169       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=   5338.143     FROM MIGRAD    STATUS=CONVERGED    388 CALLS     1920 TOTAL
                     EDM=   .25E-09  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  4.4%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     3.3127        6.8889        .42783E-06   -.26682E-04
   2  Prefactor     63.608        48.474        .12851E-05   -.10014E-04
   3  norm          .10000E-03    19.009        .89874E-06** at limit **
   4  Prefactor     .10000E-03    13.120        .30235E-05** at limit **
   5  Prefactor     .10000E-03    53.638        .81118E-06** at limit **
   6  Prefactor     22.146        49.840       -.74777E-05    .45484E-04
   7  Prefactor     .10000E-03    23.834        .49964E-05** at limit **
   8  norm          1.5820        1.3723        .29042E-07    .29500E-03
   9  Prefactor     .10000E-03    5.1956       -.13350E-05** at limit **
  10  Prefactor     .10000E-03    .85332        .21366E-07** at limit **
  11  Prefactor     .10000E-03    7.8311       -.70987E-06** at limit **
  12  Prefactor     3.5640        6.7312       -.20872E-06    .30315E-04
  13  norm          2.2832        .68204       -.68433E-08    .16396E-03
  14  Prefactor     .10000E-03    6.3715       -.19747E-08** at limit **
  15  norm          .10000E-03    .71063       -.14913E-07** at limit **
  16  Prefactor     1.8145        30.187        .37964E-05   -.85945E-04
  17  norm          6.9841        11.364       -.41006E-07    .92885E-05
  18  Normalizat    1.0371        .20183        .36766E-06    .19593E-03
  19  Prefactor     .94187        .16683        .51404E-06    .20446E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 3.31271
  Prefactor  = 63.608
  norm       = 0.0001
  Prefactor  = 0.000100001
  Prefactor  = 0.0001
  Prefactor  = 22.146
  Prefactor  = 0.000100002
  norm       = 1.58205
  Prefactor  = 0.000100004
  Prefactor  = 0.0001
  Prefactor  = 0.000100001
  Prefactor  = 3.56396
  norm       = 2.28322
  Prefactor  = 0.0001
  norm       = 0.0001
  Prefactor  = 1.81451
  norm       = 6.98408
  Normalizat = 1.0371
  Prefactor  = 0.941872
 **********
 **   18 **HESSE 
 **********

 FCN=   5338.143     FROM HESSE     STATUS=OK           266 CALLS     2186 TOTAL
                     EDM=   .72E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     3.3127        6.8606        .22243E-03   -1.5344    
   2  Prefactor     63.608        48.167        .50309E-04   -1.4111    
   3  norm          .10000E-03    19.274        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     .10000E-03    13.405        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  Prefactor     .10000E-03    53.676        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  Prefactor     22.146        50.445        .85243E-04   -1.4766    
   7  Prefactor     .10000E-03    24.613        .21402E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          1.5820        1.3569        .75664E-04   -1.5456    
   9  Prefactor     .10000E-03    12.880        .30786E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     .10000E-03    .85733        .65888E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  Prefactor     .10000E-03    26.547        .38226E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor     3.5640        6.7064        .21413E-03   -1.5330    
  13  norm          2.2832        .68015        .31498E-04   -1.5406    
  14  Prefactor     .10000E-03    6.4520        .17980E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  norm          .10000E-03    .73343        .12002E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  16  Prefactor     1.8145        32.409        .15472E-02   -1.5439    
  17  norm          6.9841        11.358        .15183E-03   -1.5179    
  18  Normalizat    1.0371        .22992        .25422E-03   -.91798    
  19  Prefactor     .94187        .19420        .22853E-03   -.94693    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 7.24973e-10
Minuit parameter uncertainties:
  1  6.86225
  2  48.1969
  3  3.91348e-05
  4  0.000247297
  5  0.000203239
  6  50.5428
  7  0.000482362
  8  1.35695
  9  0.000476695
  10  9.03809e-10
  11  0.000316541
  12  6.70781
  13  0.680153
  14  5.99238e-06
  15  1.66948e-06
  16  15.3464
  17  11.3618
  18  0.230136
  19  0.194342
Done.

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

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.000e-04  9.038e-10  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.419e-01  1.943e-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.037e+00  2.301e-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: 5.37e-08 ph cm-2 s-1
Energy Flux Upper Limit: 4.14e-03 MeV cm-2 s-1

Saving results to:
/scratch/kocevski/66991/likelihoodResults_490492801_490752001_4FGL_J1040.5+0617_daily_bin969.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) = 5338.14877575
delta logL = -0.00540358180751

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 5338.14337366
delta logL = -1.49319566844e-06

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .10427E-03   1.0000         .10000E-03   10000.    
     2 'Index     '    2.3465       1.0000          .0000       10.000    
     3 'Normalizat'    1.0370       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .94199       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.
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.

 MIGRAD MINIMIZATION HAS CONVERGED.

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

 FCN=   5338.143     FROM MIGRAD    STATUS=FAILED       110 CALLS      254 TOTAL
                     EDM=   .50E-06    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    75.475        .76880E-03** at limit **
   2  Index         1.7902        7.2904        .50000       -.63932E-05
   3  Normalizat    1.0371        .42060E-01    .25423E-03   -.33315E-04
   4  Prefactor     .94187        .36395E-01    .22853E-03   -.28256E-04
                               ERR DEF=  .500    
 START SIMPLEX MINIMIZATION.    CONVERGENCE WHEN EDM .LT.   .20E-04
 SIMPLEX MINIMIZATION HAS CONVERGED.

 FCN=   5338.143     FROM SIMPLEX   STATUS=UNCHANGED    194 CALLS      448 TOTAL
                     EDM=   .10E-04    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    75.475        .16193E-03** at limit **
   2  Index         1.7902        7.2904        .31572E-06   -.63932E-05
   3  Normalizat    1.0371        .42060E-01    .11453E-07   -.33315E-04
   4  Prefactor     .94187        .36395E-01    .19295E-08   -.28256E-04
                               ERR DEF=  .500    

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   5338.143     FROM MIGRAD    STATUS=CONVERGED     74 CALLS      522 TOTAL
                     EDM=   .83E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    1.2559        .30752E-04** at limit **
   2  Index         1.7902        5.3519        .50000       -.64180E-05
   3  Normalizat    1.0371        .22378        .20338E-05   -.33539E-04
   4  Prefactor     .94187        .19364        .18283E-05   -.27361E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Index      = 1.79017
  Normalizat = 1.0371
  Prefactor  = 0.941872
 **********
 **   18 **HESSE 
 **********

 FCN=   5338.143     FROM HESSE     STATUS=OK            27 CALLS      549 TOTAL
                     EDM=   .77E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    1.1686        .61504E-05   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         1.7902        5.8579        .50000       -.69706    
   3  Normalizat    1.0371        .21194        .40676E-06   -.91798    
   4  Prefactor     .94187        .18344        .36565E-06   -.94693    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 7.65775e-09
Minuit parameter uncertainties:
  1  4.80989e-06
  2  52.187
  3  0.212115
  4  0.183562
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/66991': 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) = 5338.14335676
delta logL = 1.54061763169e-05

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.000e-04  4.810e-06  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  1.790e+00  5.219e+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.419e-01  1.836e-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.037e+00  2.121e-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/66991/cmap_HighResolution_490492801_490752001_4FGL_J1040.5+0617_daily_bin969.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='4.14e-03', job_status='DONE', photon_flux_upper_limit='5.37e-08', time_completed='2021-09-02 08:38:52.190508', job_id='66991', GAL2='0.94', fit_tolerance='1e-08', EG2='1.04', EG='1.04', time_epoch_completed='1630597132.19', return_code2='0', ts='-0.00', comment='SUCCESS', return_code='0', GAL='0.94', dlogl='1.54e-05', ts2='-0.00', photon_index_error='0.00', photon_index='2.37' WHERE bin_id='969' AND source_name='4FGL J1040.5+0617' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Sep  2 08:38:52 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0274>
Subject: Job 66991: <4FGL_J1040.5+0617_daily_bin969> in cluster <slac> Done

Job <4FGL_J1040.5+0617_daily_bin969> was submitted from host <rhel6-64l> by user <kocevski> in cluster <slac> at Thu Sep  2 08:26:42 2021
Job was executed on host(s) <bullet0274>, in queue <medium>, as user <kocevski> in cluster <slac> at Thu Sep  2 08:26:52 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:52 2021
Terminated at Thu Sep  2 08:38:52 2021
Results reported at Thu Sep  2 08:38:52 2021

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1040.5+0617_daily_bin969 160.15 6.2848 490492801 490752001 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 :                                   568.00 sec.
    Max Memory :                                 1256 MB
    Average Memory :                             322.33 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   720 sec.
    Turnaround time :                            730 sec.

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

