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


Performing analysis on: 4FGL_J0331.9+6307_weekly_bin785
RA = 52.9909, Dec = 63.1309
tmin = 713750401, tmax = 714355201
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='28612729', job_status='RUN', time_executed='2023-09-19 21:35:59.007459', time_epoch_executed='1695184559.01' WHERE source_name='4FGL J0331.9+6307' and cadence='weekly' and bin_id='785'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/28612729

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

Retrieving the FT1 file...

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

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

Retrieving 108 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/28612729/ft1_4FGL_J0331.9+6307_weekly_bin785.fits


Retrieving the FT1 file...

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

Retrieving 108 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/28612729/ft1_4FGL_J0331.9+6307_weekly_bin785.fits outfile=/lscratch/kocevski/28612729/ft1_filteredMKT_4FGL_J0331.9+6307_weekly_bin785.fits ra=52.9909 dec=63.1309 rad=12.0 tmin=713750401.0 tmax=714355201.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.93
user 4.60
sys 0.26

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.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/28612729/ft1_filteredMKT_4FGL_J0331.9+6307_weekly_bin785.fits evtable="EVENTS" outfile="/lscratch/kocevski/28612729/ft1_filtered_4FGL_J0331.9+6307_weekly_bin785.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.40
user 0.23
sys 0.13

Number of photons that the gtmktime cut: 8504

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/28612729/ft1_filtered_4FGL_J0331.9+6307_weekly_bin785.fits" evtable="EVENTS" scfile=/lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits sctable="SC_DATA" outfile=/lscratch/kocevski/28612729/ltcube_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.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/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits
.....................!
real 18.51
user 18.04
sys 0.26

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/28612729/ft1_filtered_4FGL_J0331.9+6307_weekly_bin785.fits evtable="EVENTS" scfile=/lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits sctable="SC_DATA" expcube=/lscratch/kocevski/28612729/ltcube_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.fits outfile=/lscratch/kocevski/28612729/expmap_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.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/28612729/ltcube_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.fits
.....................!
real 64.27
user 60.19
sys 3.65

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 3 in ROI with RadialDisk spatial model.
Extended source W 3 in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/W3.fits is the correct path to the extended template.
Extended source G150.3+4.5 in ROI with RadialDisk spatial model.
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.
Added 184 point sources and 4 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 J0331.9+6307 @ 52.9909 63.1309

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/28612729/ft1_filtered_4FGL_J0331.9+6307_weekly_bin785.fits scfile=/lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits outfile=/lscratch/kocevski/28612729/cmap_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.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=52.9909 yref=63.1309 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.41
user 0.24
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/28612729/ft1_filtered_4FGL_J0331.9+6307_weekly_bin785.fits scfile=/lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits outfile=/lscratch/kocevski/28612729/cmap_HighResolution_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.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=52.9909 yref=63.1309 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.13

Computing the diffuse response:
time -p gtdiffrsp evfile=/lscratch/kocevski/28612729/ft1_filtered_4FGL_J0331.9+6307_weekly_bin785.fits evtable="EVENTS" scfile=/lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/28612729/Model_4FGL_J0331.9+6307_weekly_bin785.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 3
adding source HB 9
adding source W 3
Working on...
/lscratch/kocevski/28612729/ft1_filtered_4FGL_J0331.9+6307_weekly_bin785.fits.....................!
real 486.76
user 482.55
sys 1.08

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/28612729/ft1_filtered_4FGL_J0331.9+6307_weekly_bin785.fits', '/lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits', expMap='/lscratch/kocevski/28612729/expmap_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.fits', expCube='/lscratch/kocevski/28612729/ltcube_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/28612729/Model_4FGL_J0331.9+6307_weekly_bin785.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J0331.9+6307'

4FGL J0331.9+6307
   Spectrum: PowerLaw
