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


Performing analysis on: 4FGL_J1040.5+0617_daily_bin438
RA = 160.15, Dec = 6.2848
tmin = 352857601, tmax = 353116801
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='64325', job_status='RUN', time_executed='2021-09-02 08:20:45.783011', time_epoch_executed='1630596045.78' WHERE source_name='4FGL J1040.5+0617' and cadence='daily' and bin_id='438'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/64325

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

Retrieving the FT1 file...

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

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

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/64325/ft1_4FGL_J1040.5+0617_daily_bin438.fits


Retrieving the FT1 file...

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

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/64325/ft2_4FGL_J1040.5+0617_daily_bin438.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/64325/ft1_4FGL_J1040.5+0617_daily_bin438.fits outfile=/scratch/kocevski/64325/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin438.fits ra=160.15 dec=6.2848 rad=12.0 tmin=352857601.0 tmax=353116801.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.45
user 3.20
sys 0.18

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

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

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

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/64325/ft1_filtered_4FGL_J1040.5+0617_daily_bin438.fits evtable="EVENTS" scfile=/scratch/kocevski/64325/ft2_4FGL_J1040.5+0617_daily_bin438.fits sctable="SC_DATA" expcube=/scratch/kocevski/64325/ltcube_352857601_353116801_4FGL_J1040.5+0617_daily_bin438.fits outfile=/scratch/kocevski/64325/expmap_352857601_353116801_4FGL_J1040.5+0617_daily_bin438.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/64325/ltcube_352857601_353116801_4FGL_J1040.5+0617_daily_bin438.fits
.....................!
real 191.41
user 186.87
sys 3.96

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/64325/ft1_filtered_4FGL_J1040.5+0617_daily_bin438.fits scfile=/scratch/kocevski/64325/ft2_4FGL_J1040.5+0617_daily_bin438.fits outfile=/scratch/kocevski/64325/cmap_352857601_353116801_4FGL_J1040.5+0617_daily_bin438.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.39
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/64325/ft1_filtered_4FGL_J1040.5+0617_daily_bin438.fits scfile=/scratch/kocevski/64325/ft2_4FGL_J1040.5+0617_daily_bin438.fits outfile=/scratch/kocevski/64325/cmap_HighResolution_352857601_353116801_4FGL_J1040.5+0617_daily_bin438.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.39
sys 0.16

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

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

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .10073E-03   1.0000         .10000E-03   10000.    
     2 'Prefactor '    42.818       1.0000         .10000E-03   10000.    
     3 'norm      '    .10083E-03   1.0000         .10000E-03   10000.    
     4 'Prefactor '    .10578E-03   1.0000         .10000E-03   10000.    
     5 'Prefactor '    .12774E-03   1.0000         .10000E-03   10000.    
     6 'Prefactor '    16.939       1.0000         .10000E-03   10000.    
     7 'Prefactor '    .11689E-03   1.0000         .10000E-03   10000.    
     8 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
     9 'Prefactor '    .10002E-03   1.0000         .10000E-03   10000.    
    10 'Prefactor '    .10003E-03   1.0000         .10000E-03   10000.    
    11 'Prefactor '    3.4807       1.0000         .10000E-03   10000.    
    12 'Prefactor '    33.731       1.0000         .10000E-03   10000.    
    13 'norm      '    2.1358       1.0000         .10000E-03   10000.    
    14 'Prefactor '    12.885       1.0000         .10000E-03   10000.    
    15 'norm      '    .44417       1.0000         .10000E-03   10000.    
    16 'Prefactor '    47.299       1.0000         .10000E-03   10000.    
    17 'norm      '    .10019E-03   1.0000         .10000E-03   10000.    
    18 'Normalizat'    1.0269       1.0000         .10000E-01   10.000    
    19 'Prefactor '    .96931       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=   3497.118     FROM MIGRAD    STATUS=CONVERGED    398 CALLS     1947 TOTAL
                     EDM=   .48E-10  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  1.6%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    9.0831       -.55875E-06** at limit **
   2  Prefactor     42.805        57.071       -.10465E-05   -.39641E-04
   3  norm          .10000E-03    14.407       -.12354E-05** at limit **
   4  Prefactor     .10000E-03    21.389       -.51838E-05** at limit **
   5  Prefactor     .10000E-03    101.67       -.35549E-05** at limit **
   6  Prefactor     16.881        80.678       -.43497E-05   -.16669E-04
   7  Prefactor     .10000E-03    33.700       -.49369E-05** at limit **
   8  norm          .10000E-03    .71327       -.33442E-07** at limit **
   9  Prefactor     .10000E-03    4.8958        .83655E-07** at limit **
  10  Prefactor     .10000E-03    3.8589        .55873E-07** at limit **
  11  Prefactor     3.4805        4.9753        .14887E-05   -.10051E-03
  12  Prefactor     33.739        18.716        .17258E-06    .20600E-04
  13  norm          2.1376        1.5971        .24431E-06   -.87599E-04
  14  Prefactor     12.845        25.412       -.17836E-05   -.46113E-04
  15  norm          .44401        1.2201        .46061E-06    .12324E-03
  16  Prefactor     47.301        39.455       -.16208E-06   -.33442E-05
  17  norm          .10000E-03    9.6324        .10362E-06** at limit **
  18  Normalizat    1.0268        .25662        .45892E-08    .30018E-04
  19  Prefactor     .96948        .21367       -.65146E-07    .47172E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Prefactor  = 42.8047
  norm       = 0.0001
  Prefactor  = 0.000100001
  Prefactor  = 0.000100001
  Prefactor  = 16.8814
  Prefactor  = 0.0001
  norm       = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 3.48055
  Prefactor  = 33.7388
  norm       = 2.1376
  Prefactor  = 12.8451
  norm       = 0.44401
  Prefactor  = 47.301
  norm       = 0.0001
  Normalizat = 1.02676
  Prefactor  = 0.96948
 **********
 **   18 **HESSE 
 **********

 FCN=   3497.118     FROM HESSE     STATUS=OK           268 CALLS     2215 TOTAL
                     EDM=   .11E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    9.0991        .17398E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Prefactor     42.805        57.240        .61264E-04   -1.4399    
   3  norm          .10000E-03    14.422        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     .10000E-03    21.213        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  Prefactor     .10000E-03    101.94        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  Prefactor     16.881        82.121        .97313E-04   -1.4886    
   7  Prefactor     .10000E-03    33.571        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          .10000E-03    .72242        .48759E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  Prefactor     .10000E-03    4.9085        .12779E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     .10000E-03    3.9503        .22658E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  Prefactor     3.4805        4.9890        .76555E-03   -1.5335    
  12  Prefactor     33.739        18.709        .68997E-04   -1.4546    
  13  norm          2.1376        1.6370        .47384E-04   -1.5416    
  14  Prefactor     12.845        26.189        .11159E-03   -1.4991    
  15  norm          .44401        1.1183        .10350E-02   -1.5575    
  16  Prefactor     47.301        39.418        .58303E-04   -1.4331    
  17  norm          .10000E-03    9.6631        .17925E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Normalizat    1.0268        .30339        .27106E-03   -.92139    
  19  Prefactor     .96948        .25348        .23779E-03   -.93754    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.13003e-10
