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


Performing analysis on: 4FGL_J1040.5+0617_daily_bin507
RA = 160.15, Dec = 6.2848
tmin = 370742401, tmax = 371001601
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='64421', job_status='RUN', time_executed='2021-09-02 08:22:47.574236', time_epoch_executed='1630596167.57' WHERE source_name='4FGL J1040.5+0617' and cadence='daily' and bin_id='507'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/64421

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

Retrieving the FT1 file...

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

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

Retrieving 50 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/64421/ft1_4FGL_J1040.5+0617_daily_bin507.fits


Retrieving the FT1 file...

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

Retrieving 50 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/64421/ft2_4FGL_J1040.5+0617_daily_bin507.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/64421/ft1_4FGL_J1040.5+0617_daily_bin507.fits outfile=/scratch/kocevski/64421/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin507.fits ra=160.15 dec=6.2848 rad=12.0 tmin=370742401.0 tmax=371001601.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.40
user 5.12
sys 0.24

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

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/64421/ft2_4FGL_J1040.5+0617_daily_bin507.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/64421/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin507.fits evtable="EVENTS" outfile="/scratch/kocevski/64421/ft1_filtered_4FGL_J1040.5+0617_daily_bin507.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.51
user 0.32
sys 0.17

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/64421/ft1_filtered_4FGL_J1040.5+0617_daily_bin507.fits" evtable="EVENTS" scfile=/scratch/kocevski/64421/ft2_4FGL_J1040.5+0617_daily_bin507.fits sctable="SC_DATA" outfile=/scratch/kocevski/64421/ltcube_370742401_371001601_4FGL_J1040.5+0617_daily_bin507.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/64421/ft2_4FGL_J1040.5+0617_daily_bin507.fits
.....................!
real 13.48
user 12.99
sys 0.36

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/64421/ft1_filtered_4FGL_J1040.5+0617_daily_bin507.fits evtable="EVENTS" scfile=/scratch/kocevski/64421/ft2_4FGL_J1040.5+0617_daily_bin507.fits sctable="SC_DATA" expcube=/scratch/kocevski/64421/ltcube_370742401_371001601_4FGL_J1040.5+0617_daily_bin507.fits outfile=/scratch/kocevski/64421/expmap_370742401_371001601_4FGL_J1040.5+0617_daily_bin507.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/64421/ltcube_370742401_371001601_4FGL_J1040.5+0617_daily_bin507.fits
.....................!
real 192.51
user 186.71
sys 5.34

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/64421/ft1_filtered_4FGL_J1040.5+0617_daily_bin507.fits scfile=/scratch/kocevski/64421/ft2_4FGL_J1040.5+0617_daily_bin507.fits outfile=/scratch/kocevski/64421/cmap_370742401_371001601_4FGL_J1040.5+0617_daily_bin507.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.15

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/64421/ft1_filtered_4FGL_J1040.5+0617_daily_bin507.fits scfile=/scratch/kocevski/64421/ft2_4FGL_J1040.5+0617_daily_bin507.fits outfile=/scratch/kocevski/64421/cmap_HighResolution_370742401_371001601_4FGL_J1040.5+0617_daily_bin507.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.38
sys 0.17

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

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

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .10124E-03   1.0000         .10000E-03   10000.    
     2 'Prefactor '    56.059       1.0000         .10000E-03   10000.    
     3 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
     4 'Prefactor '    10.274       1.0000         .10000E-03   10000.    
     5 'Prefactor '    20.445       1.0000         .10000E-03   10000.    
     6 'Prefactor '    .10287E-03   1.0000         .10000E-03   10000.    
     7 'Prefactor '    .10043E-03   1.0000         .10000E-03   10000.    
     8 'norm      '    .10106E-03   1.0000         .10000E-03   10000.    
     9 'Prefactor '    .10158E-03   1.0000         .10000E-03   10000.    
    10 'Prefactor '    5.2046       1.0000         .10000E-03   10000.    
    11 'Prefactor '    .10045E-03   1.0000         .10000E-03   10000.    
    12 'Prefactor '    3.2661       1.0000         .10000E-03   10000.    
    13 'norm      '    .39059       1.0000         .10000E-03   10000.    
    14 'Prefactor '    .39732E-03   1.0000         .10000E-03   10000.    
    15 'norm      '    4.4156       1.0000         .10000E-03   10000.    
    16 'Prefactor '    31.608       1.0000         .10000E-03   10000.    
    17 'norm      '    .10405E-03   1.0000         .10000E-03   10000.    
    18 'Normalizat'    1.3301       1.0000         .10000E-01   10.000    
    19 'Prefactor '    .97564       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=   6378.598     FROM MIGRAD    STATUS=CONVERGED    407 CALLS     2180 TOTAL
                     EDM=   .18E-08  STRATEGY=1  ERROR MATRIX UNCERTAINTY= 12.6%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    6.0656        .77915E-06** at limit **
   2  Prefactor     56.054        55.049       -.12579E-05    .65468E-04
   3  norm          .10001E-03    12.225        .13225E-05** at limit **
   4  Prefactor     10.283        12.424        .91370E-06    .42955E-04
   5  Prefactor     20.414        58.251       -.11485E-04    .14236E-04
   6  Prefactor     .10000E-03    34.704        .20742E-05** at limit **
   7  Prefactor     .10000E-03    9.2334        .12286E-05** at limit **
   8  norm          .10000E-03    .71332       -.22685E-06** at limit **
   9  Prefactor     .10000E-03    7.5812       -.56665E-06** at limit **
  10  Prefactor     5.2046        3.5842        .55317E-06    .38513E-03
  11  Prefactor     .10000E-03    3.8142       -.15522E-06** at limit **
  12  Prefactor     3.2628        9.8699       -.82602E-05    .26281E-03
  13  norm          .39075        .42842       -.76535E-06   -.11173E-02
  14  Prefactor     .10001E-03    131.21       -.52006E-04** at limit **
  15  norm          4.4165        2.1259        .16041E-08    .37148E-03
  16  Prefactor     31.609        26.826        .11114E-05    .17239E-03
  17  norm          .10000E-03    10.639       -.25781E-06** at limit **
  18  Normalizat    1.3298        .21316       -.20922E-05    .10057E-03
  19  Prefactor     .97589        .16651        .34545E-05    .76044E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.000100001
  Prefactor  = 56.0541
  norm       = 0.000100008
  Prefactor  = 10.2829
  Prefactor  = 20.4141
  Prefactor  = 0.000100001
  Prefactor  = 0.0001
  norm       = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 5.20461
  Prefactor  = 0.0001
  Prefactor  = 3.26277
  norm       = 0.390753
  Prefactor  = 0.000100015
  norm       = 4.41653
  Prefactor  = 31.6095
  norm       = 0.0001
  Normalizat = 1.32976
  Prefactor  = 0.975888
 **********
 **   18 **HESSE 
 **********

 FCN=   6378.598     FROM HESSE     STATUS=OK           276 CALLS     2456 TOTAL
                     EDM=   .34E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    6.0931        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Prefactor     56.054        54.958        .53577E-04   -1.4209    
   3  norm          .10001E-03    12.284        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     10.283        12.376        .12501E-03   -1.5067    
   5  Prefactor     20.414        58.328        .88582E-04   -1.4804    
   6  Prefactor     .10000E-03    34.769        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   7  Prefactor     .10000E-03    9.2461        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          .10000E-03    1.1476        .13012E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  Prefactor     .10000E-03    7.7840        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     5.2046        3.5897        .11683E-03   -1.5252    
  11  Prefactor     .10000E-03    3.8338        .15229E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor     3.2628        10.374        .11204E-02   -1.5347    
  13  norm          .39075        .46939        .55242E-03   -1.5583    
  14  Prefactor     .10001E-03    16.415        .60204E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  norm          4.4165        2.1392        .75250E-04   -1.5288    
  16  Prefactor     31.609        26.858        .71270E-04   -1.4583    
  17  norm          .10000E-03    10.688        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Normalizat    1.3298        .25352        .26640E-03   -.82682    
  19  Prefactor     .97589        .19640        .25436E-03   -.93538    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 3.44672e-09