358    Prefactor:  1.283e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-13)
359        Index:  2.090e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
360        Scale:  2.866e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/28612729/ft1_filtered_4FGL_J0331.9+6307_weekly_bin785.fits
Spacecraft file(s): /lscratch/kocevski/28612729/ft2_4FGL_J0331.9+6307_weekly_bin785.fits
Exposure map: /lscratch/kocevski/28612729/expmap_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.fits
Exposure cube: /lscratch/kocevski/28612729/ltcube_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/28612729/Model_4FGL_J0331.9+6307_weekly_bin785.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) = 78648.6112797

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    1.7358       1.0000         .10000E-03   10000.    
     2 'norm      '    6.0496       1.0000          .0000       .10000E+07
     3 'norm      '    .21451E-04   1.0000          .0000       .10000E+07
     4 'norm      '    .24088E-05   1.0000          .0000       .10000E+07
     5 'Prefactor '    .24869E-02   1.0000          .0000       .10000E+07
     6 'Prefactor '    3.2352       1.0000          .0000       .10000E+07
     7 'Prefactor '    .11630E-06   1.0000          .0000       .10000E+07
     8 'Prefactor '    .65243       1.0000          .0000       .10000E+07
     9 'Prefactor '    10.075       1.0000          .0000       .10000E+07
    10 'norm      '    .12534E-05   1.0000          .0000       .10000E+07
    11 'norm      '    1.8339       1.0000          .0000       .10000E+07
    12 'Prefactor '    .75513E-05   1.0000          .0000       .10000E+07
    13 'Normalizat'    1.4341       1.0000         .10000E-01   10.000    
    14 'Prefactor '    .98552       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .6410E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   78648.58     FROM MIGRAD    STATUS=CONVERGED    113 CALLS      764 TOTAL
                     EDM=   .77E-12  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  1.3%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     1.7356        .63352        .69178E-07    .34018E-04
   2  norm          6.0491        .46851        .94145E-09   -.11437E-03
   3  norm           .0000        3.4465       -.45974E-07** at limit **
   4  norm           .0000        .85093        .38418E-07** at limit **
   5  Prefactor      .0000        9.3177       -.28041E-06** at limit **
   6  Prefactor     3.2369        3.1135       -.40000E-07    .28994E-03
   7  Prefactor      .0000        .33963        .17676E-07** at limit **
   8  Prefactor      .0000        394.27        .90633E-06** at limit **
   9  Prefactor     9.9575        16.002       -.22860E-07   -.85630E-05
  10  norm           .0000        3.5435       -.22780E-07** at limit **
  11  norm          1.6563        18.491        .78433E-07    .11336E-04
  12  Prefactor      .0000        2.3802        .37670E-07** at limit **
  13  Normalizat    1.4345        .18350        .71406E-06    .36580E-05
  14  Prefactor     .98560        .20604E-01   -.14578E-06    .76292E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 1.73556
  norm       = 6.04908
  norm       = 0
  norm       = 0
  Prefactor  = 0
  Prefactor  = 3.23686
  Prefactor  = 0
  Prefactor  = 0
  Prefactor  = 9.95751
  norm       = 0
  norm       = 1.65627
  Prefactor  = 0
  Normalizat = 1.43448
  Prefactor  = 0.985599
 **********
 **   18 **HESSE 
 **********

 FCN=   78648.58     FROM HESSE     STATUS=OK           198 CALLS      962 TOTAL
                     EDM=   .49E-08    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     1.7356        .63860        .79632E-02   -1.5444    
   2  norm          6.0491        .47030        .40798E-03   -1.5659    
   3  norm           .0000        3.4576        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  norm           .0000        .85100        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  Prefactor      .0000        9.3420        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   6  Prefactor     3.2369        3.1252        .56291E-03   -1.5672    
   7  Prefactor      .0000        .34091        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  Prefactor      .0000        5.8439        .16634E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   9  Prefactor     9.9575        16.040        .31545E-03   -1.5645    
  10  norm           .0000        3.5450        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  norm          1.6563        18.314        .77024E-03   -1.5682    
  12  Prefactor      .0000        2.3840        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  13  Normalizat    1.4345        .18187        .20971       -.79637    
  14  Prefactor     .98560        .20089E-01    .27486E-01   -.93211    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 4.91976e-09
Minuit parameter uncertainties:
  1  0.638605
  2  0.470299
  3  2.09397e-06
  4  7.22448e-07
  5  1.55812e-05
  6  3.12522
  7  9.68933e-08
  8  5.42126e-06
  9  16.0398
  10  9.71494e-07
  11  11.015
  12  1.06573e-06
  13  0.181956
  14  0.0200895
Done.

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

Extracting fit parameters...

4FGL J0331.9+6307
   Spectrum: PowerLaw
