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


Performing analysis on: 4FGL_J1040.5+0617_daily_bin361
RA = 160.15, Dec = 6.2848
tmin = 332899201, tmax = 333158401
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='64215', job_status='RUN', time_executed='2021-09-02 08:19:58.347633', time_epoch_executed='1630595998.35' WHERE source_name='4FGL J1040.5+0617' and cadence='daily' and bin_id='361'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/64215

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

Retrieving the FT1 file...

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

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

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/64215/ft1_4FGL_J1040.5+0617_daily_bin361.fits


Retrieving the FT1 file...

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

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/64215/ft2_4FGL_J1040.5+0617_daily_bin361.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/64215/ft1_4FGL_J1040.5+0617_daily_bin361.fits outfile=/scratch/kocevski/64215/ft1_filteredMKT_4FGL_J1040.5+0617_daily_bin361.fits ra=160.15 dec=6.2848 rad=12.0 tmin=332899201.0 tmax=333158401.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 4.20
user 3.96
sys 0.20

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

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

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/64215/ft1_filtered_4FGL_J1040.5+0617_daily_bin361.fits" evtable="EVENTS" scfile=/scratch/kocevski/64215/ft2_4FGL_J1040.5+0617_daily_bin361.fits sctable="SC_DATA" outfile=/scratch/kocevski/64215/ltcube_332899201_333158401_4FGL_J1040.5+0617_daily_bin361.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/64215/ft2_4FGL_J1040.5+0617_daily_bin361.fits
.....................!
real 15.07
user 14.64
sys 0.34

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/64215/ft1_filtered_4FGL_J1040.5+0617_daily_bin361.fits evtable="EVENTS" scfile=/scratch/kocevski/64215/ft2_4FGL_J1040.5+0617_daily_bin361.fits sctable="SC_DATA" expcube=/scratch/kocevski/64215/ltcube_332899201_333158401_4FGL_J1040.5+0617_daily_bin361.fits outfile=/scratch/kocevski/64215/expmap_332899201_333158401_4FGL_J1040.5+0617_daily_bin361.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/64215/ltcube_332899201_333158401_4FGL_J1040.5+0617_daily_bin361.fits
.....................!
real 191.08
user 185.59
sys 4.02

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/64215/ft1_filtered_4FGL_J1040.5+0617_daily_bin361.fits scfile=/scratch/kocevski/64215/ft2_4FGL_J1040.5+0617_daily_bin361.fits outfile=/scratch/kocevski/64215/cmap_332899201_333158401_4FGL_J1040.5+0617_daily_bin361.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.36
sys 0.17

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/64215/ft1_filtered_4FGL_J1040.5+0617_daily_bin361.fits scfile=/scratch/kocevski/64215/ft2_4FGL_J1040.5+0617_daily_bin361.fits outfile=/scratch/kocevski/64215/cmap_HighResolution_332899201_333158401_4FGL_J1040.5+0617_daily_bin361.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.15

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

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

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    14.521       1.0000         .10000E-03   10000.    
     2 'Prefactor '    69.281       1.0000         .10000E-03   10000.    
     3 'norm      '    .10032E-03   1.0000         .10000E-03   10000.    
     4 'Prefactor '    .10206E-03   1.0000         .10000E-03   10000.    
     5 'Prefactor '    .12648E-03   1.0000         .10000E-03   10000.    
     6 'Prefactor '    .22618E-02   1.0000         .10000E-03   10000.    
     7 'Prefactor '    9.1798       1.0000         .10000E-03   10000.    
     8 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
     9 'Prefactor '    .10015E-03   1.0000         .10000E-03   10000.    
    10 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    11 'Prefactor '    .14925E-01   1.0000         .10000E-03   10000.    
    12 'Prefactor '    12.342       1.0000         .10000E-03   10000.    
    13 'norm      '    4.0629       1.0000         .10000E-03   10000.    
    14 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    15 'norm      '    .10039E-03   1.0000         .10000E-03   10000.    
    16 'Prefactor '    .10003E-03   1.0000         .10000E-03   10000.    
    17 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
    18 'Normalizat'    1.2685       1.0000         .10000E-01   10.000    
    19 'Prefactor '    1.0789       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=   5596.915     FROM MIGRAD    STATUS=CONVERGED    412 CALLS     1935 TOTAL
                     EDM=   .36E-09  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .9%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     14.520        13.242       -.99641E-08    .12679E-04
   2  Prefactor     69.286        56.713        .42543E-07    .15512E-04
   3  norm          .10000E-03    12.532        .99294E-07** at limit **
   4  Prefactor     .10000E-03    9.2035        .27382E-06** at limit **
   5  Prefactor     .10001E-03    108.65        .20502E-05** at limit **
   6  Prefactor     .10000E-03    299.22       -.26093E-05** at limit **
   7  Prefactor     9.1749        16.465       -.64171E-05   -.55024E-04
   8  norm          .10000E-03    .40511        .14374E-07** at limit **
   9  Prefactor     .10000E-03    5.0454        .15781E-06** at limit **
  10  Prefactor     .10000E-03    1.3959       -.23184E-08** at limit **
  11  Prefactor     .10052E-03    5.8148       -.10642E-05** at limit **
  12  Prefactor     12.342        8.2189        .50636E-08   -.14062E-04
  13  norm          4.0630        .94441       -.47746E-09    .11191E-04
  14  Prefactor     .10000E-03    3.3760       -.29692E-08** at limit **
  15  norm          .10000E-03    .52765        .14714E-07** at limit **
  16  Prefactor     .10000E-03    5.8383        .26052E-08** at limit **
  17  norm          .10000E-03    3.6362        .42030E-08** at limit **
  18  Normalizat    1.2684        .21179        .18999E-07    .87031E-04
  19  Prefactor     1.0789        .18198       -.14669E-09    .61808E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 14.5204
  Prefactor  = 69.2862
  norm       = 0.0001
  Prefactor  = 0.000100001
  Prefactor  = 0.00010001
  Prefactor  = 0.000100005
  Prefactor  = 9.1749
  norm       = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.000100517
  Prefactor  = 12.3419
  norm       = 4.06305
  Prefactor  = 0.0001
  norm       = 0.0001
  Prefactor  = 0.0001
  norm       = 0.0001
  Normalizat = 1.26839
  Prefactor  = 1.07893
 **********
 **   18 **HESSE 
 **********

 FCN=   5596.915     FROM HESSE     STATUS=OK           274 CALLS     2209 TOTAL
                     EDM=   .78E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     14.520        13.249        .10511E-03   -1.4946    
   2  Prefactor     69.286        56.595        .48225E-04   -1.4041    
   3  norm          .10000E-03    12.599        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     .10000E-03    9.4109        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  Prefactor     .10001E-03    110.62        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  Prefactor     .10000E-03    300.88        .40230E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   7  Prefactor     9.1749        16.479        .13228E-03   -1.5102    
   8  norm          .10000E-03    .40870        .46489E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  Prefactor     .10000E-03    16.376        .32383E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     .10000E-03    1.4162        .86266E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  Prefactor     .10052E-03    6.5700        .51539E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor     12.342        8.2189        .11403E-03   -1.5005    
  13  norm          4.0630        .94469        .33471E-04   -1.5305    
  14  Prefactor     .10000E-03    3.3791        .13420E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  norm          .10000E-03    .72180        .10504E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  16  Prefactor     .10000E-03    5.8418        .17655E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  17  norm          .10000E-03    3.6392        .13933E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Normalizat    1.2684        .25144        .26645E-03   -.84515    
  19  Prefactor     1.0789        .21653        .25238E-03   -.90143    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 7.76594e-10
