/sdf/group/fermi/u/kocevski/software/conda/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)

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 make4FGLDR3xml version 01r09.
The default diffuse model files and names are for P8R3, 4FGL DRs, and the default fermitools directory locations.

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

/sdf/group/fermi/u/kocevski/software/conda/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 = 7474
number of fields = 31
RA_SUN column already exists. File will not be modified.
Done.


Performing analysis on: 4FGL_J2040.5-1705_daily_bin1793
RA = 310.136, Dec = -17.0901
tmin = 704073601, tmax = 704332801
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='16818738', job_status='RUN', time_executed='2023-04-28 01:05:51.808853', time_epoch_executed='1682669151.81' WHERE source_name='4FGL J2040.5-1705' and cadence='daily' and bin_id='1793'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/16818738

Creating custom pfile directory:
/lscratch/kocevski/16818738/pfiles/

Retrieving the FT1 file...

Issuing command:
datacat find --group FT1 --filter 'nMetStop>=704073601.0 && nMetStart<704332801.0' /Data/Flight/Reprocess/P305

Issuing command:
datacat find --group FT1 --filter 'nMetStart>564945418 && nMetStop>=704073601.0 && nMetStart<704332801.0' /Data/Flight/Level1/LPA

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/16818738/ft1_4FGL_J2040.5-1705_daily_bin1793.fits


Retrieving the FT1 file...

Issuing command:
datacat find --group FT2 --filter 'nMetStop>=704073601.0 && nMetStart<704332801.0' /Data/Flight/Level1/LPA

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/16818738/ft1_4FGL_J2040.5-1705_daily_bin1793.fits outfile=/lscratch/kocevski/16818738/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin1793.fits ra=310.136 dec=-17.0901 rad=12.0 tmin=704073601.0 tmax=704332801.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 2.61
user 2.36
sys 0.19

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits sctable="SC_DATA" filter="IN_SAA!=T && LIVETIME>0 && gtifilter('/sdf/group/fermi/g/LCRepository/Likelihood/GTIs/nogrb.gti',(START+STOP)/2) && (angsep(RA_SUN,DEC_SUN,RA_ZENITH,DEC_ZENITH)>115 || gtifilter('/sdf/group/fermi/g/LCRepository/Likelihood/GTIs/nosolarflares.gti',(START+STOP)/2))" roicut=no evfile=/lscratch/kocevski/16818738/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin1793.fits evtable="EVENTS" outfile="/lscratch/kocevski/16818738/ft1_filtered_4FGL_J2040.5-1705_daily_bin1793.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('/sdf/group/fermi/g/LCRepository/Likelihood/GTIs/nogrb.gti',(START+STOP)/2) && (angsep(RA_SUN,DEC_SUN,RA_ZENITH,DEC_ZENITH)>115 || gtifilter('/sdf/group/fermi/g/LCRepository/Likelihood/GTIs/nosolarflares.gti',(START+STOP)/2))
real 0.36
user 0.19
sys 0.14

Number of photons that the gtmktime cut: 1246

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/16818738/ft1_filtered_4FGL_J2040.5-1705_daily_bin1793.fits" evtable="EVENTS" scfile=/lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits sctable="SC_DATA" outfile=/lscratch/kocevski/16818738/ltcube_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.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 /lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits
.....................!
real 8.38
user 8.08
sys 0.20

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/16818738/ft1_filtered_4FGL_J2040.5-1705_daily_bin1793.fits evtable="EVENTS" scfile=/lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits sctable="SC_DATA" expcube=/lscratch/kocevski/16818738/ltcube_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.fits outfile=/lscratch/kocevski/16818738/expmap_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.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 /lscratch/kocevski/16818738/ltcube_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.fits
.....................!
real 65.26
user 61.17
sys 3.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=/lscratch/kocevski/16818738/ft1_filtered_4FGL_J2040.5-1705_daily_bin1793.fits scfile=/lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits outfile=/lscratch/kocevski/16818738/cmap_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.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.38
user 0.21
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/16818738/ft1_filtered_4FGL_J2040.5-1705_daily_bin1793.fits scfile=/lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits outfile=/lscratch/kocevski/16818738/cmap_HighResolution_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.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.37
user 0.22
sys 0.13

