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


Performing analysis on: 4FGL_J1640.3+6850_weekly_bin854
RA = 250.082, Dec = 68.8483
tmin = 755481601, tmax = 756086401
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='60352449', job_status='RUN', time_executed='2024-12-17 00:51:59.663818', time_epoch_executed='1734425519.66' WHERE source_name='4FGL J1640.3+6850' and cadence='weekly' and bin_id='854'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/60352449

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

Retrieving the FT1 file...

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

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

Retrieving 92 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/60352449/ft1_4FGL_J1640.3+6850_weekly_bin854.fits


Retrieving the FT1 file...

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

Retrieving 92 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/60352449/ft2_4FGL_J1640.3+6850_weekly_bin854.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/60352449/ft1_4FGL_J1640.3+6850_weekly_bin854.fits outfile=/lscratch/kocevski/60352449/ft1_filteredMKT_4FGL_J1640.3+6850_weekly_bin854.fits ra=250.082 dec=68.8483 rad=12.0 tmin=755481601.0 tmax=756086401.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 5.25
user 4.71
sys 0.38

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

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/60352449/ft2_4FGL_J1640.3+6850_weekly_bin854.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/60352449/ft1_filteredMKT_4FGL_J1640.3+6850_weekly_bin854.fits evtable="EVENTS" outfile="/lscratch/kocevski/60352449/ft1_filtered_4FGL_J1640.3+6850_weekly_bin854.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.45
user 0.22
sys 0.13

