/nfs/farm/g/glast/g/LCRepository/bin/miniconda2/envs/fermitools_v1.0.5/lib/python2.7/site-packages/pyfits/__init__.py:22: PyFITSDeprecationWarning: PyFITS is deprecated, please use astropy.io.fits
  PyFITSDeprecationWarning)  # noqa

Likelihood Analysis Tool
Support Contact: Daniel Kocevski (daniel.kocevski@nasa.gov)


Waiting 3 seconds before starting...
Proceeding.

Importing modules...
This is make3FGLxml version 01r0.
The default diffuse model files and names are for pass 8 and assume you have v10r00p05 of the Fermi Science Tools or higher.
This is make4FGLxml version 01r04.
The default diffuse model files and names are for pass 8 and 4FGL and assume you have v11r5p3 of the Fermi Science Tools or higher.

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

/nfs/farm/g/glast/g/LCRepository/bin/miniconda2/envs/fermitools_v1.0.5/lib/python2.7/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: The mpl_toolkits.axes_grid module was deprecated in version 2.1. Use mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist provies the same functionality instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)

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

number of points = 7485
number of fields = 29
RA_SUN column already exists. File will not be modified.
Done.


Performing analysis on: 4FGL_J1640.4+3945_daily_bin610
RA = 250.119, Dec = 39.7626
tmin = 397440001, tmax = 397699201
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='834077', job_status='RUN', time_executed='2021-09-15 06:32:03.519210', time_epoch_executed='1631712723.52' WHERE source_name='4FGL J1640.4+3945' and cadence='daily' and bin_id='610'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/834077

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

Retrieving the FT1 file...

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

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

Retrieving 46 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/834077/ft1_4FGL_J1640.4+3945_daily_bin610.fits


Retrieving the FT1 file...

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

Retrieving 46 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/834077/ft1_4FGL_J1640.4+3945_daily_bin610.fits outfile=/scratch/kocevski/834077/ft1_filteredMKT_4FGL_J1640.4+3945_daily_bin610.fits ra=250.119 dec=39.7626 rad=12.0 tmin=397440001.0 tmax=397699201.0 emin=100.0 emax=100000.0 zmin=0.0 zmax=90.0 evclass=128 evtype="INDEF" convtype=-1 phasemin=0.0 phasemax=1.0 evtable="EVENTS" chatter=2 clobber=yes debug=no gui=no mode="ql"

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

Done.
real 4.67
user 4.42
sys 0.23

Adding sun position to ft2 file:
/nfs/farm/g/glast/g/LCRepository/Repository/bin/sunpos /scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits sctable="SC_DATA" filter="IN_SAA!=T && LIVETIME>0 && gtifilter('/nfs/farm/g/glast/g/LCRepository/Likelihood/GTIs/nogrb.gti',(START+STOP)/2) && (angsep(RA_SUN,DEC_SUN,RA_ZENITH,DEC_ZENITH)>115 || gtifilter('/nfs/farm/g/glast/g/LCRepository/Likelihood/GTIs/nosolarflares.gti',(START+STOP)/2))" roicut=no evfile=/scratch/kocevski/834077/ft1_filteredMKT_4FGL_J1640.4+3945_daily_bin610.fits evtable="EVENTS" outfile="/scratch/kocevski/834077/ft1_filtered_4FGL_J1640.4+3945_daily_bin610.fits" apply_filter=yes overwrite=yes header_obstimes=yes tstart=0.0 tstop=0.0 gtifile="default" chatter=3 clobber=yes debug=no gui=no mode="ql"

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

This is gtmktime version HEAD
Applying GTI filter:
IN_SAA!=T && LIVETIME>0 && gtifilter('/nfs/farm/g/glast/g/LCRepository/Likelihood/GTIs/nogrb.gti',(START+STOP)/2) && (angsep(RA_SUN,DEC_SUN,RA_ZENITH,DEC_ZENITH)>115 || gtifilter('/nfs/farm/g/glast/g/LCRepository/Likelihood/GTIs/nosolarflares.gti',(START+STOP)/2))
real 0.50
user 0.34
sys 0.14

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/834077/ft1_filtered_4FGL_J1640.4+3945_daily_bin610.fits" evtable="EVENTS" scfile=/scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits sctable="SC_DATA" outfile=/scratch/kocevski/834077/ltcube_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.fits dcostheta=0.025 binsz=1.0 phibins=0 tmin=0.0 tmax=0.0 file_version="1" zmin=0.0 zmax=90.0 chatter=2 clobber=yes debug=no gui=no mode="ql"

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