Minuit parameter uncertainties:
  1  0.000141529
  2  55.0082
  3  0.000613714
  4  12.3793
  5  58.4912
  6  0.000423336
  7  4.52794e-05
  8  2.41299e-05
  9  4.60341e-05
  10  3.58982
  11  3.65258e-05
  12  10.3795
  13  0.469392
  14  0.000976057
  15  2.13927
  16  26.8684
  17  7.7867e-05
  18  0.25376
  19  0.196546
Done.

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

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  5.205e+00  3.590e+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:  9.759e-01  1.965e-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.330e+00  2.538e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 4.26
Ra Dec: 160.150 6.285
Photon Index (Fixed Index): 2.37 +/- 0.00
Photon Flux (Fixed Index): 6.29e-08 +/- 4.33e-08
Energy Flux (Fixed Index): 2.15e-05 +/- 1.48e-05

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) = 6378.54906275
delta logL = 0.0484826572911

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 6378.5443398
delta logL = 0.0532056051252

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    5.7076       1.0000         .10000E-03   10000.    
     2 'Index     '    2.1779       1.0000          .0000       10.000    
     3 'Normalizat'    1.3430       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .96832       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=   6378.544     FROM MIGRAD    STATUS=CONVERGED     87 CALLS      274 TOTAL
                     EDM=   .16E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     5.7075        4.0155        .12392E-03    .55322E-03
   2  Index         2.1780        .56371        .85075E-02    .83062E-04
   3  Normalizat    1.3429        .23525        .26529E-03   -.38311E-04
   4  Prefactor     .96833        .19488        .25520E-03   -.52434E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 5.70749
  Index      = 2.17802
  Normalizat = 1.34295
  Prefactor  = 0.968325
 **********
 **   18 **HESSE 
 **********

 FCN=   6378.544     FROM HESSE     STATUS=OK            23 CALLS      297 TOTAL
                     EDM=   .16E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     5.7075        3.9752        .49567E-05   -1.5230    
   2  Index         2.1780        .55763        .34030E-03   -.59970    
   3  Normalizat    1.3429        .23530        .10612E-04   -.82293    
   4  Prefactor     .96833        .19496        .10208E-04   -.93793    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.59819e-10