Number of photons that the gtmktime cut: 1690

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/60352449/ft1_filtered_4FGL_J1640.3+6850_weekly_bin854.fits" evtable="EVENTS" scfile=/lscratch/kocevski/60352449/ft2_4FGL_J1640.3+6850_weekly_bin854.fits sctable="SC_DATA" outfile=/lscratch/kocevski/60352449/ltcube_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.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/60352449/ft2_4FGL_J1640.3+6850_weekly_bin854.fits
.....................!
real 17.29
user 16.71
sys 0.40

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/60352449/ft1_filtered_4FGL_J1640.3+6850_weekly_bin854.fits evtable="EVENTS" scfile=/lscratch/kocevski/60352449/ft2_4FGL_J1640.3+6850_weekly_bin854.fits sctable="SC_DATA" expcube=/lscratch/kocevski/60352449/ltcube_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.fits outfile=/lscratch/kocevski/60352449/expmap_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.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/60352449/ltcube_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.fits
.....................!
real 71.00
user 66.50
sys 4.12

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/60352449/ft1_filtered_4FGL_J1640.3+6850_weekly_bin854.fits scfile=/lscratch/kocevski/60352449/ft2_4FGL_J1640.3+6850_weekly_bin854.fits outfile=/lscratch/kocevski/60352449/cmap_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.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 0.42
user 0.24
sys 0.14

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/60352449/ft1_filtered_4FGL_J1640.3+6850_weekly_bin854.fits scfile=/lscratch/kocevski/60352449/ft2_4FGL_J1640.3+6850_weekly_bin854.fits outfile=/lscratch/kocevski/60352449/cmap_HighResolution_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.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 0.43
user 0.24
sys 0.14

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

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/60352449/ft1_filtered_4FGL_J1640.3+6850_weekly_bin854.fits', '/lscratch/kocevski/60352449/ft2_4FGL_J1640.3+6850_weekly_bin854.fits', expMap='/lscratch/kocevski/60352449/expmap_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.fits', expCube='/lscratch/kocevski/60352449/ltcube_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/60352449/Model_4FGL_J1640.3+6850_weekly_bin854.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/60352449/ft1_filtered_4FGL_J1640.3+6850_weekly_bin854.fits
Spacecraft file(s): /lscratch/kocevski/60352449/ft2_4FGL_J1640.3+6850_weekly_bin854.fits
Exposure map: /lscratch/kocevski/60352449/expmap_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.fits
Exposure cube: /lscratch/kocevski/60352449/ltcube_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/60352449/Model_4FGL_J1640.3+6850_weekly_bin854.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) = 18098.9969907

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    26.275       1.0000          .0000       .10000E+07
     2 'Prefactor '    11.751       1.0000          .0000       .10000E+07
     3 'Prefactor '    .74985       1.0000          .0000       .10000E+07
     4 'Prefactor '    16.043       1.0000          .0000       .10000E+07
     5 'Prefactor '    .54503E-03   1.0000          .0000       .10000E+07
     6 'norm      '    2.1449       1.0000          .0000       .10000E+07
     7 'Prefactor '    .90619E-04   1.0000          .0000       .10000E+07
     8 'Prefactor '    .14707E-02   1.0000          .0000       .10000E+07
     9 'norm      '    1.6210       1.0000          .0000       .10000E+07
    10 'Prefactor '    .21537E-03   1.0000          .0000       .10000E+07
    11 'Prefactor '    1.4478       1.0000          .0000       .10000E+07
    12 'Prefactor '    13.419       1.0000          .0000       .10000E+07
    13 'norm      '    18.947       1.0000          .0000       .10000E+07
    14 'Prefactor '    2.1404       1.0000          .0000       .10000E+07
    15 'norm      '    1.8971       1.0000          .0000       .10000E+07
    16 'Prefactor '    2.9110       1.0000          .0000       .10000E+07
    17 'Prefactor '    .13244       1.0000          .0000       .10000E+07
    18 'Prefactor '    1.0357       1.0000          .0000       .10000E+07
    19 'Prefactor '    4.0191       1.0000          .0000       .10000E+07
    20 'Prefactor '    27.497       1.0000          .0000       .10000E+07
    21 'Prefactor '    5.4003       1.0000          .0000       .10000E+07
    22 'Prefactor '    .49396E-02   1.0000          .0000       .10000E+07
    23 'norm      '    4.1206       1.0000          .0000       .10000E+07
    24 'norm      '    2.5837       1.0000          .0000       .10000E+07
    25 'norm      '    5.7544       1.0000          .0000       .10000E+07
    26 'Prefactor '    .24201E-03   1.0000          .0000       .10000E+07
    27 'Prefactor '    .57614E-04   1.0000          .0000       .10000E+07
    28 'Prefactor '    .14538E-04   1.0000          .0000       .10000E+07
    29 'Prefactor '    .27422E-03   1.0000          .0000       .10000E+07
    30 'Normalizat'    .85251       1.0000         .10000E-01   10.000    
    31 'Prefactor '    1.1487       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=   18098.99     FROM MIGRAD    STATUS=CONVERGED    183 CALLS     2997 TOTAL
                     EDM=   .11E-08  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  1.0%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     26.203        1.8321       -.16119E-07    .42835E-01
   2  Prefactor     11.762        8.9820       -.35623E-07    .19369E-01
   3  Prefactor     .74668        .52266        .79515E-08   -.12590E-02
   4  Prefactor     16.042        1.2829        .26287E-09    .35240E-02
   5  Prefactor     .19151E-06    6.0603       -.60992E-07** at limit **
   6  norm          2.1449        1.4593       -.21957E-07   -.70228E-03
   7  Prefactor     .12934E-06    62.302       -.80117E-06** at limit **
   8  Prefactor     .15599E-07    8.9085        .57486E-07** at limit **
   9  norm          1.6300        4.0449       -.14082E-06   -.68717E-03
  10  Prefactor     .19103E-05    8.2983        .77515E-07** at limit **
  11  Prefactor     1.4198        4.4876       -.16500E-06   -.44002E-03
  12  Prefactor     13.419        1.0375        .21713E-08    .13129E-02
  13  norm          18.928        6.0705       -.68452E-07    .50246E-03
  14  Prefactor     2.1276        11.530       -.35768E-06   -.11164E-01
  15  norm          1.8969        .57121       -.19392E-07   -.10277E-01
  16  Prefactor     2.9144        3.8816        .24572E-07    .16758E-04
  17  Prefactor     .14162        5.0372        .54256E-06** at limit **
  18  Prefactor     1.0305        15.526       -.65810E-07   -.38499E-03
  19  Prefactor     4.0224        3.0643        .33883E-07    .46894E-03
  20  Prefactor     27.424        1.1873        .10064E-07    .11922E-01
  21  Prefactor     5.3857        5.3274        .82595E-07    .14797E-02
  22  Prefactor     .48389E-05    15.767        .76474E-08** at limit **
  23  norm          4.1206        1.5847        .36038E-08   -.55817E-03
  24  norm          2.5837        .58838        .42863E-08    .10439E-02
  25  norm          5.7548        2.7423        .15870E-07   -.67574E-02
  26  Prefactor     .43299E-08    5.7517       -.51669E-07** at limit **
  27  Prefactor     .11435E-06    7.2451        .59460E-07** at limit **
  28  Prefactor     .14660E-04    14.063       -.22470E-07** at limit **
  29  Prefactor     .76716E-07    5.1547       -.54332E-07** at limit **
  30  Normalizat    .85268        .12709       -.27374E-06   -.14938E-03
  31  Prefactor     1.1487        .10560       -.12893E-05   -.24833E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 26.2035
  Prefactor  = 11.762
  Prefactor  = 0.746683
  Prefactor  = 16.0424
  Prefactor  = 1.91513e-07
  norm       = 2.14491
  Prefactor  = 1.29341e-07
  Prefactor  = 1.55986e-08
  norm       = 1.62998
  Prefactor  = 1.91031e-06
  Prefactor  = 1.41985
  Prefactor  = 13.4188
  norm       = 18.9276
  Prefactor  = 2.12762
  norm       = 1.89691
  Prefactor  = 2.91444
  Prefactor  = 0.14162
  Prefactor  = 1.03046
  Prefactor  = 4.02235
  Prefactor  = 27.4245
  Prefactor  = 5.38575
  Prefactor  = 4.83891e-06
  norm       = 4.12061
  norm       = 2.58366
  norm       = 5.75478
  Prefactor  = 4.32987e-09
  Prefactor  = 1.14353e-07
  Prefactor  = 1.46601e-05
  Prefactor  = 7.67164e-08
  Normalizat = 0.85268
  Prefactor  = 1.14867
 **********
 **   18 **HESSE 
 **********

 FCN=   18098.99     FROM HESSE     STATUS=OK           708 CALLS     3705 TOTAL
                     EDM=   .81E-05    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     26.203        45.077        .19513E-03   -1.5606    
   2  Prefactor     11.762        8.9959        .29198E-03   -1.5639    
   3  Prefactor     .74668        23.452        .56750E-03   -1.5691    
   4  Prefactor     16.042        22.232        .24979E-03   -1.5628    
   5  Prefactor     .19151E-06    6.2866        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  norm          2.1449        1.4592        .70338E-03   -1.5679    
   7  Prefactor     .12934E-06    62.480        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  Prefactor     .15599E-07    8.9274        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  norm          1.6300        4.0969        .83093E-03   -1.5682    
  10  Prefactor     .19103E-05    17.086        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  Prefactor     1.4198        4.5235        .89535E-03   -1.5684    
  12  Prefactor     13.419        13.651        .27318E-03   -1.5635    
  13  norm          18.928        6.0825        .22982E-03   -1.5621    
  14  Prefactor     2.1276        11.803        .70422E-03   -1.5679    
  15  norm          1.8969        .59266        .75493E-03   -1.5680    
  16  Prefactor     2.9144        3.9201        .59523E-03   -1.5674    
  17  Prefactor     .14162        .61532        .63850E-02   -1.5700    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Prefactor     1.0305        15.928        .12378E-02   -1.5688    
  19  Prefactor     4.0224        3.0674        .50278E-03   -1.5668    
  20  Prefactor     27.424        17.303        .19074E-03   -1.5603    
  21  Prefactor     5.3857        5.3496        .43219E-03   -1.5662    
  22  Prefactor     .48389E-05    21.931        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  23  norm          4.1206        1.5894        .49635E-03   -1.5667    
  24  norm          2.5837        .59662        .63462E-03   -1.5676    
  25  norm          5.7548        2.8088        .41847E-03   -1.5660    
  26  Prefactor     .43299E-08    5.7712        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  27  Prefactor     .11435E-06    17.532        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  28  Prefactor     .14660E-04    1.9042        .55209E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  29  Prefactor     .76716E-07    5.2624        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  30  Normalizat    .85268        .11295        .66457E-01   -.98143    
  31  Prefactor     1.1487        .92943E-01    .35974E-01   -.87926    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 8.12167e-06
