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


Performing analysis on: 4FGL_J1040.5+0617_daily_bin593
RA = 160.15, Dec = 6.2848
tmin = 393033601, tmax = 393292801
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='65490', job_status='RUN', time_executed='2021-09-02 08:24:29.691860', time_epoch_executed='1630596269.69' WHERE source_name='4FGL J1040.5+0617' and cadence='daily' and bin_id='593'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/65490

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

Retrieving the FT1 file...

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

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

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/65490/ft1_4FGL_J1040.5+0617_daily_bin593.fits


Retrieving the FT1 file...

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

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/65490/ft2_4FGL_J1040.5+0617_daily_bin593.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/65490/ft1_4FGL_J1040.5+0617_daily_bin593.fits outfile=/scratch/kocevski/65490/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin593.fits ra=160.15 dec=6.2848 rad=12.0 tmin=393033601.0 tmax=393292801.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.48
user 3.25
sys 0.21

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

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

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/65490/ft1_filtered_4FGL_J1040.5+0617_daily_bin593.fits" evtable="EVENTS" scfile=/scratch/kocevski/65490/ft2_4FGL_J1040.5+0617_daily_bin593.fits sctable="SC_DATA" outfile=/scratch/kocevski/65490/ltcube_393033601_393292801_4FGL_J1040.5+0617_daily_bin593.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/65490/ft2_4FGL_J1040.5+0617_daily_bin593.fits
.....................!
real 13.84
user 13.49
sys 0.31

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/65490/ft1_filtered_4FGL_J1040.5+0617_daily_bin593.fits evtable="EVENTS" scfile=/scratch/kocevski/65490/ft2_4FGL_J1040.5+0617_daily_bin593.fits sctable="SC_DATA" expcube=/scratch/kocevski/65490/ltcube_393033601_393292801_4FGL_J1040.5+0617_daily_bin593.fits outfile=/scratch/kocevski/65490/expmap_393033601_393292801_4FGL_J1040.5+0617_daily_bin593.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/65490/ltcube_393033601_393292801_4FGL_J1040.5+0617_daily_bin593.fits
.....................!
real 193.73
user 188.52
sys 4.72

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/65490/ft1_filtered_4FGL_J1040.5+0617_daily_bin593.fits scfile=/scratch/kocevski/65490/ft2_4FGL_J1040.5+0617_daily_bin593.fits outfile=/scratch/kocevski/65490/cmap_393033601_393292801_4FGL_J1040.5+0617_daily_bin593.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.39
sys 0.15

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

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

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

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .29279E-03   1.0000         .10000E-03   10000.    
     2 'Prefactor '    .10257E-03   1.0000         .10000E-03   10000.    
     3 'norm      '    8.7401       1.0000         .10000E-03   10000.    
     4 'Prefactor '    4.1752       1.0000         .10000E-03   10000.    
     5 'Prefactor '    1.5797       1.0000         .10000E-03   10000.    
     6 'Prefactor '    .20295E-03   1.0000         .10000E-03   10000.    
     7 'Prefactor '    .10311E-03   1.0000         .10000E-03   10000.    
     8 'norm      '    1.2606       1.0000         .10000E-03   10000.    
     9 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    10 'Prefactor '    7.8983       1.0000         .10000E-03   10000.    
    11 'Prefactor '    29.012       1.0000         .10000E-03   10000.    
    12 'Prefactor '    4.5421       1.0000         .10000E-03   10000.    
    13 'norm      '    .10077E-03   1.0000         .10000E-03   10000.    
    14 'Prefactor '    6.6609       1.0000         .10000E-03   10000.    
    15 'norm      '    .16296       1.0000         .10000E-03   10000.    
    16 'Prefactor '    2.7163       1.0000         .10000E-03   10000.    
    17 'norm      '    15.131       1.0000         .10000E-03   10000.    
    18 'Normalizat'    .71730       1.0000         .10000E-01   10.000    
    19 'Prefactor '    1.3176       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=   6185.805     FROM MIGRAD    STATUS=CONVERGED    441 CALLS     1720 TOTAL
                     EDM=   .13E-08  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .7%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    7.7967        .36218E-05** at limit **
   2  Prefactor     .10000E-03    9.5637       -.45846E-08** at limit **
   3  norm          8.7552        18.213       -.11064E-04    .41217E-04
   4  Prefactor     4.2100        11.230        .61283E-05   -.32020E-03
   5  Prefactor     1.1858        1164.1       -.46750E-04   -.24914E-04
   6  Prefactor     .10000E-03    118.84        .30809E-05** at limit **
   7  Prefactor     .10000E-03    12.488        .26753E-06** at limit **
   8  norm          1.2603        1.1191       -.79816E-07   -.13594E-03
   9  Prefactor     .10000E-03    1.5498        .31545E-07** at limit **
  10  Prefactor     7.8972        3.8529        .22193E-06    .66736E-04
  11  Prefactor     29.008        9.6040        .14015E-05   -.22137E-03
  12  Prefactor     4.5445        6.8667       -.23186E-05    .39467E-04
  13  norm          .10000E-03    .22326       -.47559E-06** at limit **
  14  Prefactor     6.6721        8.1909        .53176E-05   -.24230E-04
  15  norm          .16211        .97634       -.69240E-06   -.60668E-03
  16  Prefactor     2.7207        22.900       -.18336E-04    .14956E-03
  17  norm          15.112        10.501        .97014E-06   -.42464E-04
  18  Normalizat    .71773        .20523        .54155E-06    .19469E-03
  19  Prefactor     1.3175        .16801        .79229E-06    .21145E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  norm       = 8.75519
  Prefactor  = 4.21001
  Prefactor  = 1.1858
  Prefactor  = 0.000100001
  Prefactor  = 0.0001
  norm       = 1.2603
  Prefactor  = 0.0001
  Prefactor  = 7.89718
  Prefactor  = 29.0075
  Prefactor  = 4.54447
  norm       = 0.000100001
  Prefactor  = 6.6721
  norm       = 0.162106
  Prefactor  = 2.7207
  norm       = 15.1121
  Normalizat = 0.71773
  Prefactor  = 1.31754
 **********
 **   18 **HESSE 
 **********

 FCN=   6185.805     FROM HESSE     STATUS=OK           278 CALLS     1998 TOTAL
                     EDM=   .30E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    20.567        .40608E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Prefactor     .10000E-03    9.5653        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   3  norm          8.7552        17.597        .13558E-03   -1.5116    
   4  Prefactor     4.2100        10.725        .19724E-03   -1.5298    
   5  Prefactor     1.1858        1041.6        .33794E-03   -1.5490    
   6  Prefactor     .10000E-03    119.19        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   7  Prefactor     .10000E-03    12.511        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          1.2603        1.1199        .39727E-04   -1.5483    
   9  Prefactor     .10000E-03    1.5552        .95612E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     7.8972        3.8521        .10092E-03   -1.5146    
  11  Prefactor     29.008        9.5675        .74382E-04   -1.4630    
  12  Prefactor     4.5445        6.8564        .18889E-03   -1.5282    
  13  norm          .10000E-03    .30805        .69825E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor     6.6721        7.9516        .15548E-03   -1.5191    
  15  norm          .16211        2.0449        .14297E-02   -1.5627    
  16  Prefactor     2.7207        22.762        .24712E-03   -1.5378    
  17  norm          15.112        10.488        .10297E-03   -1.4930    
  18  Normalizat    .71773        .23601        .31347E-03   -1.0320    
  19  Prefactor     1.3175        .19714        .21547E-03   -.82787    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.95337e-09
