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


Performing analysis on: 4FGL_J2040.5-1705_daily_bin1392
RA = 310.136, Dec = -17.0901
tmin = 600134401, tmax = 600393601
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='113285', job_status='RUN', time_executed='2021-09-25 16:01:29.073741', time_epoch_executed='1632610889.07' WHERE source_name='4FGL J2040.5-1705' and cadence='daily' and bin_id='1392'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/113285

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

Retrieving the FT1 file...

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

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

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/113285/ft1_4FGL_J2040.5-1705_daily_bin1392.fits


Retrieving the FT1 file...

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

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/113285/ft1_4FGL_J2040.5-1705_daily_bin1392.fits outfile=/scratch/kocevski/113285/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin1392.fits ra=310.136 dec=-17.0901 rad=12.0 tmin=600134401.0 tmax=600393601.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.88
user 4.58
sys 0.27

Adding sun position to ft2 file:
/nfs/farm/g/glast/g/LCRepository/Repository/bin/sunpos /scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.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/113285/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin1392.fits evtable="EVENTS" outfile="/scratch/kocevski/113285/ft1_filtered_4FGL_J2040.5-1705_daily_bin1392.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.62
user 0.33
sys 0.16

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/113285/ft1_filtered_4FGL_J2040.5-1705_daily_bin1392.fits" evtable="EVENTS" scfile=/scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits sctable="SC_DATA" outfile=/scratch/kocevski/113285/ltcube_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.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/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits
.....................!
real 14.37
user 13.88
sys 0.36

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/113285/ft1_filtered_4FGL_J2040.5-1705_daily_bin1392.fits evtable="EVENTS" scfile=/scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits sctable="SC_DATA" expcube=/scratch/kocevski/113285/ltcube_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.fits outfile=/scratch/kocevski/113285/expmap_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.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/113285/ltcube_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.fits
.....................!
real 192.14
user 185.89
sys 5.62

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 181 point sources and 0 extended sources

Setting source of interest to:
4FGL J2040.5-1705 @ 310.136 -17.0901

Creating the counts map:
time -p gtbin evfile=/scratch/kocevski/113285/ft1_filtered_4FGL_J2040.5-1705_daily_bin1392.fits scfile=/scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits outfile=/scratch/kocevski/113285/cmap_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.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=310.136 yref=-17.0901 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.37
sys 0.17

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/113285/ft1_filtered_4FGL_J2040.5-1705_daily_bin1392.fits scfile=/scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits outfile=/scratch/kocevski/113285/cmap_HighResolution_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.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=310.136 yref=-17.0901 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.40
sys 0.16

Computing the diffuse response:
time -p gtdiffrsp evfile=/scratch/kocevski/113285/ft1_filtered_4FGL_J2040.5-1705_daily_bin1392.fits evtable="EVENTS" scfile=/scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits sctable="SC_DATA" srcmdl=/scratch/kocevski/113285/Model_4FGL_J2040.5-1705_daily_bin1392.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/113285/ft1_filtered_4FGL_J2040.5-1705_daily_bin1392.fits.....................!
real 70.08
user 68.65
sys 1.21

