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


Performing analysis on: 4FGL_J2040.5-1705_daily_bin2156
RA = 310.136, Dec = -17.0901
tmin = 798163201, tmax = 798422401
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='25590084', job_status='RUN', time_executed='2026-04-21 01:02:56.737910', time_epoch_executed='1776758576.74' WHERE source_name='4FGL J2040.5-1705' and cadence='daily' and bin_id='2156'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/25590084

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

Retrieving the FT1 file...

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

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

Retrieving 47 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/25590084/ft1_4FGL_J2040.5-1705_daily_bin2156.fits


Retrieving the FT1 file...

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

Retrieving 47 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/25590084/ft1_4FGL_J2040.5-1705_daily_bin2156.fits outfile=/lscratch/kocevski/25590084/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin2156.fits ra=310.136 dec=-17.0901 rad=12.0 tmin=798163201.0 tmax=798422401.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.69
user 1.98
sys 0.15

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

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.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/25590084/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin2156.fits evtable="EVENTS" outfile="/lscratch/kocevski/25590084/ft1_filtered_4FGL_J2040.5-1705_daily_bin2156.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.78
user 0.19
sys 0.12

Number of photons that the gtmktime cut: 1113

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/25590084/ft1_filtered_4FGL_J2040.5-1705_daily_bin2156.fits" evtable="EVENTS" scfile=/lscratch/kocevski/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.fits sctable="SC_DATA" outfile=/lscratch/kocevski/25590084/ltcube_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.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/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.fits
.....................!
real 9.51
user 8.79
sys 0.22

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/25590084/ft1_filtered_4FGL_J2040.5-1705_daily_bin2156.fits evtable="EVENTS" scfile=/lscratch/kocevski/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.fits sctable="SC_DATA" expcube=/lscratch/kocevski/25590084/ltcube_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.fits outfile=/lscratch/kocevski/25590084/expmap_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.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/25590084/ltcube_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.fits
.....................!
real 70.56
user 66.21
sys 3.88

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/25590084/ft1_filtered_4FGL_J2040.5-1705_daily_bin2156.fits scfile=/lscratch/kocevski/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.fits outfile=/lscratch/kocevski/25590084/cmap_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.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.52
user 0.21
sys 0.12

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/25590084/ft1_filtered_4FGL_J2040.5-1705_daily_bin2156.fits scfile=/lscratch/kocevski/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.fits outfile=/lscratch/kocevski/25590084/cmap_HighResolution_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.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.60
user 0.22
sys 0.11