Computing the diffuse response:
time -p gtdiffrsp evfile=/lscratch/kocevski/16818738/ft1_filtered_4FGL_J2040.5-1705_daily_bin1793.fits evtable="EVENTS" scfile=/lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/16818738/Model_4FGL_J2040.5-1705_daily_bin1793.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...
/lscratch/kocevski/16818738/ft1_filtered_4FGL_J2040.5-1705_daily_bin1793.fits.....................!
real 41.21
user 39.88
sys 1.01

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/16818738/ft1_filtered_4FGL_J2040.5-1705_daily_bin1793.fits', '/lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits', expMap='/lscratch/kocevski/16818738/expmap_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.fits', expCube='/lscratch/kocevski/16818738/ltcube_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/16818738/Model_4FGL_J2040.5-1705_daily_bin1793.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  0.000e+00  1.000e+06 ( 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): /lscratch/kocevski/16818738/ft1_filtered_4FGL_J2040.5-1705_daily_bin1793.fits
Spacecraft file(s): /lscratch/kocevski/16818738/ft2_4FGL_J2040.5-1705_daily_bin1793.fits
Exposure map: /lscratch/kocevski/16818738/expmap_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.fits
Exposure cube: /lscratch/kocevski/16818738/ltcube_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/16818738/Model_4FGL_J2040.5-1705_daily_bin1793.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) = 12995.5458318

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    13.543       1.0000          .0000       .10000E+07
     2 'Prefactor '    .79930       1.0000          .0000       .10000E+07
     3 'norm      '    11.051       1.0000          .0000       .10000E+07
     4 'norm      '    .18837E-04   1.0000          .0000       .10000E+07
     5 'Prefactor '    .13865E-03   1.0000          .0000       .10000E+07
     6 'norm      '    13.674       1.0000          .0000       .10000E+07
     7 'norm      '    .10797E-02   1.0000          .0000       .10000E+07
     8 'norm      '    .99888       1.0000          .0000       .10000E+07
     9 'Prefactor '    3.7175       1.0000          .0000       .10000E+07
    10 'Prefactor '    1.6629       1.0000          .0000       .10000E+07
    11 'norm      '    1.7389       1.0000          .0000       .10000E+07
    12 'Prefactor '    .79176E-06   1.0000          .0000       .10000E+07
    13 'norm      '    .53222E-04   1.0000          .0000       .10000E+07
    14 'Prefactor '    .36716E-03   1.0000          .0000       .10000E+07
    15 'Prefactor '    .52551E-04   1.0000          .0000       .10000E+07
    16 'Prefactor '    5.3335       1.0000          .0000       .10000E+07
    17 'Normalizat'    1.3330       1.0000         .10000E-01   10.000    
    18 'Prefactor '    .91852       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5990E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   12995.50     FROM MIGRAD    STATUS=CONVERGED    132 CALLS     1046 TOTAL
                     EDM=   .16E-10  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  3.1%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     13.300        1.3152       -.11644E-07    .57191E-03
   2  Prefactor     .80036        1.0658       -.65767E-07    .33454E-03
   3  norm          11.117        8.8046        .14277E-07   -.82389E-03
   4  norm           .0000        2.3509       -.28684E-06** at limit **
   5  Prefactor      .0000        23.365        .12863E-06** at limit **
   6  norm          13.691        8.1125        .11093E-06    .63592E-03
   7  norm           .0000        18.676        .10890E-06** at limit **
   8  norm          .99820        .74728       -.61846E-07   -.21740E-03
   9  Prefactor     3.7365        3.8596       -.17459E-06   -.74619E-02
  10  Prefactor     1.6484        4.8178       -.65205E-06   -.57484E-03
  11  norm          1.7367        2.1010       -.84676E-07    .70641E-03
  12  Prefactor      .0000        1.3207        .47379E-07** at limit **
  13  norm           .0000        6.2510       -.15044E-06** at limit **
  14  Prefactor     .16653E-09    11.695       -.14088E-05** at limit **
  15  Prefactor      .0000        9.6684       -.27904E-06** at limit **
  16  Prefactor     5.1921        9.0698        .25430E-06   -.34610E-02
  17  Normalizat    1.3332        .21284       -.36031E-05   -.46820E-04
  18  Prefactor     .91853        .94362E-01    .34412E-05   -.99243E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 13.3003
  Prefactor  = 0.800362
  norm       = 11.1166
  norm       = 0
  Prefactor  = 0
  norm       = 13.6907
  norm       = 0
  norm       = 0.998203
  Prefactor  = 3.73649
  Prefactor  = 1.64843
  norm       = 1.73675
  Prefactor  = 0
  norm       = 0
  Prefactor  = 1.66533e-10
  Prefactor  = 0
  Prefactor  = 5.19206
  Normalizat = 1.33319
  Prefactor  = 0.918528
 **********
 **   18 **HESSE 
 **********

 FCN=   12995.50     FROM HESSE     STATUS=OK           282 CALLS     1328 TOTAL
                     EDM=   .15E-05    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     13.300        14.245        .27192E-03   -1.5635    
   2  Prefactor     .80036        1.0749        .52987E-03   -1.5690    
   3  norm          11.117        8.8049        .30113E-03   -1.5641    
   4  norm           .0000        2.3536        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  Prefactor      .0000        23.377        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  norm          13.691        8.1158        .27061E-03   -1.5634    
   7  norm           .0000        18.661        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          .99820        .76836        .43725E-03   -1.5688    
   9  Prefactor     3.7365        10.209        .52349E-03   -1.5669    
  10  Prefactor     1.6484        4.8235        .81764E-03   -1.5682    
  11  norm          1.7367        2.1238        .79537E-03   -1.5682    
  12  Prefactor      .0000        1.3161        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  13  norm           .0000        6.2501        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor     .16653E-09    11.541        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Prefactor      .0000        9.6896        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  16  Prefactor     5.1921        9.7652        .43494E-03   -1.5662    
  17  Normalizat    1.3332        .17568        .74845E-01   -.82581    
  18  Prefactor     .91853        .77465E-01    .45241E-01   -.95497    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.4575e-06