358    Prefactor:  3.237e+00  3.125e+00  0.000e+00  1.000e+06 ( 1.000e-13)
359        Index:  2.090e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
360        Scale:  2.866e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
626    Prefactor:  9.856e-01  2.009e-02  0.000e+00  1.000e+01 ( 1.000e+00)
627        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
628        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
621   Normalization:  1.434e+00  1.820e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 1.41
Ra Dec: 52.991 63.131
Photon Index (Fixed Index): 2.09 +/- 0.00
Photon Flux (Fixed Index): 3.30e-08 +/- 3.18e-08
Energy Flux (Fixed Index): 1.85e-05 +/- 1.79e-05

TS (Fixed Index): 1.41
Ra Dec: 52.991 63.131
Photon Flux Upper Limit: 9.83114060384e-08 ph cm-2 s-1
Energy Flux Upper Limit: 0.00742746813344 MeV cm-2 s-1

Saving results to:
/lscratch/kocevski/28612729/likelihoodResults_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.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) = 78647.9923038
delta logL = 0.585941023353

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 78647.0130586
delta logL = 1.56518619187

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    .13053       1.0000          .0000       .10000E+07
     2 'Index     '    .98918E-06   1.0000          .0000       10.000    
     3 'Normalizat'    1.4397       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .98720       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .6410E+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=   78647.01     FROM MIGRAD    STATUS=CONVERGED    109 CALLS      345 TOTAL
                     EDM=   .51E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     .13052        .16400        .15001E-03** at limit **
   2  Index         .30695E-09    .53309        .50000    ** at limit **
   3  Normalizat    1.4396        .18189        .93435E-03    .16548E-04
   4  Prefactor     .98721        .20353E-01    .12138E-03    .32969E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 0.130519
  Index      = 3.06954e-10
  Normalizat = 1.43958
  Prefactor  = 0.987207
 **********
 **   18 **HESSE 
 **********

 FCN=   78647.01     FROM HESSE     STATUS=OK            31 CALLS      376 TOTAL
                     EDM=   .12E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     .13052        .15483        .60004E-05   -1.5701    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   2  Index         .30695E-09    .47257        .50000       -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   3  Normalizat    1.4396        .18192        .37374E-04   -.79491    
   4  Prefactor     .98721        .20356E-01    .48552E-05   -.93157    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.19473e-11
Minuit parameter uncertainties:
  1  0.154829
  2  2.42819e-05
  3  0.182
  4  0.0203561
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) = 78647.0130581
delta logL = 1.56518669923

Extracting fit parameters...

4FGL J0331.9+6307
   Spectrum: PowerLaw
358    Prefactor:  1.305e-01  1.548e-01  0.000e+00  1.000e+06 ( 1.000e-13)
359        Index:  3.070e-10  2.428e-05  0.000e+00  1.000e+01 (-1.000e+00)
360        Scale:  2.866e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
626    Prefactor:  9.872e-01  2.036e-02  0.000e+00  1.000e+01 ( 1.000e+00)
627        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
628        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
621   Normalization:  1.440e+00  1.820e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 4.53
Ra Dec: 52.991 63.131
Photon Index (Free Index): 0.00 +/- 0.00
Photon Flux (Free Index): 1.30e-09 +/- 1.55e-09
Energy Flux (Free Index): 6.54e-05 +/- 7.74e-05

Creating a high resolution counts map...
INFO: Auto-setting vmin to -2.000e-01 [aplpy.core]
INFO: Auto-setting vmax to  2.220e+00 [aplpy.core]
Saving /lscratch/kocevski/28612729/cmap_HighResolution_713750401_714355201_4FGL_J0331.9+6307_weekly_bin785.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='7.43e-03', comment='SUCCESS', photon_flux='3.30e-08', energy_flux2='6.54e-05', photon_flux_error='3.18e-08', dlogl='1.57e+00', energy_flux='1.85e-05', photon_flux2='1.30e-09', job_status='DONE', time_completed='2023-09-19 22:01:05.510233', photon_index_error2='0.00', photon_index2='0.00', ts='1.41', fit_tolerance='1e-08', GAL='0.99', photon_index_error='0.00', photon_flux_upper_limit='9.83e-08', energy_flux_error2='7.74e-05', EG='1.43', time_epoch_completed='1695186065.51', return_code='0', job_id='28612729', GAL2='0.99', EG2='1.44', return_code2='0', energy_flux_error='1.79e-05', photon_flux_error2='1.55e-09', ts2='4.53', photon_index='2.09' WHERE bin_id='785' AND source_name='4FGL J0331.9+6307' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Sep 19 22:01:05 PDT 2023

