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


Performing analysis on: 4FGL_J2040.5-1705_daily_bin1641
RA = 310.136, Dec = -17.0901
tmin = 664675201, tmax = 664934401
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='373780', job_status='RUN', time_executed='2022-01-27 00:40:56.113710', time_epoch_executed='1643272856.11' WHERE source_name='4FGL J2040.5-1705' and cadence='daily' and bin_id='1641'

Database successfully updated.
Done.

Creating custom output directory:
/scratch/kocevski/373780

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

Retrieving the FT1 file...

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

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

Retrieving 48 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/scratch/kocevski/373780/ft1_4FGL_J2040.5-1705_daily_bin1641.fits


Retrieving the FT1 file...

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

Retrieving 48 files...
Done.


Merging files...

Merged file saved to:
/scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits


Selecting the photons:
time -p gtselect infile=/scratch/kocevski/373780/ft1_4FGL_J2040.5-1705_daily_bin1641.fits outfile=/scratch/kocevski/373780/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin1641.fits ra=310.136 dec=-17.0901 rad=12.0 tmin=664675201.0 tmax=664934401.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 3.70
user 3.46
sys 0.21

Adding sun position to ft2 file:
/nfs/farm/g/glast/g/LCRepository/Repository/bin/sunpos /scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits

Selecting the good time intervals:
time -p gtmktime scfile=/scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.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/373780/ft1_filteredMKT_4FGL_J2040.5-1705_daily_bin1641.fits evtable="EVENTS" outfile="/scratch/kocevski/373780/ft1_filtered_4FGL_J2040.5-1705_daily_bin1641.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.33
sys 0.15

Generating the livetime cube:
time -p gtltcube evfile="/scratch/kocevski/373780/ft1_filtered_4FGL_J2040.5-1705_daily_bin1641.fits" evtable="EVENTS" scfile=/scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits sctable="SC_DATA" outfile=/scratch/kocevski/373780/ltcube_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.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/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits
.....................!
real 12.12
user 11.76
sys 0.32

Generating the exposure map:
time -p gtexpmap evfile=/scratch/kocevski/373780/ft1_filtered_4FGL_J2040.5-1705_daily_bin1641.fits evtable="EVENTS" scfile=/scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits sctable="SC_DATA" expcube=/scratch/kocevski/373780/ltcube_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.fits outfile=/scratch/kocevski/373780/expmap_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.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/373780/ltcube_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.fits
.....................!
real 189.51
user 185.22
sys 3.92

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=/scratch/kocevski/373780/ft1_filtered_4FGL_J2040.5-1705_daily_bin1641.fits scfile=/scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits outfile=/scratch/kocevski/373780/cmap_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.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.54
user 0.39
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/scratch/kocevski/373780/ft1_filtered_4FGL_J2040.5-1705_daily_bin1641.fits scfile=/scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits outfile=/scratch/kocevski/373780/cmap_HighResolution_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.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.54
user 0.39
sys 0.15

Computing the diffuse response:
time -p gtdiffrsp evfile=/scratch/kocevski/373780/ft1_filtered_4FGL_J2040.5-1705_daily_bin1641.fits evtable="EVENTS" scfile=/scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits sctable="SC_DATA" srcmdl=/scratch/kocevski/373780/Model_4FGL_J2040.5-1705_daily_bin1641.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/373780/ft1_filtered_4FGL_J2040.5-1705_daily_bin1641.fits.....................!
real 67.92
user 66.59
sys 1.16

