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


Performing analysis on: 4FGL_J2040.5-1705_daily_bin709
RA = 310.136, Dec = -17.0901
tmin = 423100801, tmax = 423360001
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='108761', job_status='RUN', time_executed='2021-09-25 15:51:51.757374', time_epoch_executed='1632610311.76' WHERE source_name='4FGL J2040.5-1705' and cadence='daily' and bin_id='709'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/108761

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

Retrieving the FT1 file...

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

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

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/108761/ft1_4FGL_J2040.5-1705_daily_bin709.fits


Retrieving the FT1 file...

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

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/108761/ft2_4FGL_J2040.5-1705_daily_bin709.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/108761/ft1_4FGL_J2040.5-1705_daily_bin709.fits outfile=/scratch/kocevski/108761/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin709.fits ra=310.136 dec=-17.0901 rad=12.0 tmin=423100801.0 tmax=423360001.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.99
user 4.71
sys 0.22

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

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/108761/ft2_4FGL_J2040.5-1705_daily_bin709.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/108761/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin709.fits evtable="EVENTS" outfile="/scratch/kocevski/108761/ft1_filtered_4FGL_J2040.5-1705_daily_bin709.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.56
user 0.34
sys 0.15

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/108761/ft1_filtered_4FGL_J2040.5-1705_daily_bin709.fits" evtable="EVENTS" scfile=/scratch/kocevski/108761/ft2_4FGL_J2040.5-1705_daily_bin709.fits sctable="SC_DATA" outfile=/scratch/kocevski/108761/ltcube_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.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/108761/ft2_4FGL_J2040.5-1705_daily_bin709.fits
.....................!
real 15.32
user 14.92
sys 0.34

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/108761/ft1_filtered_4FGL_J2040.5-1705_daily_bin709.fits evtable="EVENTS" scfile=/scratch/kocevski/108761/ft2_4FGL_J2040.5-1705_daily_bin709.fits sctable="SC_DATA" expcube=/scratch/kocevski/108761/ltcube_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.fits outfile=/scratch/kocevski/108761/expmap_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.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/108761/ltcube_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.fits
.....................!
real 192.63
user 186.60
sys 4.91

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/108761/ft1_filtered_4FGL_J2040.5-1705_daily_bin709.fits scfile=/scratch/kocevski/108761/ft2_4FGL_J2040.5-1705_daily_bin709.fits outfile=/scratch/kocevski/108761/cmap_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.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.58
user 0.37
sys 0.16

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/108761/ft1_filtered_4FGL_J2040.5-1705_daily_bin709.fits scfile=/scratch/kocevski/108761/ft2_4FGL_J2040.5-1705_daily_bin709.fits outfile=/scratch/kocevski/108761/cmap_HighResolution_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.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.39
sys 0.15

Computing the diffuse response:
time -p gtdiffrsp evfile=/scratch/kocevski/108761/ft1_filtered_4FGL_J2040.5-1705_daily_bin709.fits evtable="EVENTS" scfile=/scratch/kocevski/108761/ft2_4FGL_J2040.5-1705_daily_bin709.fits sctable="SC_DATA" srcmdl=/scratch/kocevski/108761/Model_4FGL_J2040.5-1705_daily_bin709.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/108761/ft1_filtered_4FGL_J2040.5-1705_daily_bin709.fits.....................!
real 48.01
user 46.24
sys 1.18