Minuit parameter uncertainties:
  1  7.35678e-05
  2  2.06901e-06
  3  17.6069
  4  10.7298
  5  71.5702
  6  0.000773185
  7  5.92779e-05
  8  1.11991
  9  1.95888e-06
  10  3.85221
  11  9.568
  12  6.85755
  13  2.68831e-05
  14  7.95282
  15  1.15121
  16  15.7469
  17  10.4897
  18  0.236346
  19  0.197247
Done.

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

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  7.897e+00  3.852e+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.318e+00  1.972e-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:  7.177e-01  2.363e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 9.92
Ra Dec: 160.150 6.285
Photon Index (Fixed Index): 2.37 +/- 0.00
Photon Flux (Fixed Index): 9.54e-08 +/- 4.65e-08
Energy Flux (Fixed Index): 3.27e-05 +/- 1.59e-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) = 6185.67416864
delta logL = 0.13100610434

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 6185.6636409
delta logL = 0.141533848346

Fit tolerance = 1e-08

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

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

 FCN=   6185.664     FROM MIGRAD    STATUS=CONVERGED     54 CALLS      237 TOTAL
                     EDM=   .48E-08    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     6.5057        48.342        .39325E-02    .18341E-03
   2  Index         2.6104        3.0755        .12196        .12316E-03
   3  Normalizat    .69487        .95442E-01    .71855E-01    .25921E-04
   4  Prefactor     1.3308        .73490E-01    .48526E-01   -.19800E-05
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 6.5057
  Index      = 2.6104
  Normalizat = 0.69487
  Prefactor  = 1.33077
 **********
 **   18 **HESSE 
 **********

 FCN=   6185.664     FROM HESSE     STATUS=OK            33 CALLS      270 TOTAL
                     EDM=   .32E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     6.5057        4.4803        .85574E-04   -1.5198    
   2  Index         2.6104        .49540        .47439E-02   -.49828    
   3  Normalizat    .69487        .21888        .31803E-03   -1.0410    
   4  Prefactor     1.3308        .19462        .21451E-03   -.82397    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 3.15572e-09
