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


Performing analysis on: 4FGL_J1640.3+6850_daily_bin2114
RA = 250.082, Dec = 68.8483
tmin = 787276801, tmax = 787536001
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='17373804', job_status='RUN', time_executed='2025-12-16 01:33:16.203159', time_epoch_executed='1765877596.2' WHERE source_name='4FGL J1640.3+6850' and cadence='daily' and bin_id='2114'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/17373804

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

Retrieving the FT1 file...

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

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

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/17373804/ft1_4FGL_J1640.3+6850_daily_bin2114.fits


Retrieving the FT1 file...

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

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/17373804/ft1_4FGL_J1640.3+6850_daily_bin2114.fits outfile=/lscratch/kocevski/17373804/ft1_filteredMKT_4FGL_J1640.3+6850_daily_bin2114.fits ra=250.082 dec=68.8483 rad=12.0 tmin=787276801.0 tmax=787536001.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.83
user 1.83
sys 0.21

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.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/17373804/ft1_filteredMKT_4FGL_J1640.3+6850_daily_bin2114.fits evtable="EVENTS" outfile="/lscratch/kocevski/17373804/ft1_filtered_4FGL_J1640.3+6850_daily_bin2114.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 1.05
user 0.19
sys 0.14

Number of photons that the gtmktime cut: 806

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/17373804/ft1_filtered_4FGL_J1640.3+6850_daily_bin2114.fits" evtable="EVENTS" scfile=/lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits sctable="SC_DATA" outfile=/lscratch/kocevski/17373804/ltcube_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.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/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits
.....................!
real 8.46
user 7.35
sys 0.23

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/17373804/ft1_filtered_4FGL_J1640.3+6850_daily_bin2114.fits evtable="EVENTS" scfile=/lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits sctable="SC_DATA" expcube=/lscratch/kocevski/17373804/ltcube_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.fits outfile=/lscratch/kocevski/17373804/expmap_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.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/17373804/ltcube_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.fits
.....................!
real 65.92
user 61.13
sys 3.72

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

Setting source of interest to:
4FGL J1640.3+6850 @ 250.082 68.8483

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/17373804/ft1_filtered_4FGL_J1640.3+6850_daily_bin2114.fits scfile=/lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits outfile=/lscratch/kocevski/17373804/cmap_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.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=250.082 yref=68.8483 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 1.12
user 0.21
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/17373804/ft1_filtered_4FGL_J1640.3+6850_daily_bin2114.fits scfile=/lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits outfile=/lscratch/kocevski/17373804/cmap_HighResolution_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.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=250.082 yref=68.8483 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 1.07
user 0.21
sys 0.14

Computing the diffuse response:
time -p gtdiffrsp evfile=/lscratch/kocevski/17373804/ft1_filtered_4FGL_J1640.3+6850_daily_bin2114.fits evtable="EVENTS" scfile=/lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/17373804/Model_4FGL_J1640.3+6850_daily_bin2114.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/17373804/ft1_filtered_4FGL_J1640.3+6850_daily_bin2114.fits.....................!
real 32.70
user 30.87
sys 0.97

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/17373804/ft1_filtered_4FGL_J1640.3+6850_daily_bin2114.fits', '/lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits', expMap='/lscratch/kocevski/17373804/expmap_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.fits', expCube='/lscratch/kocevski/17373804/ltcube_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/17373804/Model_4FGL_J1640.3+6850_daily_bin2114.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J1640.3+6850'

4FGL J1640.3+6850
   Spectrum: PowerLaw