Creating the likelihood object...
obs = UnbinnedObs('/scratch/kocevski/108761/ft1_filtered_4FGL_J2040.5-1705_daily_bin709.fits', '/scratch/kocevski/108761/ft2_4FGL_J2040.5-1705_daily_bin709.fits', expMap='/scratch/kocevski/108761/expmap_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.fits', expCube='/scratch/kocevski/108761/ltcube_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/scratch/kocevski/108761/Model_4FGL_J2040.5-1705_daily_bin709.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/108761/ft1_filtered_4FGL_J2040.5-1705_daily_bin709.fits
Spacecraft file(s): /scratch/kocevski/108761/ft2_4FGL_J2040.5-1705_daily_bin709.fits
Exposure map: /scratch/kocevski/108761/expmap_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.fits
Exposure cube: /scratch/kocevski/108761/ltcube_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.fits
IRFs: P8R3_SOURCE_V2
Source model file: /scratch/kocevski/108761/Model_4FGL_J2040.5-1705_daily_bin709.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) = 4557.8176225

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    80.383       1.0000         .10000E-03   10000.    
     2 'Prefactor '    .10013E-03   1.0000         .10000E-03   10000.    
     3 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
     4 'Prefactor '    .10008E-03   1.0000         .10000E-03   10000.    
     5 'norm      '    .10020E-03   1.0000         .10000E-03   10000.    
     6 'norm      '    8.5185       1.0000         .10000E-03   10000.    
     7 'Prefactor '    .10242E-03   1.0000         .10000E-03   10000.    
     8 'norm      '    .10050E-03   1.0000         .10000E-03   10000.    
     9 'norm      '    .10001E-03   1.0000         .10000E-03   10000.    
    10 'norm      '    .36202E-03   1.0000         .10000E-03   10000.    
    11 'Prefactor '    29.104       1.0000         .10000E-03   10000.    
    12 'Prefactor '    .10010E-03   1.0000         .10000E-03   10000.    
    13 'norm      '    .63667       1.0000         .10000E-03   10000.    
    14 'Prefactor '    .10002E-03   1.0000         .10000E-03   10000.    
    15 'Prefactor '    .15055       1.0000         .10000E-03   10000.    
    16 'norm      '    3.3067       1.0000         .10000E-03   10000.    
    17 'Prefactor '    .10021E-03   1.0000         .10000E-03   10000.    
    18 'Prefactor '    9.8810       1.0000         .10000E-03   10000.    
    19 'Prefactor '    .10023E-03   1.0000         .10000E-03   10000.    
    20 'Prefactor '    21.770       1.0000         .10000E-03   10000.    
    21 'Normalizat'    .96524       1.0000         .10000E-01   10.000    
    22 'Prefactor '    .98394       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.

 FCN=   4557.808     FROM MIGRAD    STATUS=CONVERGED    849 CALLS     3077 TOTAL
                     EDM=   .30E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     80.398        63.393        .44796E-04    .12385E-04
   2  Prefactor     .10000E-03    24.800        .18142E-02** at limit **
   3  Prefactor     .10000E-03    1.2793        .74044E-03** at limit **
   4  Prefactor     .10000E-03    13.881        .18142E-02** at limit **
   5  norm          .10000E-03    7.5839        .18141E-02** at limit **
   6  norm          8.5117        13.760        .68673E-03   -.38407E-04
   7  Prefactor     .10000E-03    76.128        .18142E-02** at limit **
   8  norm          .10000E-03    8.6233        .18142E-02** at limit **
   9  norm          .10000E-03    20.560        .18142E-02** at limit **
  10  norm          .10000E-03    2.5667        .21904E-01** at limit **
  11  Prefactor     29.102        23.199        .74265E-04    .10287E-03
  12  Prefactor     .10000E-03    13.394        .36285E-03** at limit **
  13  norm          .63637        2.3473        .19273E-03   -.53384E-04
  14  Prefactor     .10000E-03    2.0815        .94910E-03** at limit **
  15  Prefactor     .10040E-03    129.02        .20525    ** at limit **
  16  norm          3.2625        89.016        .22263E-03   -.10571E-04
  17  Prefactor     .10000E-03    19.592        .18142E-02** at limit **
  18  Prefactor     9.8807        10.028        .63739E-03    .55935E-04
  19  Prefactor     .10000E-03    9.5026        .18142E-02** at limit **
  20  Prefactor     21.765        16.924        .85846E-04    .50324E-05
  21  Normalizat    .96511        .36101        .37757E-03    .14477E-03
  22  Prefactor     .98402        .15785        .16253E-03    .51901E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 80.3978
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  norm       = 0.0001
  norm       = 8.51168
  Prefactor  = 0.0001
  norm       = 0.0001
  norm       = 0.0001
  norm       = 0.000100002
  Prefactor  = 29.1024
  Prefactor  = 0.0001
  norm       = 0.636372
  Prefactor  = 0.0001
  Prefactor  = 0.0001004
  norm       = 3.26249
  Prefactor  = 0.0001
  Prefactor  = 9.88065
  Prefactor  = 0.0001
  Prefactor  = 21.765
  Normalizat = 0.965112
  Prefactor  = 0.984016
 **********
 **   18 **HESSE 
 **********

 FCN=   4557.808     FROM HESSE     STATUS=OK           342 CALLS     3419 TOTAL
                     EDM=   .30E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     80.398        63.392        .89592E-05   -1.3912    
   2  Prefactor     .10000E-03    24.800        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   3  Prefactor     .10000E-03    1.2794        .14809E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     .10000E-03    13.883        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  norm          .10000E-03    7.5845        .36282E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  norm          8.5117        13.758        .27469E-04   -1.5124    
   7  Prefactor     .10000E-03    76.128        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          .10000E-03    8.6236        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  norm          .10000E-03    20.561        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  norm          .10000E-03    1.9587        .26258E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  Prefactor     29.102        23.139        .29706E-05   -1.4629    
  12  Prefactor     .10000E-03    13.395        .72569E-04   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  13  norm          .63637        2.3472        .77091E-05   -1.5548    
  14  Prefactor     .10000E-03    2.0816        .18982E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Prefactor     .10040E-03    136.34        .19805       -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  16  norm          3.2625        89.026        .89052E-05   -1.5347    
  17  Prefactor     .10000E-03    19.598        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Prefactor     9.8807        10.026        .25496E-04   -1.5079    
  19  Prefactor     .10000E-03    9.5029        .36285E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  20  Prefactor     21.765        16.924        .34339E-05   -1.4775    
  21  Normalizat    .96511        .36125        .15103E-04   -.94209    
  22  Prefactor     .98402        .15794        .32506E-04   -.93264    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.97774e-10