Creating the likelihood object...
obs = UnbinnedObs('/scratch/kocevski/373780/ft1_filtered_4FGL_J2040.5-1705_daily_bin1641.fits', '/scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits', expMap='/scratch/kocevski/373780/expmap_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.fits', expCube='/scratch/kocevski/373780/ltcube_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/scratch/kocevski/373780/Model_4FGL_J2040.5-1705_daily_bin1641.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  1.000e-04  1.000e+04 ( 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): /scratch/kocevski/373780/ft1_filtered_4FGL_J2040.5-1705_daily_bin1641.fits
Spacecraft file(s): /scratch/kocevski/373780/ft2_4FGL_J2040.5-1705_daily_bin1641.fits
Exposure map: /scratch/kocevski/373780/expmap_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.fits
Exposure cube: /scratch/kocevski/373780/ltcube_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.fits
IRFs: P8R3_SOURCE_V2
Source model file: /scratch/kocevski/373780/Model_4FGL_J2040.5-1705_daily_bin1641.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) = 7412.90276721

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
     2 'Prefactor '    .10003E-03   1.0000         .10000E-03   10000.    
     3 'Prefactor '    2.0377       1.0000         .10000E-03   10000.    
     4 'Prefactor '    3.3858       1.0000         .10000E-03   10000.    
     5 'norm      '    18.022       1.0000         .10000E-03   10000.    
     6 'norm      '    19.014       1.0000         .10000E-03   10000.    
     7 'Prefactor '    .10049E-03   1.0000         .10000E-03   10000.    
     8 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
     9 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
    10 'norm      '    .10000E-03   1.0000         .10000E-03   10000.    
    11 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    12 'Prefactor '    1.8936       1.0000         .10000E-03   10000.    
    13 'norm      '    .21500E-01   1.0000         .10000E-03   10000.    
    14 'Prefactor '    13.697       1.0000         .10000E-03   10000.    
    15 'Prefactor '    37.243       1.0000         .10000E-03   10000.    
    16 'norm      '    58.683       1.0000         .10000E-03   10000.    
    17 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
    18 'Prefactor '    .10086E-03   1.0000         .10000E-03   10000.    
    19 'Prefactor '    .10001E-03   1.0000         .10000E-03   10000.    
    20 'Prefactor '    .10000E-03   1.0000         .10000E-03   10000.    
    21 'Normalizat'    .73168       1.0000         .10000E-01   10.000    
    22 'Prefactor '    1.3418       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.

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   7412.899     FROM MIGRAD    STATUS=CONVERGED    476 CALLS     2371 TOTAL
                     EDM=   .95E-11  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  5.8%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .10000E-03    11.087        .14413E-06** at limit **
   2  Prefactor     .10000E-03    26.083       -.35581E-06** at limit **
   3  Prefactor     2.0378        2.1991       -.25819E-07    .21227E-04
   4  Prefactor     3.3797        40.930        .95801E-06    .10298E-04
   5  norm          18.020        21.839       -.21300E-06    .68636E-05
   6  norm          19.008        16.228       -.52430E-06    .71008E-05
   7  Prefactor     .10000E-03    107.03       -.11173E-04** at limit **
   8  norm          .10000E-03    8.3964       -.22092E-06** at limit **
   9  norm          .10000E-03    11.126        .11605E-06** at limit **
  10  norm          .10000E-03    .30246        .24860E-07** at limit **
  11  Prefactor     .10000E-03    8.0036       -.43938E-07** at limit **
  12  Prefactor     1.8959        19.989        .65535E-05    .60956E-05
  13  norm          .10000E-03    85.295        .84537E-05** at limit **
  14  Prefactor     13.697        7.6411        .67238E-07    .20354E-04
  15  Prefactor     37.129        100.90       -.11591E-04   -.83719E-07
  16  norm          58.691        39.831        .26459E-06    .71202E-05
  17  Prefactor     .10000E-03    5.9256        .45946E-07** at limit **
  18  Prefactor     .10000E-03    7.6630       -.13116E-05** at limit **
  19  Prefactor     .10000E-03    11.252       -.40020E-07** at limit **
  20  Prefactor     .10000E-03    5.1871        .35279E-07** at limit **
  21  Normalizat    .73157        .32987       -.20195E-05    .27319E-04
  22  Prefactor     1.3418        .13867        .38314E-06   -.61749E-05
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 2.03781
  Prefactor  = 3.3797
  norm       = 18.0198
  norm       = 19.0081
  Prefactor  = 0.0001
  norm       = 0.0001
  norm       = 0.0001
  norm       = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 1.89587
  norm       = 0.0001
  Prefactor  = 13.6968
  Prefactor  = 37.1294
  norm       = 58.6912
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Prefactor  = 0.0001
  Normalizat = 0.73157
  Prefactor  = 1.34185
 **********
 **   18 **HESSE 
 **********

 FCN=   7412.899     FROM HESSE     STATUS=OK           346 CALLS     2717 TOTAL
                     EDM=   .18E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .10000E-03    11.092        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Prefactor     .10000E-03    26.119        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   3  Prefactor     2.0378        2.1431        .11503E-03   -1.5422    
   4  Prefactor     3.3797        38.498        .21989E-03   -1.5340    
   5  norm          18.020        21.874        .94345E-04   -1.4859    
   6  norm          19.008        16.075        .91853E-04   -1.4836    
   7  Prefactor     .10000E-03    107.24        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  norm          .10000E-03    8.4339        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  norm          .10000E-03    11.130        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  norm          .10000E-03    .30471        .46233E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  Prefactor     .10000E-03    8.0286        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor     1.8959        20.113        .15117E-02   -1.5433    
  13  norm          .10000E-03    5.1802        .49289E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor     13.697        7.6231        .10823E-03   -1.4968    
  15  Prefactor     37.129        101.06        .65673E-04   -1.4489    
  16  norm          58.691        39.843        .52372E-04   -1.4174    
  17  Prefactor     .10000E-03    5.9385        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  18  Prefactor     .10000E-03    7.7424        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  19  Prefactor     .10000E-03    11.279        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  20  Prefactor     .10000E-03    5.1940        .18142E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  21  Normalizat    .73157        .35172        .52288E-03   -1.0266    
  22  Prefactor     1.3418        .15150        .17092E-03   -.82071    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.84258e-11