Minuit parameter uncertainties:
  1  45.0777
  2  8.99596
  3  8.36925
  4  22.2321
  5  0.00219462
  6  1.45918
  7  0.00568589
  8  0.000746555
  9  4.09689
  10  0.0114263
  11  4.52356
  12  13.6507
  13  6.08253
  14  10.0225
  15  0.592664
  16  3.92015
  17  0.590395
  18  8.10259
  19  3.06738
  20  17.3032
  21  5.34956
  22  0.0206032
  23  1.58942
  24  0.596617
  25  2.80881
  26  0.000315851
  27  0.00283171
  28  0.010567
  29  0.0012709
  30  0.112982
  31  0.0929566
Done.

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

Extracting fit parameters...

4FGL J1640.3+6850
   Spectrum: PowerLaw
350    Prefactor:  1.342e+01  1.365e+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:  1.149e+00  9.296e-02  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:  8.527e-01  1.130e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 2.83
Ra Dec: 250.082 68.848
Photon Index (Fixed Index): 2.13 +/- 0.00
Photon Flux (Fixed Index): 9.75e-09 +/- 9.91e-09
Energy Flux (Fixed Index): 5.00e-06 +/- 5.08e-06

TS (Fixed Index): 2.83
Ra Dec: 250.082 68.848
Photon Flux Upper Limit: 3.76845959008e-08 ph cm-2 s-1
Energy Flux Upper Limit: 0.00285654281766 MeV cm-2 s-1