Minuit parameter uncertainties:
  1  13.2515
  2  56.6387
  3  2.71909e-05
  4  0.000233001
  5  0.00211343
  6  0.00238571
  7  16.4872
  8  7.31699e-07
  9  8.94853e-05
  10  1.4726e-06
  11  0.00368607
  12  8.21964
  13  0.944698
  14  4.19301e-07
  15  2.35782e-06
  16  1.36872e-06
  17  9.8855e-07
  18  0.251684
  19  0.216709
Done.

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

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.000e-04  1.473e-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:  1.079e+00  2.167e-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.268e+00  2.517e-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: 6.84e-08 ph cm-2 s-1
Energy Flux Upper Limit: 5.27e-03 MeV cm-2 s-1

Saving results to:
/scratch/kocevski/64215/likelihoodResults_332899201_333158401_4FGL_J1040.5+0617_daily_bin361.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) = 5596.91809338
delta logL = -0.00331165095758

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 5596.91478165
delta logL = 7.80437403591e-08

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .10021E-03   1.0000         .10000E-03   10000.    
     2 'Index     '    2.3553       1.0000          .0000       10.000    
     3 'Normalizat'    1.2684       1.0000         .10000E-01   10.000    
     4 'Prefactor '    1.0790       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=   5596.915     FROM MIGRAD    STATUS=FAILED        90 CALLS      245 TOTAL
                     EDM=   .94E-07    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10134E-03    60.896        .86852E-03** at limit **
   2  Index         2.2745        5.7638        .50000        .55304E-04
   3  Normalizat    1.2684        .36306E-01    .26645E-03   -.16939E-04
   4  Prefactor     1.0789        .32186E-01    .25238E-03   -.16171E-04
                               ERR DEF=  .500    
 START SIMPLEX MINIMIZATION.    CONVERGENCE WHEN EDM .LT.   .20E-04
 SIMPLEX MINIMIZATION HAS CONVERGED.

 FCN=   5596.915     FROM SIMPLEX   STATUS=UNCHANGED    139 CALLS      384 TOTAL
                     EDM=   .14E-04    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10134E-03    60.896        .21859E-03** at limit **
   2  Index         2.2745        5.7638        .42881E-03    .55304E-04
   3  Normalizat    1.2684        .36306E-01    .69961E-05   -.16939E-04
   4  Prefactor     1.0789        .32186E-01    .63082E-05   -.16171E-04
                               ERR DEF=  .500    

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   5596.915     FROM MIGRAD    STATUS=CONVERGED     41 CALLS      425 TOTAL
                     EDM=   .64E-09    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    310.05        .17370E-03** at limit **
   2  Index         2.0582        7.1987        .50000        .53819E-07
   3  Normalizat    1.2684        .12389        .10658E-04    .14550E-03
   4  Prefactor     1.0789        .10970        .10095E-04    .16104E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Index      = 2.05821
  Normalizat = 1.26839
  Prefactor  = 1.07893
 **********
 **   18 **HESSE 
 **********

 FCN=   5596.915     FROM HESSE     STATUS=OK            29 CALLS      454 TOTAL
                     EDM=   .34E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    1.6866        .34741E-04   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         2.0582        6.5579        .50000       -.62903    
   3  Normalizat    1.2684        .24275        .21316E-05   -.84515    
   4  Prefactor     1.0789        .21517        .20190E-05   -.90143    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 3.40081e-11