Minuit parameter uncertainties:
  1  4.30904e-07
  2  8.79367e-07
  3  2.14323
  4  22.8316
  5  21.8833
  6  16.0786
  7  9.034e-05
  8  2.03635e-06
  9  3.80548e-07
  10  1.48685e-08
  11  5.91288e-07
  12  12.3552
  13  3.56434e-07
  14  7.62363
  15  101.529
  16  39.8615
  17  4.60092e-07
  18  9.04333e-06
  19  2.49422e-07
  20  3.83561e-07
  21  0.352811
  22  0.151546
Done.

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

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  1.370e+01  7.624e+00  1.000e-04  1.000e+04 ( 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:  1.342e+00  1.515e-01  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:  7.316e-01  3.528e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 4.74
Ra Dec: 310.136 -17.090
Photon Index (Fixed Index): 2.54 +/- 0.00
Photon Flux (Fixed Index): 1.60e-07 +/- 8.92e-08
Energy Flux (Fixed Index): 4.46e-05 +/- 2.48e-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) = 7412.81958863
delta logL = 0.0798032508637

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 7412.81491802
delta logL = 0.0844738610522

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    11.105       1.0000         .10000E-03   10000.    
     2 'Index     '    2.7576       1.0000          .0000       10.000    
     3 'Normalizat'    .70573       1.0000         .10000E-01   10.000    
     4 'Prefactor '    1.3507       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.
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   7412.815     FROM MIGRAD    STATUS=CONVERGED    100 CALLS      304 TOTAL
                     EDM=   .41E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     11.110        10.345        .60110E-03    .16855E-03
   2  Index         2.7575        .62114        .55008E-02    .49083E-03
   3  Normalizat    .70630        .35243        .53141E-03   -.31448E-05
   4  Prefactor     1.3503        .14950        .17046E-03   -.86703E-05
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 11.1101
  Index      = 2.75751
  Normalizat = 0.706301
  Prefactor  = 1.35029
 **********
 **   18 **HESSE 
 **********

 FCN=   7412.815     FROM HESSE     STATUS=OK            27 CALLS      331 TOTAL
                     EDM=   .63E-11    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     11.110        9.4257        .12022E-03   -1.5041    
   2  Index         2.7575        .56567        .11002E-02   -.46508    
   3  Normalizat    .70630        .35227        .21257E-04   -1.0364    
   4  Prefactor     1.3503        .14931        .68184E-05   -.81824    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 6.25916e-12