350    Prefactor:  3.992e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-14)
351        Index:  2.132e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
352        Scale:  2.329e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/17373804/ft1_filtered_4FGL_J1640.3+6850_daily_bin2114.fits
Spacecraft file(s): /lscratch/kocevski/17373804/ft2_4FGL_J1640.3+6850_daily_bin2114.fits
Exposure map: /lscratch/kocevski/17373804/expmap_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.fits
Exposure cube: /lscratch/kocevski/17373804/ltcube_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/17373804/Model_4FGL_J1640.3+6850_daily_bin2114.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) = 8424.00725555

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .15319E-01   1.0000          .0000       .10000E+07
     2 'Prefactor '    .46528E-02   1.0000          .0000       .10000E+07
     3 'Prefactor '    .36364E-02   1.0000          .0000       .10000E+07
     4 'Prefactor '    26.805       1.0000          .0000       .10000E+07
     5 'Prefactor '    31.204       1.0000          .0000       .10000E+07
     6 'norm      '    4.5613       1.0000          .0000       .10000E+07
     7 'Prefactor '    3.7346       1.0000          .0000       .10000E+07
     8 'Prefactor '    11.860       1.0000          .0000       .10000E+07
     9 'norm      '    19.926       1.0000          .0000       .10000E+07
    10 'Prefactor '    336.72       1.0000          .0000       .10000E+07
    11 'Prefactor '    .10626E-02   1.0000          .0000       .10000E+07
    12 'Prefactor '    47.999       1.0000          .0000       .10000E+07
    13 'norm      '    5.8627       1.0000          .0000       .10000E+07
    14 'Prefactor '    .33968E-01   1.0000          .0000       .10000E+07
    15 'norm      '    6.2513       1.0000          .0000       .10000E+07
    16 'Prefactor '    .25460E-02   1.0000          .0000       .10000E+07
    17 'Prefactor '    .30914E-06   1.0000          .0000       .10000E+07
    18 'Prefactor '    2.3763       1.0000          .0000       .10000E+07
    19 'Prefactor '    .22444E-02   1.0000          .0000       .10000E+07
    20 'Prefactor '    29.400       1.0000          .0000       .10000E+07
    21 'Prefactor '    .16439E-03   1.0000          .0000       .10000E+07
    22 'Prefactor '    .14208       1.0000          .0000       .10000E+07
    23 'norm      '    1.4426       1.0000          .0000       .10000E+07
    24 'norm      '    2.0975       1.0000          .0000       .10000E+07
    25 'norm      '    2.4975       1.0000          .0000       .10000E+07
    26 'Prefactor '    .32231E-02   1.0000          .0000       .10000E+07
    27 'Prefactor '    87.564       1.0000          .0000       .10000E+07
    28 'Prefactor '    5.4512       1.0000          .0000       .10000E+07
    29 'Prefactor '    33.096       1.0000          .0000       .10000E+07
    30 'Normalizat'    1.2108       1.0000         .10000E-01   10.000    
    31 'Prefactor '    .66178       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .6760E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   8423.998     FROM MIGRAD    STATUS=CONVERGED    292 CALLS     3173 TOTAL
                     EDM=   .53E-09  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  1.9%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor      .0000        17.830       -.25098E-07** at limit **
   2  Prefactor      .0000        6.5713       -.10444E-06** at limit **
   3  Prefactor      .0000        4.4867        .12766E-06** at limit **
   4  Prefactor     26.877        15.225        .26182E-06   -.86885E-01
   5  Prefactor     31.230        19.548        .37173E-06    .61337E-01
   6  norm          4.5848        2.4755        .98470E-07   -.47565E-02
   7  Prefactor     .17274        4834.3       -.20874E-04** at limit **
   8  Prefactor     11.859        17.995       -.44359E-07   -.40112E-02
   9  norm          19.885        15.139       -.70697E-06    .70556E-02
  10  Prefactor     331.67        196.41        .43295E-06    .35336E-04
  11  Prefactor     .55511E-10    6.0914        .33327E-06** at limit **
  12  Prefactor     47.841        35.723        .41080E-06    .93454E-02
  13  norm          5.9083        6.3002        .43815E-07   -.29146E-03
  14  Prefactor     .49960E-09    118.56        .20507E-05** at limit **
  15  norm          6.2510        1.2460        .49058E-08   -.11058E-02
  16  Prefactor      .0000        6.4282        .14786E-06** at limit **
  17  Prefactor      .0000        1.5670        .15119E-06** at limit **
  18  Prefactor     2.3667        15.019       -.32184E-07    .13569E-03
  19  Prefactor     .55511E-10    5.0620       -.53485E-06** at limit **
  20  Prefactor     29.482        26.944       -.13654E-06   -.38149E-03
  21  Prefactor      .0000        2.9125       -.10531E-07** at limit **
  22  Prefactor      .0000        31.242        .43559E-07** at limit **
  23  norm          1.4402        2.2583        .43800E-07   -.14702E-03
  24  norm          2.0951        .79877       -.25519E-07    .13283E-02
  25  norm          2.4930        3.4934       -.42842E-07   -.28900E-04
  26  Prefactor      .0000        11.164       -.10187E-06** at limit **
  27  Prefactor     84.658        82.423       -.13474E-05    .67636E-01
  28  Prefactor     5.4858        6.7880        .95338E-07    .23688E-02
  29  Prefactor     32.958        21.288        .24022E-07   -.52047E-01
  30  Normalizat    1.2129        .18634        .14709E-05   -.15022E-03
  31  Prefactor     .66133        .14566       -.27648E-05   -.75297E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0
  Prefactor  = 0
  Prefactor  = 0
  Prefactor  = 26.877
  Prefactor  = 31.2296
  norm       = 4.5848
  Prefactor  = 0.172743
  Prefactor  = 11.8591
  norm       = 19.8852
  Prefactor  = 331.67
  Prefactor  = 5.55112e-11
  Prefactor  = 47.8413
  norm       = 5.90829
  Prefactor  = 4.996e-10
  norm       = 6.25101
  Prefactor  = 0
  Prefactor  = 0
  Prefactor  = 2.36673
  Prefactor  = 5.55112e-11
  Prefactor  = 29.4817
  Prefactor  = 0
  Prefactor  = 0
  norm       = 1.44022
  norm       = 2.09514
  norm       = 2.49303
  Prefactor  = 0
  Prefactor  = 84.6578
  Prefactor  = 5.48581
  Prefactor  = 32.9579
  Normalizat = 1.21293
  Prefactor  = 0.661334
 **********
 **   18 **HESSE 
 **********

 FCN=   8423.998     FROM HESSE     STATUS=OK           698 CALLS     3871 TOTAL
                     EDM=   .15E-05    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor      .0000        17.815        .17367E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Prefactor      .0000        6.5716        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   3  Prefactor      .0000        4.4851        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     26.877        25.113        .19318E-03   -1.5604    
   5  Prefactor     31.230        21.831        .17904E-03   -1.5596    
   6  norm          4.5848        2.4890        .47110E-03   -1.5665    
   7  Prefactor     .17274        90.112        .18290E-01   -1.5716    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  Prefactor     11.859        18.028        .29063E-03   -1.5639    
   9  norm          19.885        15.329        .22410E-03   -1.5619    
  10  Prefactor     331.67        197.90        .54505E-04   -1.5344    
  11  Prefactor     .55511E-10    6.0557        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor     47.841        35.800        .14435E-03   -1.5570    
  13  norm          5.9083        6.3178        .41452E-03   -1.5659    
  14  Prefactor     .49960E-09    10.481        .94930E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  norm          6.2510        1.2487        .40125E-03   -1.5658    
  16  Prefactor      .0000        6.4098        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  17  Prefactor      .0000        1.5626        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Prefactor     2.3667        15.225        .66431E-03   -1.5677    
  19  Prefactor     .55511E-10    5.0402        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  20  Prefactor     29.482        26.993        .18446E-03   -1.5599    
  21  Prefactor      .0000        2.9083        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  22  Prefactor      .0000        31.275        .12914E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  23  norm          1.4402        2.3080        .89760E-03   -1.5684    
  24  norm          2.0951        .80000        .71235E-03   -1.5679    
  25  norm          2.4930        3.5605        .64644E-03   -1.5676    
  26  Prefactor      .0000        11.159        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  27  Prefactor     84.658        146.45        .10687E-03   -1.5524    
  28  Prefactor     5.4858        6.9936        .43014E-03   -1.5661    
  29  Prefactor     32.958        23.285        .17385E-03   -1.5593    
  30  Normalizat    1.2129        .16189        .55620E-01   -.86204    
  31  Prefactor     .66133        .12681        .41890E-01   -1.0506    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.47876e-06