Saving results to:
/lscratch/kocevski/60352449/likelihoodResults_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.txt

Performing a free index iterative likelihood fit...

Freezing all point sources, except source of interest...

Done.

Freeing candidate source...
Done.

Fit tolerance = 1

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 18098.6000565
delta logL = 0.388658293232

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 18098.5995402
delta logL = 0.389174673426

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    17.795       1.0000          .0000       .10000E+07
     2 'Index     '    1.5037       1.0000          .0000       10.000    
     3 'Normalizat'    .85657       1.0000         .10000E-01   10.000    
     4 'Prefactor '    1.1483       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=   18098.60     FROM MIGRAD    STATUS=CONVERGED     91 CALLS      301 TOTAL
                     EDM=   .22E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     17.911        18.701        .94861E-05   -.19645E-02
   2  Index         1.5086        .67253        .17750E-01   -.51396E-04
   3  Normalizat    .85654        .12319        .29343E-03    .19465E-03
   4  Prefactor     1.1483        .10443        .21666E-03    .27407E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 17.9106
  Index      = 1.50856
  Normalizat = 0.856545
  Prefactor  = 1.14826
 **********
 **   18 **HESSE 
 **********

 FCN=   18098.60     FROM HESSE     STATUS=OK            23 CALLS      324 TOTAL
                     EDM=   .23E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     17.911        18.870        .18972E-05   -1.5623    
   2  Index         1.5086        .67903        .70999E-03   -.77300    
   3  Normalizat    .85654        .12328        .11737E-04   -.98004    
   4  Prefactor     1.1483        .10451        .43332E-04   -.87939    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.26972e-10
Minuit parameter uncertainties:
  1  18.8699
  2  0.683173
  3  0.123325
  4  0.10453
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) = 18098.5995028
delta logL = 0.389212000995

Extracting fit parameters...

4FGL J1640.3+6850
   Spectrum: PowerLaw
350    Prefactor:  1.791e+01  1.887e+01  0.000e+00  1.000e+06 ( 1.000e-14)
351        Index:  1.509e+00  6.832e-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:  1.148e+00  1.045e-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:  8.565e-01  1.233e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 3.61
Ra Dec: 250.082 68.848
Photon Index (Free Index): 1.51 +/- 0.68
Photon Flux (Free Index): 3.95e-09 +/- 6.13e-09
Energy Flux (Free Index): 1.21e-05 +/- 1.86e-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/60352449/cmap_HighResolution_755481601_756086401_4FGL_J1640.3+6850_weekly_bin854.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='2.86e-03', comment='SUCCESS', photon_flux='9.75e-09', energy_flux2='1.21e-05', photon_flux_error='9.91e-09', dlogl='3.89e-01', energy_flux='5.00e-06', photon_flux2='3.95e-09', job_status='DONE', time_completed='2024-12-17 01:06:41.647657', photon_index_error2='0.68', photon_index2='1.51', ts='2.83', fit_tolerance='1e-08', GAL='1.15', photon_index_error='0.00', photon_flux_upper_limit='3.77e-08', energy_flux_error2='1.86e-05', EG='0.85', time_epoch_completed='1734426401.65', return_code='0', job_id='60352449', GAL2='1.15', EG2='0.86', return_code2='0', energy_flux_error='5.08e-06', photon_flux_error2='6.13e-09', ts2='3.61', photon_index='2.13' WHERE bin_id='854' AND source_name='4FGL J1640.3+6850' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Dec 17 01:06:41 PST 2024