Working on file /scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits
.....................!
real 13.03
user 12.65
sys 0.32

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/834077/ft1_filtered_4FGL_J1640.4+3945_daily_bin610.fits evtable="EVENTS" scfile=/scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits sctable="SC_DATA" expcube=/scratch/kocevski/834077/ltcube_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.fits outfile=/scratch/kocevski/834077/expmap_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.fits irfs="P8R3_SOURCE_V2" evtype="INDEF" srcrad=30.0 nlong=88 nlat=88 nenergies=10 submap=no nlongmin=0 nlongmax=0 nlatmin=0 nlatmax=0 chatter=2 clobber=yes debug=no gui=no mode="ql"

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

The exposure maps generated by this tool are meant
to be used for *unbinned* likelihood analysis only.
Do not use them for binned analyses.
Computing the ExposureMap using /scratch/kocevski/834077/ltcube_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.fits
.....................!
real 192.00
user 186.54
sys 4.93

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

Setting source of interest to:
4FGL J1640.4+3945 @ 250.119 39.7626

Creating the counts map:
time -p gtbin evfile=/scratch/kocevski/834077/ft1_filtered_4FGL_J1640.4+3945_daily_bin610.fits scfile=/scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits outfile=/scratch/kocevski/834077/cmap_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.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.119 yref=39.7626 axisrot=0.0 rafield="RA" decfield="DEC" proj="AIT" hpx_ordering_scheme="RING" hpx_order=3 hpx_ebin=yes hpx_region="" evtable="EVENTS" sctable="SC_DATA" efield="ENERGY" tfield="TIME" chatter=2 clobber=yes debug=no gui=no mode="ql"

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

This is gtbin version HEAD
real 0.56
user 0.38
sys 0.16

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/834077/ft1_filtered_4FGL_J1640.4+3945_daily_bin610.fits scfile=/scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits outfile=/scratch/kocevski/834077/cmap_HighResolution_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.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.119 yref=39.7626 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.54
user 0.37
sys 0.16

Computing the diffuse response:
time -p gtdiffrsp evfile=/scratch/kocevski/834077/ft1_filtered_4FGL_J1640.4+3945_daily_bin610.fits evtable="EVENTS" scfile=/scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits sctable="SC_DATA" srcmdl=/scratch/kocevski/834077/Model_4FGL_J1640.4+3945_daily_bin610.xml irfs="P8R3_SOURCE_V2" evclsmin=0 evclass="INDEF" evtype="INDEF" convert=yes chatter=2 clobber=yes debug=no gui=no mode="ql"

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

adding source EG_v02
adding source GAL_V02
Working on...
/scratch/kocevski/834077/ft1_filtered_4FGL_J1640.4+3945_daily_bin610.fits.....................!
real 67.59
user 66.18
sys 1.21

Creating the likelihood object...
obs = UnbinnedObs('/scratch/kocevski/834077/ft1_filtered_4FGL_J1640.4+3945_daily_bin610.fits', '/scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits', expMap='/scratch/kocevski/834077/expmap_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.fits', expCube='/scratch/kocevski/834077/ltcube_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/scratch/kocevski/834077/Model_4FGL_J1640.4+3945_daily_bin610.xml', optimizer='MINUIT')

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

4FGL J1640.4+3945
   Spectrum: PowerLaw