Minuit parameter uncertainties:
  1  2.83511e-06
  2  6.89056e-06
  3  1.4475e-05
  4  25.1129
  5  21.8313
  6  2.489
  7  7.89094
  8  18.0282
  9  15.3294
  10  197.902
  11  3.88499e-05
  12  35.8004
  13  6.3178
  14  0.000141918
  15  1.24868
  16  8.06915e-06
  17  3.35617e-06
  18  12.0058
  19  2.47933e-05
  20  26.993
  21  1.3057e-06
  22  1.27441e-05
  23  2.30802
  24  0.800003
  25  3.56047
  26  1.00828e-05
  27  146.455
  28  6.99361
  29  23.2853
  30  0.16196
  31  0.126869
Done.

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

Extracting fit parameters...

4FGL J1640.3+6850
   Spectrum: PowerLaw
350    Prefactor:  4.784e+01  3.580e+01  0.000e+00  1.000e+06 ( 1.000e-14)
351        Index:  2.132e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
352        Scale:  2.329e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
673    Prefactor:  6.613e-01  1.269e-01  0.000e+00  1.000e+01 ( 1.000e+00)
674        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
675        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
672   Normalization:  1.213e+00  1.620e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 4.48
Ra Dec: 250.082 68.848
Photon Index (Fixed Index): 2.13 +/- 0.00
Photon Flux (Fixed Index): 3.48e-08 +/- 2.60e-08
Energy Flux (Fixed Index): 1.78e-05 +/- 1.33e-05

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) = 8423.63067946
delta logL = 0.36772460503

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 8423.62952985
delta logL = 0.368874217045

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    70.548       1.0000          .0000       .10000E+07
     2 'Index     '    1.7173       1.0000          .0000       10.000    
     3 'Normalizat'    1.2250       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .65612       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .6760E+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=   8423.630     FROM MIGRAD    STATUS=CONVERGED     95 CALLS      313 TOTAL
                     EDM=   .11E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     70.558        54.315        .23813E-04    .98348E-04
   2  Index         1.7172        .46828        .90715E-02    .26149E-03
   3  Normalizat    1.2251        .17822        .24500E-03   -.15127E-04
   4  Prefactor     .65609        .14259        .25850E-03    .15745E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 70.5576
  Index      = 1.71722
  Normalizat = 1.2251
  Prefactor  = 0.656093
 **********
 **   18 **HESSE 
 **********

 FCN=   8423.630     FROM HESSE     STATUS=OK            25 CALLS      338 TOTAL
                     EDM=   .33E-11    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     70.558        53.908        .95252E-06   -1.5540    
   2  Index         1.7172        .46485        .18143E-02   -.71624    
   3  Normalizat    1.2251        .17834        .98002E-05   -.85831    
   4  Prefactor     .65609        .14270        .10340E-04   -1.0527    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 3.31323e-12
