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


Performing analysis on: 4FGL_J0342.2+3858_weekly_bin784
RA = 55.573, Dec = 38.978
tmin = 713145601, tmax = 713750401
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='28612916', job_status='RUN', time_executed='2023-09-19 21:40:59.348766', time_epoch_executed='1695184859.35' WHERE source_name='4FGL J0342.2+3858' and cadence='weekly' and bin_id='784'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/28612916

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

Retrieving the FT1 file...

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

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

Retrieving 107 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/28612916/ft1_4FGL_J0342.2+3858_weekly_bin784.fits


Retrieving the FT1 file...

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

Retrieving 107 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/28612916/ft1_4FGL_J0342.2+3858_weekly_bin784.fits outfile=/lscratch/kocevski/28612916/ft1_filteredMKT_4FGL_J0342.2+3858_weekly_bin784.fits ra=55.573 dec=38.978 rad=12.0 tmin=713145601.0 tmax=713750401.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.08
user 3.73
sys 0.22

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.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/28612916/ft1_filteredMKT_4FGL_J0342.2+3858_weekly_bin784.fits evtable="EVENTS" outfile="/lscratch/kocevski/28612916/ft1_filtered_4FGL_J0342.2+3858_weekly_bin784.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.39
user 0.22
sys 0.14

Number of photons that the gtmktime cut: 6699

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/28612916/ft1_filtered_4FGL_J0342.2+3858_weekly_bin784.fits" evtable="EVENTS" scfile=/lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits sctable="SC_DATA" outfile=/lscratch/kocevski/28612916/ltcube_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.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/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits
.....................!
real 20.24
user 19.75
sys 0.26

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/28612916/ft1_filtered_4FGL_J0342.2+3858_weekly_bin784.fits evtable="EVENTS" scfile=/lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits sctable="SC_DATA" expcube=/lscratch/kocevski/28612916/ltcube_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.fits outfile=/lscratch/kocevski/28612916/expmap_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.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/28612916/ltcube_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.fits
.....................!
real 64.33
user 60.19
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
Extended source HB 9 in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/HB9.fits is the correct path to the extended template.
Extended source G150.3+4.5 in ROI with RadialDisk spatial model.
Added 162 point sources and 2 extended sources
If using unbinned likelihood you will need to rerun gtdiffrsp for the extended sources or rerun the makeModel function with optional argument psForce=True

Setting source of interest to:
4FGL J0342.2+3858 @ 55.573 38.978

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/28612916/ft1_filtered_4FGL_J0342.2+3858_weekly_bin784.fits scfile=/lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits outfile=/lscratch/kocevski/28612916/cmap_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.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=55.573 yref=38.978 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.48
user 0.23
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/28612916/ft1_filtered_4FGL_J0342.2+3858_weekly_bin784.fits scfile=/lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits outfile=/lscratch/kocevski/28612916/cmap_HighResolution_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.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=55.573 yref=38.978 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.40
user 0.23
sys 0.12

Computing the diffuse response:
time -p gtdiffrsp evfile=/lscratch/kocevski/28612916/ft1_filtered_4FGL_J0342.2+3858_weekly_bin784.fits evtable="EVENTS" scfile=/lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/28612916/Model_4FGL_J0342.2+3858_weekly_bin784.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 G150.3+4.5
adding source GAL_V02
adding source HB 9
Working on...
/lscratch/kocevski/28612916/ft1_filtered_4FGL_J0342.2+3858_weekly_bin784.fits.....................!
real 418.00
user 414.33
sys 0.87

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/28612916/ft1_filtered_4FGL_J0342.2+3858_weekly_bin784.fits', '/lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits', expMap='/lscratch/kocevski/28612916/expmap_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.fits', expCube='/lscratch/kocevski/28612916/ltcube_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/28612916/Model_4FGL_J0342.2+3858_weekly_bin784.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J0342.2+3858'

4FGL J0342.2+3858
   Spectrum: PowerLaw