308    Prefactor:  1.345e+00  0.000e+00  1.000e-04  1.000e+04 ( 1.000e-12)
309        Index:  2.421e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
310        Scale:  1.366e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /scratch/kocevski/834077/ft1_filtered_4FGL_J1640.4+3945_daily_bin610.fits
Spacecraft file(s): /scratch/kocevski/834077/ft2_4FGL_J1640.4+3945_daily_bin610.fits
Exposure map: /scratch/kocevski/834077/expmap_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.fits
Exposure cube: /scratch/kocevski/834077/ltcube_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.fits
IRFs: P8R3_SOURCE_V2
Source model file: /scratch/kocevski/834077/Model_4FGL_J1640.4+3945_daily_bin610.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) = 8452.77562533

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    40.101       1.0000         .10000E-03   10000.    
     2 'Prefactor '    .10749E-03   1.0000         .10000E-03   10000.    
     3 'Prefactor '    2.5529       1.0000         .10000E-03   10000.    
     4 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
     5 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
     6 'Prefactor '    .10004E-03   1.0000         .10000E-03   10000.    
     7 'norm      '    4.3804       1.0000         .10000E-03   10000.    
     8 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
     9 'Prefactor '    2.4345       1.0000         .10000E-03   10000.    
    10 'Prefactor '    12.563       1.0000         .10000E-03   10000.    
    11 'norm      '    .11580       1.0000         .10000E-03   10000.    
    12 'Prefactor '    4.2542       1.0000         .10000E-03   10000.    
    13 'Prefactor '    .10202E-03   1.0000         .10000E-03   10000.    
    14 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
    15 'Prefactor '    .11027E-03   1.0000         .10000E-03   10000.    
    16 'norm      '    5.8534       1.0000         .10000E-03   10000.    
    17 'norm      '    .85791       1.0000         .10000E-03   10000.    
    18 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    19 'norm      '    1.1016       1.0000         .10000E-03   10000.    
    20 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
    21 'norm      '    .10486E-03   1.0000         .10000E-03   10000.    
    22 'Prefactor '    60.299       1.0000         .10000E-03   10000.    
    23 'norm      '    .13297E-03   1.0000         .10000E-03   10000.    
    24 'Prefactor '    .10006E-03   1.0000         .10000E-03   10000.    
    25 'Normalizat'    .77109       1.0000         .10000E-01   10.000    
    26 'Prefactor '    1.1182       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .6620E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   8452.680     FROM MIGRAD    STATUS=CONVERGED    674 CALLS     2812 TOTAL
                     EDM=   .52E-09  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .4%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     40.098        29.250        .84175E-05   -.14622E-04
   2  Prefactor     .10000E-03    104.37       -.11634E-05** at limit **
   3  Prefactor     2.5523        3.3773       -.51967E-06   -.85961E-03
   4  Prefactor     .10000E-03    1.8202       -.87289E-07** at limit **
   5  Prefactor     .10000E-03    9.2832        .21353E-06** at limit **
   6  Prefactor     .10000E-03    2.0587        .81663E-07** at limit **
   7  norm          4.3804        .42020       -.21897E-06   -.25785E-02
   8  norm          .10000E-03    6.1209       -.25424E-07** at limit **
   9  Prefactor     2.4250        70.946        .53906E-04   -.38239E-04
  10  Prefactor     12.564        5.6212        .46245E-06   -.25299E-03
  11  norm          .10329E-03    58.722        .59713E-06** at limit **
  12  Prefactor     4.2536        2.2382        .10522E-06   -.14250E-02
  13  Prefactor     .10000E-03    1.1606       -.44878E-07** at limit **
  14  Prefactor     .10000E-03    1.6486        .29886E-07** at limit **
  15  Prefactor     .10000E-03    1.9552        .21120E-06** at limit **
  16  norm          5.8531        2.2203       -.50851E-08   -.16545E-03
  17  norm          .85818        1.0295       -.40700E-07   -.15445E-02
  18  Prefactor     .10000E-03    5.2005        .31893E-07** at limit **
  19  norm          1.1018        .72235        .52127E-07   -.39378E-03
  20  norm          .10000E-03    2.6697        .93070E-07** at limit **
  21  norm          .10000E-03    .80203        .12411E-06** at limit **
  22  Prefactor     60.292        49.294        .10397E-04    .48014E-04
  23  norm          .10000E-03    3.2712       -.74060E-06** at limit **
  24  Prefactor     .10000E-03    52.401        .66601E-06** at limit **
  25  Normalizat    .77093        .20895       -.39107E-05   -.17170E-03
  26  Prefactor     1.1183        .15866        .27118E-06   -.28435E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 40.0978
  Prefactor  = 0.0001
  Prefactor  = 2.55232
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  norm       = 4.38041
  norm       = 0.0001
  Prefactor  = 2.42498
  Prefactor  = 12.5642
  norm       = 0.00010329
  Prefactor  = 4.25356
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  norm       = 5.8531
  norm       = 0.858175
  Prefactor  = 0.0001
  norm       = 1.10179
  norm       = 0.0001
  norm       = 0.0001
  Prefactor  = 60.2921
  norm       = 0.000100001
  Prefactor  = 0.0001
  Normalizat = 0.770925
  Prefactor  = 1.11835
 **********
 **   18 **HESSE 
 **********

 FCN=   8452.680     FROM HESSE     STATUS=OK           466 CALLS     3278 TOTAL
                     EDM=   .11E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     40.098        29.230        .63298E-04   -1.4441    
   2  Prefactor     .10000E-03    105.36        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   3  Prefactor     2.5523        3.3702        .18670E-03   -1.5388    
   4  Prefactor     .10000E-03    1.8250        .12112E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  Prefactor     .10000E-03    9.3010        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  Prefactor     .10000E-03    2.0848        .12868E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   7  norm          4.3804        .42234        .15215E-04   -1.5289    
   8  norm          .10000E-03    6.1245        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  Prefactor     2.4250        69.091        .26225E-03   -1.5397    
  10  Prefactor     12.564        5.6255        .11301E-03   -1.4999    
  11  norm          .10329E-03    48.867        .18065       -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor     4.2536        2.0426        .77564E-04   -1.5295    
  13  Prefactor     .10000E-03    1.8953        .16751E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor     .10000E-03    1.6741        .11503E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Prefactor     .10000E-03    3.5104        .24114E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  16  norm          5.8531        2.2141        .81195E-04   -1.5224    
  17  norm          .85818        .99537        .94578E-04   -1.5523    
  18  Prefactor     .10000E-03    5.2619        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  19  norm          1.1018        .71894        .60611E-04   -1.5498    
  20  norm          .10000E-03    2.6739        .14668E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  21  norm          .10000E-03    1.9930        .15912E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  22  Prefactor     60.292        48.877        .25835E-03   -1.4153    
  23  norm          .10000E-03    11.151        .31791E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  24  Prefactor     .10000E-03    52.473        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  25  Normalizat    .77093        .24715        .36615E-03   -1.0116    
  26  Prefactor     1.1183        .19068        .25115E-03   -.88882    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.07163e-09