Minuit parameter uncertainties:
  1  14.245
  2  1.07495
  3  8.80493
  4  6.72449e-06
  5  3.32729e-06
  6  8.11583
  7  2.23065e-05
  8  0.768363
  9  10.2088
  10  4.82349
  11  2.1238
  12  3.47086e-07
  13  6.4523e-06
  14  8.29507e-05
  15  1.87939e-05
  16  9.76525
  17  0.175761
  18  0.0774744
Done.

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

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  0.000e+00  3.471e-07  0.000e+00  1.000e+06 ( 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.185e-01  7.747e-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.333e+00  1.758e-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: 5.45e-08 ph cm-2 s-1
Energy Flux Upper Limit: 4.25e-03 MeV cm-2 s-1

Saving results to:
/lscratch/kocevski/16818738/likelihoodResults_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.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) = 12995.5097392
delta logL = -0.010408467444

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 12995.499331
delta logL = -2.94243363896e-07

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .31697E-07   1.0000          .0000       .10000E+07
     2 'Index     '    1.5985       1.0000          .0000       10.000    
     3 'Normalizat'    1.3331       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .91859       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.
  MNHESS FAILS AND WILL RETURN DIAGONAL MATRIX. 

 FCN=   12995.50     FROM MIGRAD    STATUS=CONVERGED     38 CALLS      239 TOTAL
                     EDM=   .51E-12  STRATEGY=1  ERROR MATRIX UNCERTAINTY=100.0%

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor      .0000        1.3033        .42118E-03** at limit **
   2  Index         2.1787        1.1715       -.30593E-05     .0000    
   3  Normalizat    1.3332        1.0729        .27585E-05    .14907E-04
   4  Prefactor     .91853        1.2625       -.10907E-05    .44897E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0
  Index      = 2.17866
  Normalizat = 1.33319
  Prefactor  = 0.918528
 **********
 **   18 **HESSE 
 **********
  MNHESS FAILS AND WILL RETURN DIAGONAL MATRIX. 

 FCN=   12995.50     FROM HESSE     STATUS=FAILED         9 CALLS      248 TOTAL
                     EDM=   .51E-12  STRATEGY=1  ERROR MATRIX UNCERTAINTY=100.0%

  EXT PARAMETER                APPROXIMATE     INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor      .0000        1.3033        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         .52252        1.7721       -.30593E-05   -.59955    
   3  Normalizat    1.3332        1.0729        .27585E-05   -.82581    
   4  Prefactor     .91853        1.2625       -.10907E-05   -.95497    
                               ERR DEF=  .500    
Minuit fit quality: 1   estimated distance: 5.14891e-13
Minuit parameter uncertainties:
  1  1.37176e-06
  2  1.1878
  3  1.09169
  4  1.30666
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Done.

MINUIT Return Code (Free Index): 101
logL (Free Index) = 12995.4993307
delta logL = 0.0

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  0.000e+00  1.372e-06  0.000e+00  1.000e+06 ( 1.000e-12)
324        Index:  2.179e+00  1.188e+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.185e-01  1.307e+00  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.333e+00  1.092e+00  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 /lscratch/kocevski/16818738/cmap_HighResolution_704073601_704332801_4FGL_J2040.5-1705_daily_bin1793.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='4.25e-03', job_status='DONE', photon_flux_upper_limit='5.45e-08', time_completed='2023-04-28 01:10:47.355597', job_id='16818738', GAL2='0.92', fit_tolerance='1e-08', EG2='1.33', EG='1.33', time_epoch_completed='1682669447.36', return_code2='101', ts='0.00', comment='SUCCESS', return_code='0', GAL='0.92', dlogl='0.00e+00', ts2='0.00', photon_index_error='0.00', photon_index='2.54' WHERE bin_id='1793' AND source_name='4FGL J2040.5-1705' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Fri Apr 28 01:10:47 PDT 2023