Minuit parameter uncertainties:
  1  63.4454
  2  9.19373e-05
  3  1.18682e-05
  4  5.93805e-05
  5  1.21684e-05
  6  13.7628
  7  0.00012517
  8  9.21761e-06
  9  1.09685e-05
  10  0.00011681
  11  23.1464
  12  1.04166e-05
  13  2.34756
  14  5.16367e-06
  15  0.0148053
  16  34.1408
  17  9.51751e-06
  18  10.0275
  19  1.07722e-06
  20  16.928
  21  0.362166
  22  0.15801
Done.

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

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  1.000e-04  5.164e-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.840e-01  1.580e-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:  9.651e-01  3.622e-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.14e-07 ph cm-2 s-1
Energy Flux Upper Limit: 8.86e-03 MeV cm-2 s-1

Saving results to:
/scratch/kocevski/108761/likelihoodResults_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.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) = 4557.80994165
delta logL = -0.00228263310055

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 4557.80765907
delta logL = -5.81740096095e-08

Fit tolerance = 1e-08

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

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

 FCN=   4557.808     FROM MIGRAD    STATUS=CONVERGED     98 CALLS      249 TOTAL
                     EDM=   .17E-08    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    20.760        .96178E-02** at limit **
   2  Index         1.9662        5.0418        .50000        .72089E-06
   3  Normalizat    .96511        .21121E-01    .37756E-03   -.38942E-03
   4  Prefactor     .98402        .92386E-02    .16253E-03   -.89793E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Index      = 1.96618
  Normalizat = 0.965105
  Prefactor  = 0.984017
 **********
 **   18 **HESSE 
 **********

 FCN=   4557.808     FROM HESSE     STATUS=NOT POSDEF    29 CALLS      278 TOTAL
                     EDM=   .16E-07    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE     INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    192.36        .10753E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         1.9662        6.4428        .50000       -.65198    
   3  Normalizat    .96511        .69857E-01    .75512E-04   -.94209    
   4  Prefactor     .98402        .30558E-01    .32506E-04   -.93264    
                               ERR DEF=  .500    
Minuit fit quality: 2   estimated distance: 1.61381e-08
Minuit parameter uncertainties:
  1  8.41505e-05
  2  783.907
  3  0.0698632
  4  0.0305586
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/108761': 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) = 4557.80765374
delta logL = 5.26897474629e-06

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  1.000e-04  8.415e-05  1.000e-04  1.000e+04 ( 1.000e-12)
324        Index:  1.966e+00  7.839e+02  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.840e-01  3.056e-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:  9.651e-01  6.986e-02  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  0.000e+00 [aplpy.core]
INFO: Auto-setting vmax to  0.000e+00 [aplpy.core]
Saving /scratch/kocevski/108761/cmap_HighResolution_423100801_423360001_4FGL_J2040.5-1705_daily_bin709.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='8.86e-03', job_status='DONE', photon_flux_upper_limit='1.14e-07', time_completed='2021-09-25 16:02:12.044154', job_id='108761', GAL2='0.98', fit_tolerance='1e-08', EG2='0.97', EG='0.97', time_epoch_completed='1632610932.04', return_code2='102', ts='-0.00', comment='SUCCESS', return_code='0', GAL='0.98', dlogl='5.27e-06', ts2='-0.00', photon_index_error='0.00', photon_index='2.54' WHERE bin_id='709' AND source_name='4FGL J2040.5-1705' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Sat Sep 25 16:02:12 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0043>
Subject: Job 108761: <4FGL_J2040.5-1705_daily_bin709> in cluster <slac> Done

Job <4FGL_J2040.5-1705_daily_bin709> was submitted from host <rhel6-64f> by user <kocevski> in cluster <slac> at Sat Sep 25 15:45:38 2021
Job was executed on host(s) <bullet0043>, in queue <medium>, as user <kocevski> in cluster <slac> at Sat Sep 25 15:49:36 2021
</u/ki/kocevski> was used as the home directory.
</u/ki/kocevski> was used as the working directory.
Started at Sat Sep 25 15:49:36 2021
Terminated at Sat Sep 25 16:02:12 2021
Results reported at Sat Sep 25 16:02:12 2021

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J2040.5-1705_daily_bin709 310.136 -17.0901 423100801 423360001 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 :                                   618.00 sec.
    Max Memory :                                 1256 MB
    Average Memory :                             246.50 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   756 sec.
    Turnaround time :                            994 sec.

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