Minuit parameter uncertainties:
  1  4.4805
  2  0.496456
  3  0.219151
  4  0.194726
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/65490': 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) = 6185.6636405
delta logL = 0.141534246726

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  6.506e+00  4.480e+00  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  2.610e+00  4.965e-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:  1.331e+00  1.947e-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:  6.949e-01  2.192e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 10.24
Ra Dec: 160.150 6.285
Photon Index (Free Index): 2.61 +/- 0.50
Photon Flux (Free Index): 1.13e-07 +/- 5.77e-08
Energy Flux (Free Index): 2.93e-05 +/- 1.46e-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/65490/cmap_HighResolution_393033601_393292801_4FGL_J1040.5+0617_daily_bin593.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='9.54e-08', energy_flux2='2.93e-05', photon_flux_error='4.65e-08', dlogl='1.42e-01', energy_flux='3.27e-05', photon_flux2='1.13e-07', job_status='DONE', time_completed='2021-09-02 08:33:19.637050', photon_index_error2='0.50', photon_index2='2.61', ts='9.92', fit_tolerance='1e-08', GAL='1.32', photon_index_error='0.00', energy_flux_error2='1.46e-05', EG='0.72', time_epoch_completed='1630596799.64', return_code='0', job_id='65490', GAL2='1.33', EG2='0.69', return_code2='0', energy_flux_error='1.59e-05', photon_flux_error2='5.77e-08', ts2='10.24', photon_index='2.37' WHERE bin_id='593' AND source_name='4FGL J1040.5+0617' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Sep  2 08:33:19 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0076>
Subject: Job 65490: <4FGL_J1040.5+0617_daily_bin593> in cluster <slac> Done

Job <4FGL_J1040.5+0617_daily_bin593> was submitted from host <rhel6-64k> by user <kocevski> in cluster <slac> at Thu Sep  2 08:21:05 2021
Job was executed on host(s) <bullet0076>, in queue <medium>, as user <kocevski> in cluster <slac> at Thu Sep  2 08:22:32 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:22:32 2021
Terminated at Thu Sep  2 08:33:20 2021
Results reported at Thu Sep  2 08:33:20 2021

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1040.5+0617_daily_bin593 160.15 6.2848 393033601 393292801 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 :                                   528.16 sec.
    Max Memory :                                 1256 MB
    Average Memory :                             283.81 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   648 sec.
    Turnaround time :                            735 sec.

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