Computing the diffuse response:
time -p gtdiffrsp evfile=/lscratch/kocevski/25590084/ft1_filtered_4FGL_J2040.5-1705_daily_bin2156.fits evtable="EVENTS" scfile=/lscratch/kocevski/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/25590084/Model_4FGL_J2040.5-1705_daily_bin2156.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/25590084/ft1_filtered_4FGL_J2040.5-1705_daily_bin2156.fits.....................!
real 38.94
user 37.04
sys 1.37

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/25590084/ft1_filtered_4FGL_J2040.5-1705_daily_bin2156.fits', '/lscratch/kocevski/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.fits', expMap='/lscratch/kocevski/25590084/expmap_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.fits', expCube='/lscratch/kocevski/25590084/ltcube_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/25590084/Model_4FGL_J2040.5-1705_daily_bin2156.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/25590084/ft1_filtered_4FGL_J2040.5-1705_daily_bin2156.fits
Spacecraft file(s): /lscratch/kocevski/25590084/ft2_4FGL_J2040.5-1705_daily_bin2156.fits
Exposure map: /lscratch/kocevski/25590084/expmap_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.fits
Exposure cube: /lscratch/kocevski/25590084/ltcube_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/25590084/Model_4FGL_J2040.5-1705_daily_bin2156.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) = 11666.263119

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    50.881       1.0000          .0000       .10000E+07
     2 'Prefactor '    12.075       1.0000          .0000       .10000E+07
     3 'norm      '    18.288       1.0000          .0000       .10000E+07
     4 'norm      '    .54876E-05   1.0000          .0000       .10000E+07
     5 'Prefactor '    .15053       1.0000          .0000       .10000E+07
     6 'norm      '    .34568       1.0000          .0000       .10000E+07
     7 'norm      '    .28341E-03   1.0000          .0000       .10000E+07
     8 'norm      '    .27410E-05   1.0000          .0000       .10000E+07
     9 'Prefactor '    .35392E-05   1.0000          .0000       .10000E+07
    10 'Prefactor '    .43804E-06   1.0000          .0000       .10000E+07
    11 'norm      '    .65004E-07   1.0000          .0000       .10000E+07
    12 'Prefactor '    .48342E-04   1.0000          .0000       .10000E+07
    13 'norm      '    .35024E-03   1.0000          .0000       .10000E+07
    14 'Prefactor '    .75829E-03   1.0000          .0000       .10000E+07
    15 'Prefactor '    13.636       1.0000          .0000       .10000E+07
    16 'Prefactor '    .41295E-02   1.0000          .0000       .10000E+07
    17 'Normalizat'    1.0652       1.0000         .10000E-01   10.000    
    18 'Prefactor '    .91637       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=   11666.25     FROM MIGRAD    STATUS=CONVERGED    101 CALLS     1083 TOTAL
                     EDM=   .12E-08  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  1.7%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     50.838        3.1998       -.49595E-06    .30194    
   2  Prefactor     12.076        2.1111        .52621E-06   -.48766E-02
   3  norm          18.307        2.0340       -.28909E-06   -.79045E-02
   4  norm           .0000        2.2535       -.13514E-05** at limit **
   5  Prefactor     .36360E-07    27.631       -.90389E-05** at limit **
   6  norm          .35026        .61103        .52177E-07   -.25685E-02
   7  norm          .19318E-07    5.9175       -.11927E-05** at limit **
   8  norm           .0000        1.3396        .70793E-06** at limit **
   9  Prefactor     .10214E-07    2.2521       -.12733E-05** at limit **
  10  Prefactor     .55511E-10    1.5911        .12864E-05** at limit **
  11  norm          .11102E-09    .68580       -.59271E-06** at limit **
  12  Prefactor      .0000        2.2570        .72926E-06** at limit **
  13  norm          .26035E-07    5.1832       -.90543E-06** at limit **
  14  Prefactor     .76605E-08    4.0301        .22243E-05** at limit **
  15  Prefactor     13.629        1.1005       -.54139E-07    .51139E-02
  16  Prefactor     .71776E-07    9.1756        .43772E-05** at limit **
  17  Normalizat    1.0654        .21090       -.20358E-04   -.19819E-03
  18  Prefactor     .91623        .95250E-01    .62375E-05   -.21663E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 50.8385
  Prefactor  = 12.0758
  norm       = 18.3071
  norm       = 0
  Prefactor  = 3.63598e-08
  norm       = 0.350265
  norm       = 1.93179e-08
  norm       = 0
  Prefactor  = 1.02141e-08
  Prefactor  = 5.55112e-11
  norm       = 1.11022e-10
  Prefactor  = 0
  norm       = 2.60347e-08
  Prefactor  = 7.66054e-09
  Prefactor  = 13.6288
  Prefactor  = 7.17759e-08
  Normalizat = 1.06543
  Prefactor  = 0.916229
 **********
 **   18 **HESSE 
 **********

 FCN=   11666.25     FROM HESSE     STATUS=OK           280 CALLS     1363 TOTAL
                     EDM=   .14E-05    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     50.838        28.215        .14020E-03   -1.5565    
   2  Prefactor     12.076        2.1287        .28803E-03   -1.5638    
   3  norm          18.307        9.7486        .23393E-03   -1.5622    
   4  norm           .0000        4.5774        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  Prefactor     .36360E-07    27.612        .12732E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  norm          .35026        5.1011        .96071E-02   -1.5696    
   7  norm          .19318E-07    11.021        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm           .0000        .41722        .23653E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  Prefactor     .10214E-07    4.4682        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     .55511E-10    1.5908        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  norm          .11102E-09    .68647        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor      .0000        2.2486        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  13  norm          .26035E-07    11.098        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor     .76605E-08    4.1012        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Prefactor     13.629        11.708        .27099E-03   -1.5634    
  16  Prefactor     .71776E-07    9.2215        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  17  Normalizat    1.0654        .17504        .78531E-01   -.90869    
  18  Prefactor     .91623        .79038E-01    .45213E-01   -.95576    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.44996e-06