Creating the likelihood object...
obs = UnbinnedObs('/scratch/kocevski/113285/ft1_filtered_4FGL_J2040.5-1705_daily_bin1392.fits', '/scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits', expMap='/scratch/kocevski/113285/expmap_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.fits', expCube='/scratch/kocevski/113285/ltcube_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/scratch/kocevski/113285/Model_4FGL_J2040.5-1705_daily_bin1392.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J2040.5-1705'

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  1.223e+00  0.000e+00  1.000e-04  1.000e+04 ( 1.000e-12)
324        Index:  2.541e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
325        Scale:  7.724e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /scratch/kocevski/113285/ft1_filtered_4FGL_J2040.5-1705_daily_bin1392.fits
Spacecraft file(s): /scratch/kocevski/113285/ft2_4FGL_J2040.5-1705_daily_bin1392.fits
Exposure map: /scratch/kocevski/113285/expmap_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.fits
Exposure cube: /scratch/kocevski/113285/ltcube_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.fits
IRFs: P8R3_SOURCE_V2
Source model file: /scratch/kocevski/113285/Model_4FGL_J2040.5-1705_daily_bin1392.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) = 7201.11684067

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    34.795       1.0000         .10000E-03   10000.    
     2 'Prefactor '    49.286       1.0000         .10000E-03   10000.    
     3 'Prefactor '    5.1385       1.0000         .10000E-03   10000.    
     4 'Prefactor '    .10007E-03   1.0000         .10000E-03   10000.    
     5 'norm      '    20.425       1.0000         .10000E-03   10000.    
     6 'norm      '    18.044       1.0000         .10000E-03   10000.    
     7 'Prefactor '    63.540       1.0000         .10000E-03   10000.    
     8 'norm      '    9.0649       1.0000         .10000E-03   10000.    
     9 'norm      '    .10001E-03   1.0000         .10000E-03   10000.    
    10 'norm      '    21.866       1.0000         .10000E-03   10000.    
    11 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
    12 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
    13 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
    14 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    15 'Prefactor '    163.94       1.0000         .10000E-03   10000.    
    16 'norm      '    .10129E-03   1.0000         .10000E-03   10000.    
    17 'Prefactor '    23.120       1.0000         .10000E-03   10000.    
    18 'Prefactor '    .11213E-02   1.0000         .10000E-03   10000.    
    19 'Prefactor '    47.557       1.0000         .10000E-03   10000.    
    20 'Prefactor '    2.8257       1.0000         .10000E-03   10000.    
    21 'Normalizat'    1.4879       1.0000         .10000E-01   10.000    
    22 'Prefactor '    .90883       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5990E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   7201.041     FROM MIGRAD    STATUS=CONVERGED    467 CALLS     2438 TOTAL
                     EDM=   .15E-08  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .4%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     34.747        42.962       -.42154E-04    .19347E-04
   2  Prefactor     49.268        53.012       -.13928E-04    .25855E-04
   3  Prefactor     5.1378        2.7720        .12097E-05    .26577E-03
   4  Prefactor     .10000E-03    29.696       -.39341E-05** at limit **
   5  norm          20.422        17.694        .53032E-06    .26157E-04
   6  norm          18.043        11.771        .14279E-05    .63339E-04
   7  Prefactor     63.491        169.03       -.59326E-04    .78413E-05
   8  norm          9.0631        12.964        .95938E-08    .69871E-06
   9  norm          .10000E-03    12.109        .18205E-06** at limit **
  10  norm          21.867        3.3167       -.95695E-08    .10050E-03
  11  Prefactor     .10000E-03    17.822       -.53759E-06** at limit **
  12  Prefactor     .10000E-03    2.9153        .79782E-08** at limit **
  13  norm          .10000E-03    1.3798        .83297E-07** at limit **
  14  Prefactor     .10000E-03    2.6766        .14120E-06** at limit **
  15  Prefactor     163.97        125.46        .19382E-04   -.59503E-05
  16  norm          .10000E-03    24.403        .18306E-05** at limit **
  17  Prefactor     23.126        24.524        .34117E-06   -.14601E-04
  18  Prefactor     .10356E-03    5.8397        .69370E-07** at limit **
  19  Prefactor     47.565        45.382       -.11047E-04   -.14713E-03
  20  Prefactor     2.8653        102.22        .22367E-04    .20148E-04
  21  Normalizat    1.4868        .31862       -.45683E-05    .17935E-03
  22  Prefactor     .90925        .12587        .48816E-05   -.49906E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 34.7468
  Prefactor  = 49.2683
  Prefactor  = 5.13777
  Prefactor  = 0.0001
  norm       = 20.4217
  norm       = 18.0427
  Prefactor  = 63.4911
  norm       = 9.06314
  norm       = 0.0001
  norm       = 21.8668
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  norm       = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 163.97
  norm       = 0.000100001
  Prefactor  = 23.1256
  Prefactor  = 0.000103561
  Prefactor  = 47.5649
  Prefactor  = 2.86531
  Normalizat = 1.48679
  Prefactor  = 0.909254
 **********
 **   18 **HESSE 
 **********

 FCN=   7201.041     FROM HESSE     STATUS=OK           344 CALLS     2782 TOTAL
                     EDM=   .29E-07    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     34.747        42.900        .67937E-04   -1.4528    
   2  Prefactor     49.268        53.007        .57121E-04   -1.4303    
   3  Prefactor     5.1378        2.7684        .97593E-04   -1.5255    
   4  Prefactor     .10000E-03    30.042        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  norm          20.422        17.705        .88625E-04   -1.4804    
   6  norm          18.043        11.766        .94289E-04   -1.4858    
   7  Prefactor     63.491        169.04        .50342E-04   -1.4113    
   8  norm          9.0631        12.965        .13312E-03   -1.5106    
   9  norm          .10000E-03    12.114        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  norm          21.867        3.3137        .57712E-04   -1.4772    
  11  Prefactor     .10000E-03    17.886        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor     .10000E-03    2.9201        .14150E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  13  norm          .10000E-03    1.3848        .97338E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor     .10000E-03    2.7047        .13551E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Prefactor     163.97        125.63        .15750E-03   -1.3140    
  16  norm          .10000E-03    24.490        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  17  Prefactor     23.126        24.555        .83306E-04   -1.4746    
  18  Prefactor     .10356E-03    123.70        .38852E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  19  Prefactor     47.565        43.626        .58145E-04   -1.4328    
  20  Prefactor     2.8653        93.726        .24194E-03   -1.5369    
  21  Normalizat    1.4868        .37491        .40601E-03   -.78150    
  22  Prefactor     .90925        .15025        .20366E-03   -.95818    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.87656e-08