Minuit parameter uncertainties:
  1  9.42697
  2  0.567193
  3  0.353408
  4  0.149359
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
rmdir: failed to remove `/scratch/kocevski/373780': 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) = 7412.81491194
delta logL = 0.0844799482147

Extracting fit parameters...

4FGL J2040.5-1705
   Spectrum: PowerLaw
323    Prefactor:  1.111e+01  9.427e+00  1.000e-04  1.000e+04 ( 1.000e-12)
324        Index:  2.758e+00  5.672e-01  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:  1.350e+00  1.494e-01  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:  7.063e-01  3.534e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 4.95
Ra Dec: 310.136 -17.090
Photon Index (Free Index): 2.76 +/- 0.57
Photon Flux (Free Index): 1.78e-07 +/- 1.02e-07
Energy Flux (Free Index): 4.10e-05 +/- 2.40e-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/373780/cmap_HighResolution_664675201_664934401_4FGL_J2040.5-1705_daily_bin1641.png

Cleaning up...

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

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='1.60e-07', energy_flux2='4.10e-05', photon_flux_error='8.92e-08', dlogl='8.45e-02', energy_flux='4.46e-05', photon_flux2='1.78e-07', job_status='DONE', time_completed='2022-01-27 00:51:35.895040', photon_index_error2='0.57', photon_index2='2.76', ts='4.74', fit_tolerance='1e-08', GAL='1.34', photon_index_error='0.00', energy_flux_error2='2.40e-05', EG='0.73', time_epoch_completed='1643273495.9', return_code='0', job_id='373780', GAL2='1.35', EG2='0.71', return_code2='0', energy_flux_error='2.48e-05', photon_flux_error2='1.02e-07', ts2='4.95', photon_index='2.54' WHERE bin_id='1641' AND source_name='4FGL J2040.5-1705' AND cadence='daily';

Database successfully updated.


Analysis Complete.


Thu Jan 27 00:51:35 PST 2022


------------------------------------------------------------
Sender: LSF System <lsf@bullet0234>
Subject: Job 373780: <4FGL_J2040.5-1705_daily_bin1641> in cluster <slac> Done

Job <4FGL_J2040.5-1705_daily_bin1641> was submitted from host <rhel6-64k> by user <kocevski> in cluster <slac> at Thu Jan 27 00:40:21 2022
Job was executed on host(s) <bullet0234>, in queue <medium>, as user <kocevski> in cluster <slac> at Thu Jan 27 00:40:22 2022
</u/ki/kocevski> was used as the home directory.
</u/ki/kocevski> was used as the working directory.
Started at Thu Jan 27 00:40:22 2022
Terminated at Thu Jan 27 00:51:36 2022
Results reported at Thu Jan 27 00:51:36 2022

Your job looked like:

------------------------------------------------------------
# LSBATCH: User input
/nfs/farm/g/glast/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py 4FGL_J2040.5-1705_daily_bin1641 310.136 -17.0901 664675201 664934401 irfs=P8R3_SOURCE_V2 zmax=90 ROI=12 association=4FGL_J2040.5-1705 fixedModel=True performFreeIndexFit=True freeVariableSources=True nuke=True repositoryJob=True verbose=False
------------------------------------------------------------

Successfully completed.

Resource usage summary:

    CPU time :                                   642.00 sec.
    Max Memory :                                 1232 MB
    Average Memory :                             314.20 MB
    Total Requested Memory :                     -
    Delta Memory :                               -
    Max Swap :                                   -
    Max Processes :                              5
    Max Threads :                                21
    Run time :                                   674 sec.
    Turnaround time :                            675 sec.

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