Minuit parameter uncertainties:
  1  28.2155
  2  2.12865
  3  9.7486
  4  1.00333e-05
  5  0.00200387
  6  2.67337
  7  0.000923432
  8  4.57022e-07
  9  0.000427475
  10  1.90734e-05
  11  1.59563e-05
  12  1.57451e-05
  13  0.00107471
  14  0.000354575
  15  11.7081
  16  0.00162685
  17  0.175136
  18  0.0790478
Done.

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

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  0.000e+00  1.575e-05  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.162e-01  7.905e-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.065e+00  1.751e-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: 7.18968156417e-08 ph cm-2 s-1
Energy Flux Upper Limit: 0.00560647670654 MeV cm-2 s-1

Saving results to:
/lscratch/kocevski/25590084/likelihoodResults_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.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) = 11666.2595105
delta logL = -0.00451865194191

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 11666.2549919
delta logL = -7.37545633456e-08

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .19429E-08   1.0000          .0000       .10000E+07
     2 'Index     '    1.5043       1.0000          .0000       10.000    
     3 'Normalizat'    1.0654       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .91625       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=   11666.25     FROM MIGRAD    STATUS=CONVERGED     37 CALLS      249 TOTAL
                     EDM=   .45E-12  STRATEGY=1  ERROR MATRIX UNCERTAINTY=100.0%

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor      .0000        2.2484        .42118E-03** at limit **
   2  Index         2.3233        1.2383        .53473E-06     .0000    
   3  Normalizat    1.0654        1.1853        .31464E-05   -.23759E-04
   4  Prefactor     .91623        1.2603       -.29096E-05   -.47644E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0
  Index      = 2.32328
  Normalizat = 1.06544
  Prefactor  = 0.916228
 **********
 **   18 **HESSE 
 **********
  MNHESS FAILS AND WILL RETURN DIAGONAL MATRIX. 

 FCN=   11666.25     FROM HESSE     STATUS=FAILED         9 CALLS      258 TOTAL
                     EDM=   .45E-12  STRATEGY=1  ERROR MATRIX UNCERTAINTY=100.0%

  EXT PARAMETER                APPROXIMATE     INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor      .0000        2.2484        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         .60225        1.8387        .53473E-06   -.56491    
   3  Normalizat    1.0654        1.1853        .31464E-05   -.90869    
   4  Prefactor     .91623        1.2603       -.29096E-05   -.95576    
                               ERR DEF=  .500    
Minuit fit quality: 1   estimated distance: 4.47176e-13
Minuit parameter uncertainties:
  1  1.57454e-06
  2  1.2568
  3  1.21689
  4  1.30433
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) = 11666.2549918
delta logL = 8.36735125631e-11

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  0.000e+00  1.575e-06  0.000e+00  1.000e+06 ( 1.000e-12)
324        Index:  2.323e+00  1.257e+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.162e-01  1.304e+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.065e+00  1.217e+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/25590084/cmap_HighResolution_798163201_798422401_4FGL_J2040.5-1705_daily_bin2156.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='5.61e-03', job_status='DONE', photon_flux_upper_limit='7.19e-08', time_completed='2026-04-21 01:09:31.287853', job_id='25590084', GAL2='0.92', fit_tolerance='1e-08', EG2='1.07', EG='1.07', time_epoch_completed='1776758971.29', return_code2='101', ts='0.00', comment='SUCCESS', return_code='0', GAL='0.92', dlogl='8.37e-11', ts2='0.00', photon_index_error='0.00', photon_index='2.54' WHERE bin_id='2156' AND source_name='4FGL J2040.5-1705' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Tue Apr 21 01:09:31 PDT 2026