Minuit parameter uncertainties:
  1  1.8168e-05
  2  57.3131
  3  3.83677e-05
  4  0.000216839
  5  0.000550049
  6  74.6321
  7  0.000196478
  8  3.88559e-07
  9  3.8687e-06
  10  2.5131e-06
  11  4.9896
  12  18.7127
  13  1.63706
  14  26.2121
  15  1.11838
  16  39.4399
  17  4.86608e-06
  18  0.3039
  19  0.253796
Done.

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

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.000e-04  2.513e-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.695e-01  2.538e-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.027e+00  3.039e-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: 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/64325/likelihoodResults_352857601_353116801_4FGL_J1040.5+0617_daily_bin438.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) = 3497.11879847
delta logL = -0.00120648560232

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 3497.11759192
delta logL = 6.19893398834e-08

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .10005E-03   1.0000         .10000E-03   10000.    
     2 'Index     '    2.3798       1.0000          .0000       10.000    
     3 'Normalizat'    1.0267       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .96950       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=   3497.118     FROM MIGRAD    STATUS=FAILED        90 CALLS      247 TOTAL
                     EDM=   .87E-07    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10064E-03    376.57        .22761E-03** at limit **
   2  Index         2.4232        8.5322        .50000       -.20979E-04
   3  Normalizat    1.0268        .69609E-01    .27106E-03   -.16336E-04
   4  Prefactor     .96948        .59841E-01    .23779E-03   -.11761E-04
                               ERR DEF=  .500    
 START SIMPLEX MINIMIZATION.    CONVERGENCE WHEN EDM .LT.   .20E-04
 SIMPLEX MINIMIZATION HAS CONVERGED.

 FCN=   3497.118     FROM SIMPLEX   STATUS=UNCHANGED    142 CALLS      389 TOTAL
                     EDM=   .11E-04    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10064E-03    376.57        .32027E-03** at limit **
   2  Index         2.4232        8.5322        .87891E-04   -.20979E-04
   3  Normalizat    1.0268        .69609E-01    .30423E-05   -.16336E-04
   4  Prefactor     .96948        .59841E-01    .14074E-05   -.11761E-04
                               ERR DEF=  .500    

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   3497.118     FROM MIGRAD    STATUS=CONVERGED     43 CALLS      432 TOTAL
                     EDM=   .87E-08    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    858.40        .45522E-04** at limit **
   2  Index         2.6131        8.4818        .50000        .20258E-06
   3  Normalizat    1.0268        .15556        .10842E-04    .37433E-04
   4  Prefactor     .96948        .13330        .95115E-05    .37651E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Index      = 2.61307
  Normalizat = 1.02676
  Prefactor  = 0.96948
 **********
 **   18 **HESSE 
 **********

 FCN=   3497.118     FROM HESSE     STATUS=OK            29 CALLS      461 TOTAL
                     EDM=   .32E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    4.5450        .91043E-05   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         2.6131        7.1219        .50000       -.49768    
   3  Normalizat    1.0268        .29382        .21684E-05   -.92139    
   4  Prefactor     .96948        .25280        .19023E-05   -.93754    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 3.16054e-11