Minuit parameter uncertainties:
  1  3.97536
  2  0.559339
  3  0.235491
  4  0.195103
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/64421': 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) = 6378.54433977
delta logL = 0.0532056333086

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  5.707e+00  3.975e+00  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  2.178e+00  5.593e-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.683e-01  1.951e-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.343e+00  2.355e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 4.36
Ra Dec: 160.150 6.285
Photon Index (Free Index): 2.18 +/- 0.56
Photon Flux (Free Index): 5.31e-08 +/- 4.66e-08
Energy Flux (Free Index): 2.49e-05 +/- 2.11e-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/64421/cmap_HighResolution_370742401_371001601_4FGL_J1040.5+0617_daily_bin507.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='6.29e-08', energy_flux2='2.49e-05', photon_flux_error='4.33e-08', dlogl='5.32e-02', energy_flux='2.15e-05', photon_flux2='5.31e-08', job_status='DONE', time_completed='2021-09-02 08:32:22.338905', photon_index_error2='0.56', photon_index2='2.18', ts='4.26', fit_tolerance='1e-08', GAL='0.98', photon_index_error='0.00', energy_flux_error2='2.11e-05', EG='1.33', time_epoch_completed='1630596742.34', return_code='0', job_id='64421', GAL2='0.97', EG2='1.34', return_code2='0', energy_flux_error='1.48e-05', photon_flux_error2='4.66e-08', ts2='4.36', photon_index='2.37' WHERE bin_id='507' AND source_name='4FGL J1040.5+0617' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Sep  2 08:32:22 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0025>
Subject: Job 64421: <4FGL_J1040.5+0617_daily_bin507> in cluster <slac> Done

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

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1040.5+0617_daily_bin507 160.15 6.2848 370742401 371001601 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 :                                   572.40 sec.
    Max Memory :                                 1256 MB
    Average Memory :                             247.21 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   813 sec.
    Turnaround time :                            951 sec.

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