294    Prefactor:  9.174e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-14)
295        Index:  2.257e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
296        Scale:  1.913e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/28612916/ft1_filtered_4FGL_J0342.2+3858_weekly_bin784.fits
Spacecraft file(s): /lscratch/kocevski/28612916/ft2_4FGL_J0342.2+3858_weekly_bin784.fits
Exposure map: /lscratch/kocevski/28612916/expmap_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.fits
Exposure cube: /lscratch/kocevski/28612916/ltcube_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/28612916/Model_4FGL_J0342.2+3858_weekly_bin784.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) = 64937.2563726

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .23592E-01   1.0000          .0000       .10000E+07
     2 'norm      '    4.4347       1.0000          .0000       .10000E+07
     3 'norm      '    .69454E-05   1.0000          .0000       .10000E+07
     4 'Prefactor '    10.681       1.0000          .0000       .10000E+07
     5 'norm      '    3.6723       1.0000          .0000       .10000E+07
     6 'Prefactor '    .62248       1.0000          .0000       .10000E+07
     7 'norm      '    2.4248       1.0000          .0000       .10000E+07
     8 'Prefactor '    27.618       1.0000          .0000       .10000E+07
     9 'Prefactor '    .15378E-04   1.0000          .0000       .10000E+07
    10 'norm      '    .12095E-02   1.0000          .0000       .10000E+07
    11 'Prefactor '    2.3399       1.0000          .0000       .10000E+07
    12 'Prefactor '    1.4723       1.0000          .0000       .10000E+07
    13 'norm      '    .27832E-05   1.0000          .0000       .10000E+07
    14 'Normalizat'    1.3678       1.0000         .10000E-01   10.000    
    15 'Prefactor '    .97558       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5620E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   64937.19     FROM MIGRAD    STATUS=CONVERGED    103 CALLS      854 TOTAL
                     EDM=   .42E-12  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  2.3%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor      .0000        25.473       -.15362E-06** at limit **
   2  norm          4.4359        1.6105       -.24915E-07    .36979E-03
   3  norm           .0000        4.7264        .44232E-07** at limit **
   4  Prefactor     10.680        6.2829       -.67178E-07    .20172E-03
   5  norm          3.6721        .41019        .16758E-08    .21015E-02
   6  Prefactor     .62173        .66335        .20472E-07    .12239E-03
   7  norm          2.4272        1.0252        .12332E-07   -.19273E-03
   8  Prefactor     28.181        29.294       -.67622E-07   -.13699E-04
   9  Prefactor      .0000        6.0315        .17798E-06** at limit **
  10  norm           .0000        9.4358        .41831E-06** at limit **
  11  Prefactor     2.3425        1.6942        .21058E-08   -.19573E-03
  12  Prefactor     1.4738        2.1343        .71293E-08   -.25804E-03
  13  norm           .0000        3.3639       -.28976E-07** at limit **
  14  Normalizat    1.3673        .13945       -.10184E-05   -.22604E-05
  15  Prefactor     .97559        .25132E-01    .20973E-06   -.17120E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0
  norm       = 4.43585
  norm       = 0
  Prefactor  = 10.6801
  norm       = 3.67209
  Prefactor  = 0.62173
  norm       = 2.42715
  Prefactor  = 28.1814
  Prefactor  = 0
  norm       = 0
  Prefactor  = 2.34252
  Prefactor  = 1.4738
  norm       = 0
  Normalizat = 1.36733
  Prefactor  = 0.975594
 **********
 **   18 **HESSE 
 **********

 FCN=   64937.19     FROM HESSE     STATUS=OK           220 CALLS     1074 TOTAL
                     EDM=   .42E-05    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor      .0000        24.717        .16811E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  norm          4.4359        1.6125        .47795E-03   -1.5666    
   3  norm           .0000        4.7187        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     10.680        6.2430        .30632E-03   -1.5643    
   5  norm          3.6721        .41010        .52684E-03   -1.5670    
   6  Prefactor     .62173        .67333        .67238E-03   -1.5692    
   7  norm          2.4272        1.0367        .65697E-03   -1.5677    
   8  Prefactor     28.181        29.253        .19032E-03   -1.5602    
   9  Prefactor      .0000        6.0182        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  norm           .0000        9.4403        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  Prefactor     2.3425        1.6967        .66999E-03   -1.5677    
  12  Prefactor     1.4738        2.1675        .88511E-03   -1.5684    
  13  norm           .0000        3.2157        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Normalizat    1.3673        .13304        .13699       -.81578    
  15  Prefactor     .97559        .23666E-01    .30069E-01   -.93548    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 4.19917e-06
Minuit parameter uncertainties:
  1  3.05879e-06
  2  1.61247
  3  8.67747e-07
  4  6.24302
  5  0.410098
  6  0.673331
  7  1.03668
  8  29.2531
  9  7.07498e-07
  10  7.44119e-06
  11  1.69671
  12  2.16749
  13  7.95839e-07
  14  0.133077
  15  0.0236659
Done.

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

Extracting fit parameters...

4FGL J0342.2+3858
   Spectrum: PowerLaw
294    Prefactor:  2.818e+01  2.925e+01  0.000e+00  1.000e+06 ( 1.000e-14)
295        Index:  2.257e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
296        Scale:  1.913e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
555    Prefactor:  9.756e-01  2.367e-02  0.000e+00  1.000e+01 ( 1.000e+00)
556        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
557        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
550   Normalization:  1.367e+00  1.331e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 1.33
Ra Dec: 55.573 38.978
Photon Index (Fixed Index): 2.26 +/- 0.00
Photon Flux (Fixed Index): 1.75e-08 +/- 1.82e-08
Energy Flux (Fixed Index): 7.12e-06 +/- 7.39e-06

TS (Fixed Index): 1.33
Ra Dec: 55.573 38.978
Photon Flux Upper Limit: 5.73924249485e-08 ph cm-2 s-1
Energy Flux Upper Limit: 0.00439107204583 MeV cm-2 s-1