Minuit parameter uncertainties:
  1  29.24
  2  0.000162982
  3  3.3704
  4  2.98355e-06
  5  1.24351e-05
  6  7.77446e-06
  7  0.422338
  8  2.84832e-06
  9  25.9202
  10  5.62569
  11  0.025381
  12  2.04268
  13  4.13286e-06
  14  6.86787e-06
  15  3.86726e-05
  16  2.21416
  17  0.995386
  18  2.16562e-05
  19  0.718946
  20  3.63664e-06
  21  2.87209e-05
  22  48.91
  23  0.000230483
  24  3.45859e-05
  25  0.247507
  26  0.190797
Done.

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

Extracting fit parameters...

4FGL J1640.4+3945
   Spectrum: PowerLaw
308    Prefactor:  4.254e+00  2.043e+00  1.000e-04  1.000e+04 ( 1.000e-12)
309        Index:  2.421e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
310        Scale:  1.366e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
659    Prefactor:  1.118e+00  1.908e-01  0.000e+00  1.000e+01 ( 1.000e+00)
660        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
661        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
658   Normalization:  7.709e-01  2.475e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 9.20
Ra Dec: 250.119 39.763
Photon Index (Fixed Index): 2.42 +/- 0.00
Photon Flux (Fixed Index): 1.68e-07 +/- 8.06e-08
Energy Flux (Fixed Index): 5.36e-05 +/- 2.57e-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) = 8452.5611678
delta logL = 0.118702042128

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 8452.5502755
delta logL = 0.129594341503

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    3.3125       1.0000         .10000E-03   10000.    
     2 'Index     '    2.6724       1.0000          .0000       10.000    
     3 'Normalizat'    .73419       1.0000         .10000E-01   10.000    
     4 'Prefactor '    1.1379       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .6620E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   8452.550     FROM MIGRAD    STATUS=CONVERGED     50 CALLS      241 TOTAL
                     EDM=   .12E-08    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     3.3125        14.375        .55606E-02    .17822E-02
   2  Index         2.6724        2.0419        .11363        .21148E-03
   3  Normalizat    .73420        .82776E-01    .84371E-01    .36283E-04
   4  Prefactor     1.1379        .53144E-01    .56345E-01    .48957E-05
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 3.3125
  Index      = 2.67239
  Normalizat = 0.734202
  Prefactor  = 1.13793
 **********
 **   18 **HESSE 
 **********

 FCN=   8452.550     FROM HESSE     STATUS=OK            33 CALLS      274 TOTAL
                     EDM=   .95E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     3.3125        2.8684        .62536E-04   -1.5344    
   2  Index         2.6724        .58945        .39319E-02   -.48422    
   3  Normalizat    .73420        .24710        .37367E-03   -1.0256    
   4  Prefactor     1.1379        .19421        .24912E-03   -.88263    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 9.51453e-09