Minuit parameter uncertainties:
  1  2.63089e-06
  2  73.5249
  3  0.24297
  4  0.21534
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/64215': 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) = 5596.91477884
delta logL = 2.88515548164e-06

Extracting fit parameters...

4FGL J1040.5+0617
   Spectrum: PowerLaw
216    Prefactor:  1.000e-04  2.631e-06  1.000e-04  1.000e+04 ( 1.000e-12)
217        Index:  2.058e+00  7.352e+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.079e+00  2.153e-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.268e+00  2.430e-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/64215/cmap_HighResolution_332899201_333158401_4FGL_J1040.5+0617_daily_bin361.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='5.27e-03', job_status='DONE', photon_flux_upper_limit='6.84e-08', time_completed='2021-09-02 08:29:41.141851', job_id='64215', GAL2='1.08', fit_tolerance='1e-08', EG2='1.27', EG='1.27', time_epoch_completed='1630596581.14', return_code2='0', ts='-0.00', comment='SUCCESS', return_code='0', GAL='1.08', dlogl='2.89e-06', ts2='-0.00', photon_index_error='0.00', photon_index='2.37' WHERE bin_id='361' AND source_name='4FGL J1040.5+0617' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Sep  2 08:29:41 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0169>
Subject: Job 64215: <4FGL_J1040.5+0617_daily_bin361> in cluster <slac> Done

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

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1040.5+0617_daily_bin361 160.15 6.2848 332899201 333158401 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 :                                   580.00 sec.
    Max Memory :                                 1256 MB
    Average Memory :                             215.89 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   803 sec.
    Turnaround time :                            807 sec.

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