Saving results to:
/lscratch/kocevski/28612916/likelihoodResults_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.txt

Performing a free index iterative likelihood fit...

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

Done.

Freeing candidate source...
Done.

Fit tolerance = 1

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 64936.8544174
delta logL = 0.336459151084

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 102
logL (Free Index) = 64936.8447297
delta logL = 0.34614686374

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .65780       1.0000          .0000       .10000E+07
     2 'Index     '    4.2164       1.0000          .0000       10.000    
     3 'Normalizat'    1.3276       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .97944       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5620E+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.
 MIGRAD TERMINATED WITHOUT CONVERGENCE.

 FCN=   64936.84     FROM MIGRAD    STATUS=FAILED       103 CALLS      391 TOTAL
                     EDM=   .22E-04    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .64688        16.427        .14217E-04   -.26229E-01
   2  Index         4.2225        3.4156        .85403E-02    .57982E-02
   3  Normalizat    1.3277        .10493        .61582E-03   -.79825E-03
   4  Prefactor     .97944        .19388E-01    .13264E-03   -.31132E-02
                               ERR DEF=  .500    
 START SIMPLEX MINIMIZATION.    CONVERGENCE WHEN EDM .LT.   .20E-04
 SIMPLEX MINIMIZATION HAS CONVERGED.

 FCN=   64936.84     FROM SIMPLEX   STATUS=UNCHANGED     84 CALLS      475 TOTAL
                     EDM=   .63E-05    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .64688        16.427        .10492E-04   -.26229E-01
   2  Index         4.2225        3.4156        .10513E-02    .57982E-02
   3  Normalizat    1.3277        .10493        .89955E-04   -.79825E-03
   4  Prefactor     .97944        .19388E-01    .15540E-04   -.31132E-02
                               ERR DEF=  .500    

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   64936.84     FROM MIGRAD    STATUS=CONVERGED     29 CALLS      504 TOTAL
                     EDM=   .68E-10    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .64695        17.218        .56868E-06   -.88488E-02
   2  Index         4.2225        3.4824        .17081E-02   -.98933E-04
   3  Normalizat    1.3277        .12749        .24633E-04   -.25255E-03
   4  Prefactor     .97944        .23669E-01    .26529E-04   -.91742E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.646946
  Index      = 4.22248
  Normalizat = 1.32767
  Prefactor  = 0.979443
 **********
 **   18 **HESSE 
 **********

 FCN=   64936.84     FROM HESSE     STATUS=OK            25 CALLS      529 TOTAL
                     EDM=   .14E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .64695        10.349        .37412E-06   -1.5692    
   2  Index         4.2225        2.8143        .68323E-04   -.15614    
   3  Normalizat    1.3277        .13405        .49266E-05   -.82744    
   4  Prefactor     .97944        .24805E-01    .53058E-05   -.93418    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.44645e-10
Minuit parameter uncertainties:
  1  5.17508
  2  2.9944
  3  0.13408
  4  0.024805
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) = 64936.8447263
delta logL = 0.346150313671

Extracting fit parameters...

4FGL J0342.2+3858
   Spectrum: PowerLaw
294    Prefactor:  6.469e-01  5.175e+00  0.000e+00  1.000e+06 ( 1.000e-14)
295        Index:  4.222e+00  2.994e+00  0.000e+00  1.000e+01 (-1.000e+00)
296        Scale:  1.913e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
555    Prefactor:  9.794e-01  2.480e-02  0.000e+00  1.000e+01 ( 1.000e+00)
556        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
557        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
550   Normalization:  1.328e+00  1.341e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 2.16
Ra Dec: 55.573 38.978
Photon Index (Free Index): 4.22 +/- 2.99
Photon Flux (Free Index): 5.20e-08 +/- 3.88e-08
Energy Flux (Free Index): 7.53e-06 +/- 6.65e-06

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/28612916/cmap_HighResolution_713145601_713750401_4FGL_J0342.2+3858_weekly_bin784.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='4.39e-03', comment='SUCCESS', photon_flux='1.75e-08', energy_flux2='7.53e-06', photon_flux_error='1.82e-08', dlogl='3.46e-01', energy_flux='7.12e-06', photon_flux2='5.20e-08', job_status='DONE', time_completed='2023-09-19 22:01:49.923558', photon_index_error2='2.99', photon_index2='4.22', ts='1.33', fit_tolerance='1e-08', GAL='0.98', photon_index_error='0.00', photon_flux_upper_limit='5.74e-08', energy_flux_error2='6.65e-06', EG='1.37', time_epoch_completed='1695186109.92', return_code='0', job_id='28612916', GAL2='0.98', EG2='1.33', return_code2='0', energy_flux_error='7.39e-06', photon_flux_error2='3.88e-08', ts2='2.16', photon_index='2.26' WHERE bin_id='784' AND source_name='4FGL J0342.2+3858' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Sep 19 22:01:50 PDT 2023