Minuit parameter uncertainties:
  1  42.938
  2  53.0577
  3  2.7685
  4  1.81901e-05
  5  17.7096
  6  11.7673
  7  170.348
  8  12.9692
  9  2.10386e-05
  10  3.31376
  11  8.48957e-06
  12  1.314e-05
  13  1.55217e-06
  14  5.87606e-06
  15  125.832
  16  0.000250455
  17  24.5657
  18  0.0420614
  19  43.6553
  20  32.8307
  21  0.375612
  22  0.150314
Done.

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

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  1.000e-04  5.876e-06  1.000e-04  1.000e+04 ( 1.000e-12)
324        Index:  2.541e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
325        Scale:  7.724e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
596    Prefactor:  9.093e-01  1.503e-01  0.000e+00  1.000e+01 ( 1.000e+00)
597        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
598        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
595   Normalization:  1.487e+00  3.756e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): -0.00
Ra Dec: 310.136 -17.090
Photon Flux Upper Limit: 1.16e-07 ph cm-2 s-1
Energy Flux Upper Limit: 9.06e-03 MeV cm-2 s-1

Saving results to:
/scratch/kocevski/113285/likelihoodResults_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.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): 0
logL (Free Index) = 7201.04243876
delta logL = -0.00175963944275

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 7200.79270746
delta logL = 0.247971660382

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
     2 'Index     '    8.7415       1.0000          .0000       10.000    
     3 'Normalizat'    1.4024       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .93201       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5990E+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=   7200.793     FROM MIGRAD    STATUS=FAILED       176 CALLS      429 TOTAL
                     EDM=   .12E-05    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    .27526E-01    .23163E-03** at limit **
   2  Index         8.7416        9.2172        .15114E-01    .39698E-03
   3  Normalizat    1.4023        .13296        .41621E-03   -.37097E-03
   4  Prefactor     .93203        .53389E-01    .20145E-03   -.10309E-02
                               ERR DEF=  .500    
 START SIMPLEX MINIMIZATION.    CONVERGENCE WHEN EDM .LT.   .20E-04
 SIMPLEX MINIMIZATION HAS CONVERGED.

 FCN=   7200.793     FROM SIMPLEX   STATUS=UNCHANGED    161 CALLS      590 TOTAL
                     EDM=   .13E-04    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    .27526E-01    .10277E-04** at limit **
   2  Index         8.7416        9.2172        .50622E-03    .39698E-03
   3  Normalizat    1.4023        .13296        .14112E-04   -.37097E-03
   4  Prefactor     .93203        .53389E-01    .67872E-05   -.10309E-02
                               ERR DEF=  .500    

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   7200.793     FROM MIGRAD    STATUS=CONVERGED     40 CALLS      630 TOTAL
                     EDM=   .35E-09    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    .18762E-01    .28214E-03** at limit **
   2  Index         8.7416        9.2892        .30228E-02    .97071E-05
   3  Normalizat    1.4023        .12246        .83242E-04   -.35288E-03
   4  Prefactor     .93203        .49365E-01    .40291E-04   -.10105E-02
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Index      = 8.74162
  Normalizat = 1.40235
  Prefactor  = 0.932031
 **********
 **   18 **HESSE 
 **********

 FCN=   7200.793     FROM HESSE     STATUS=NOT POSDEF    35 CALLS      665 TOTAL
                     EDM=   .34E-09    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE     INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    .22145E-01    .26252E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         8.7416        9.2366        .12091E-03    .84553    
   3  Normalizat    1.4023        .12956        .16648E-04   -.80561    
   4  Prefactor     .93203        .52258E-01    .80581E-05   -.95031    
                               ERR DEF=  .500    