Minuit parameter uncertainties:
  1  2.99028e-05
  2  68.4976
  3  0.294286
  4  0.253105
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/64325': 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) = 3497.1175912
delta logL = 7.90219928604e-07

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.000e-04  2.990e-05  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  2.613e+00  6.850e+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.695e-01  2.531e-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.027e+00  2.943e-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/64325/cmap_HighResolution_352857601_353116801_4FGL_J1040.5+0617_daily_bin438.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='9.61e-03', job_status='DONE', photon_flux_upper_limit='1.25e-07', time_completed='2021-09-02 08:28:39.568164', job_id='64325', GAL2='0.97', fit_tolerance='1e-08', EG2='1.03', EG='1.03', time_epoch_completed='1630596519.57', return_code2='0', ts='-0.00', comment='SUCCESS', return_code='0', GAL='0.97', dlogl='7.90e-07', ts2='-0.00', photon_index_error='0.00', photon_index='2.37' WHERE bin_id='438' AND source_name='4FGL J1040.5+0617' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Sep  2 08:28:39 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0153>
Subject: Job 64325: <4FGL_J1040.5+0617_daily_bin438> in cluster <slac> Done

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

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1040.5+0617_daily_bin438 160.15 6.2848 352857601 353116801 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 :                                   472.38 sec.
    Max Memory :                                 1256 MB
    Average Memory :                             215.14 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   655 sec.
    Turnaround time :                            737 sec.

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