Minuit parameter uncertainties:
  1  2.86856
  2  0.591207
  3  0.247479
  4  0.194332
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/834077': No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 8452.55027547
delta logL = 0.129594371778

Extracting fit parameters...

4FGL J1640.4+3945
   Spectrum: PowerLaw
308    Prefactor:  3.313e+00  2.869e+00  1.000e-04  1.000e+04 ( 1.000e-12)
309        Index:  2.672e+00  5.912e-01  0.000e+00  1.000e+01 (-1.000e+00)
310        Scale:  1.366e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
659    Prefactor:  1.138e+00  1.943e-01  0.000e+00  1.000e+01 ( 1.000e+00)
660        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
661        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
658   Normalization:  7.342e-01  2.475e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 10.53
Ra Dec: 250.119 39.763
Photon Index (Free Index): 2.67 +/- 0.59
Photon Flux (Free Index): 2.14e-07 +/- 1.24e-07
Energy Flux (Free Index): 5.28e-05 +/- 2.11e-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 /scratch/kocevski/834077/cmap_HighResolution_397440001_397699201_4FGL_J1640.4+3945_daily_bin610.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='1.68e-07', energy_flux2='5.28e-05', photon_flux_error='8.06e-08', dlogl='1.30e-01', energy_flux='5.36e-05', photon_flux2='2.14e-07', job_status='DONE', time_completed='2021-09-15 06:46:20.911778', photon_index_error2='0.59', photon_index2='2.67', ts='9.20', fit_tolerance='1e-08', GAL='1.12', photon_index_error='0.00', energy_flux_error2='2.11e-05', EG='0.77', time_epoch_completed='1631713580.91', return_code='0', job_id='834077', GAL2='1.14', EG2='0.73', return_code2='0', energy_flux_error='2.57e-05', photon_flux_error2='1.24e-07', ts2='10.53', photon_index='2.42' WHERE bin_id='610' AND source_name='4FGL J1640.4+3945' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Wed Sep 15 06:46:20 PDT 2021


------------------------------------------------------------
Sender: LSF System <lsf@bullet0228>
Subject: Job 834077: <4FGL_J1640.4+3945_daily_bin610> in cluster <slac> Done

Job <4FGL_J1640.4+3945_daily_bin610> was submitted from host <rhel6-64e> by user <kocevski> in cluster <slac> at Wed Sep 15 06:30:21 2021
Job was executed on host(s) <bullet0228>, in queue <medium>, as user <kocevski> in cluster <slac> at Wed Sep 15 06:31:52 2021
</u/ki/kocevski> was used as the home directory.
</u/ki/kocevski> was used as the working directory.
Started at Wed Sep 15 06:31:52 2021
Terminated at Wed Sep 15 06:46:21 2021
Results reported at Wed Sep 15 06:46:21 2021

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J1640.4+3945_daily_bin610 250.119 39.7626 397440001 397699201 irfs=P8R3_SOURCE_V2 zmax=90 ROI=12 association=4FGL_J1640.4+3945 fixedModel=True performFreeIndexFit=True freeVariableSources=True nuke=True repositoryJob=True verbose=False
------------------------------------------------------------

Successfully completed.

Resource usage summary:

    CPU time :                                   855.00 sec.
    Max Memory :                                 1257 MB
    Average Memory :                             297.18 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   869 sec.
    Turnaround time :                            960 sec.

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