Minuit parameter uncertainties:
  1  53.9088
  2  0.466034
  3  0.178431
  4  0.142781
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 8423.62952978
delta logL = 0.368874283709

Extracting fit parameters...

4FGL J1640.3+6850
   Spectrum: PowerLaw
350    Prefactor:  7.056e+01  5.391e+01  0.000e+00  1.000e+06 ( 1.000e-14)
351        Index:  1.717e+00  4.660e-01  0.000e+00  1.000e+01 (-1.000e+00)
352        Scale:  2.329e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
673    Prefactor:  6.561e-01  1.428e-01  0.000e+00  1.000e+01 ( 1.000e+00)
674        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
675        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
672   Normalization:  1.225e+00  1.784e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 5.25
Ra Dec: 250.082 68.848
Photon Index (Free Index): 1.72 +/- 0.47
Photon Flux (Free Index): 2.18e-08 +/- 2.21e-08
Energy Flux (Free Index): 3.36e-05 +/- 3.66e-05

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/17373804/cmap_HighResolution_787276801_787536001_4FGL_J1640.3+6850_daily_bin2114.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='3.48e-08', energy_flux2='3.36e-05', photon_flux_error='2.60e-08', dlogl='3.69e-01', energy_flux='1.78e-05', photon_flux2='2.18e-08', job_status='DONE', time_completed='2025-12-16 01:43:32.541533', photon_index_error2='0.47', photon_index2='1.72', ts='4.48', fit_tolerance='1e-08', GAL='0.66', photon_index_error='0.00', energy_flux_error2='3.66e-05', EG='1.21', time_epoch_completed='1765878212.54', return_code='0', job_id='17373804', GAL2='0.66', EG2='1.23', return_code2='0', energy_flux_error='1.33e-05', photon_flux_error2='2.21e-08', ts2='5.25', photon_index='2.13' WHERE bin_id='2114' AND source_name='4FGL J1640.3+6850' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Tue Dec 16 01:43:33 PST 2025