Minuit fit quality: 2   estimated distance: 3.3801e-10
Minuit parameter uncertainties:
  1  2.07951e-07
  2  9.10601
  3  0.129591
  4  0.0522609
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/113285': 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): 102
logL (Free Index) = 7200.79270725
delta logL = 0.247971871107

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  1.000e-04  2.080e-07  1.000e-04  1.000e+04 ( 1.000e-12)
324        Index:  8.742e+00  9.106e+00  0.000e+00  1.000e+01 (-1.000e+00)
325        Scale:  7.724e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
596    Prefactor:  9.320e-01  5.226e-02  0.000e+00  1.000e+01 ( 1.000e+00)
597        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
598        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
595   Normalization:  1.402e+00  1.296e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): -0.00
Ra Dec: 310.136 -17.090

Creating a high resolution counts map...
INFO: Auto-setting vmin to -1.000e-01 [aplpy.core]
INFO: Auto-setting vmax to  1.110e+00 [aplpy.core]
Saving /scratch/kocevski/113285/cmap_HighResolution_600134401_600393601_4FGL_J2040.5-1705_daily_bin1392.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='9.06e-03', job_status='DONE', photon_flux_upper_limit='1.16e-07', time_completed='2021-09-25 16:14:10.814782', job_id='113285', GAL2='0.93', fit_tolerance='1e-08', EG2='1.40', EG='1.49', time_epoch_completed='1632611650.81', return_code2='102', ts='-0.00', comment='SUCCESS', return_code='0', GAL='0.91', dlogl='2.48e-01', ts2='0.54', photon_index_error='0.00', photon_index='2.54' WHERE bin_id='1392' AND source_name='4FGL J2040.5-1705' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Sat Sep 25 16:14:10 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0008>
Subject: Job 113285: <4FGL_J2040.5-1705_daily_bin1392> in cluster <slac> Done

Job <4FGL_J2040.5-1705_daily_bin1392> was submitted from host <rhel6-64m> by user <kocevski> in cluster <slac> at Sat Sep 25 16:00:48 2021
Job was executed on host(s) <bullet0008>, in queue <medium>, as user <kocevski> in cluster <slac> at Sat Sep 25 16:01:04 2021
</u/ki/kocevski> was used as the home directory.
</u/ki/kocevski> was used as the working directory.
Started at Sat Sep 25 16:01:04 2021
Terminated at Sat Sep 25 16:14:11 2021
Results reported at Sat Sep 25 16:14:11 2021

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J2040.5-1705_daily_bin1392 310.136 -17.0901 600134401 600393601 irfs=P8R3_SOURCE_V2 zmax=90 ROI=12 association=4FGL_J2040.5-1705 fixedModel=True performFreeIndexFit=True freeVariableSources=True nuke=True repositoryJob=True verbose=False
------------------------------------------------------------

Successfully completed.

Resource usage summary:

    CPU time :                                   758.15 sec.
    Max Memory :                                 1094 MB
    Average Memory :                             326.23 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   787 sec.
    Turnaround time :                            803 sec.

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

