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


Performing analysis on: 4FGL_J0509.4+0542_weekly_bin802
RA = 77.3593, Dec = 5.7014
tmin = 724032001, tmax = 724636801
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='36604960', job_status='RUN', time_executed='2023-12-19 00:10:57.598075', time_epoch_executed='1702973457.6' WHERE source_name='4FGL J0509.4+0542' and cadence='weekly' and bin_id='802'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/36604960

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

Retrieving the FT1 file...

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

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

Retrieving 107 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/36604960/ft1_4FGL_J0509.4+0542_weekly_bin802.fits


Retrieving the FT1 file...

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

Retrieving 107 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/36604960/ft1_4FGL_J0509.4+0542_weekly_bin802.fits outfile=/lscratch/kocevski/36604960/ft1_filteredMKT_4FGL_J0509.4+0542_weekly_bin802.fits ra=77.3593 dec=5.7014 rad=12.0 tmin=724032001.0 tmax=724636801.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.90
user 3.63
sys 0.22

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.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/36604960/ft1_filteredMKT_4FGL_J0509.4+0542_weekly_bin802.fits evtable="EVENTS" outfile="/lscratch/kocevski/36604960/ft1_filtered_4FGL_J0509.4+0542_weekly_bin802.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.18
sys 0.13

Number of photons that the gtmktime cut: 3252

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/36604960/ft1_filtered_4FGL_J0509.4+0542_weekly_bin802.fits" evtable="EVENTS" scfile=/lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits sctable="SC_DATA" outfile=/lscratch/kocevski/36604960/ltcube_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.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/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits
.....................!
real 25.66
user 25.22
sys 0.23

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/36604960/ft1_filtered_4FGL_J0509.4+0542_weekly_bin802.fits evtable="EVENTS" scfile=/lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits sctable="SC_DATA" expcube=/lscratch/kocevski/36604960/ltcube_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.fits outfile=/lscratch/kocevski/36604960/expmap_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.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/36604960/ltcube_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.fits
.....................!
real 62.79
user 59.03
sys 3.49

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 Rosette in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/Rosette.fits is the correct path to the extended template.
Added 147 point sources and 1 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 J0509.4+0542 @ 77.3593 5.7014

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/36604960/ft1_filtered_4FGL_J0509.4+0542_weekly_bin802.fits scfile=/lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits outfile=/lscratch/kocevski/36604960/cmap_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.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=77.3593 yref=5.7014 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.21
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/36604960/ft1_filtered_4FGL_J0509.4+0542_weekly_bin802.fits scfile=/lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits outfile=/lscratch/kocevski/36604960/cmap_HighResolution_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.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=77.3593 yref=5.7014 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.38
user 0.22
sys 0.12

Computing the diffuse response:
time -p gtdiffrsp evfile=/lscratch/kocevski/36604960/ft1_filtered_4FGL_J0509.4+0542_weekly_bin802.fits evtable="EVENTS" scfile=/lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/36604960/Model_4FGL_J0509.4+0542_weekly_bin802.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
adding source Rosette
Working on...
/lscratch/kocevski/36604960/ft1_filtered_4FGL_J0509.4+0542_weekly_bin802.fits.....................!
real 223.68
user 222.20
sys 0.61

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/36604960/ft1_filtered_4FGL_J0509.4+0542_weekly_bin802.fits', '/lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits', expMap='/lscratch/kocevski/36604960/expmap_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.fits', expCube='/lscratch/kocevski/36604960/ltcube_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/36604960/Model_4FGL_J0509.4+0542_weekly_bin802.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J0509.4+0542'

4FGL J0509.4+0542
   Spectrum: LogParabola
203         norm:  7.518e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-12)
204        alpha:  1.996e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
205         beta:  5.199e-02  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
206           Eb:  1.074e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/36604960/ft1_filtered_4FGL_J0509.4+0542_weekly_bin802.fits
Spacecraft file(s): /lscratch/kocevski/36604960/ft2_4FGL_J0509.4+0542_weekly_bin802.fits
Exposure map: /lscratch/kocevski/36604960/expmap_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.fits
Exposure cube: /lscratch/kocevski/36604960/ltcube_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/36604960/Model_4FGL_J0509.4+0542_weekly_bin802.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) = 34276.8793833

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    17.808       1.0000          .0000       .10000E+07
     2 'Prefactor '    24.183       1.0000          .0000       .10000E+07
     3 'norm      '    2.1529       1.0000          .0000       .10000E+07
     4 'Prefactor '    .63907E-04   1.0000          .0000       .10000E+07
     5 'norm      '    13.121       1.0000          .0000       .10000E+07
     6 'norm      '    10.462       1.0000          .0000       .10000E+07
     7 'Prefactor '    18.370       1.0000          .0000       .10000E+07
     8 'norm      '    1.9200       1.0000          .0000       .10000E+07
     9 'Prefactor '    .18836E-03   1.0000          .0000       .10000E+07
    10 'Prefactor '    .78641E-03   1.0000          .0000       .10000E+07
    11 'norm      '    .53435       1.0000          .0000       .10000E+07
    12 'Prefactor '    2.6621       1.0000          .0000       .10000E+07
    13 'norm      '    2.7534       1.0000          .0000       .10000E+07
    14 'Prefactor '    3.1732       1.0000          .0000       .10000E+07
    15 'Prefactor '    .33033E-03   1.0000          .0000       .10000E+07
    16 'norm      '    .29302E-03   1.0000          .0000       .10000E+07
    17 'Prefactor '    93.205       1.0000          .0000       .10000E+07
    18 'Prefactor '    .65117E-03   1.0000          .0000       .10000E+07
    19 'norm      '    3.2521       1.0000          .0000       .10000E+07
    20 'norm      '    .92441       1.0000          .0000       .10000E+07
    21 'Prefactor '    .40611E-02   1.0000          .0000       .10000E+07
    22 'Prefactor '    14.041       1.0000          .0000       .10000E+07
    23 'Prefactor '    8.1896       1.0000          .0000       .10000E+07
    24 'norm      '    .10337E-03   1.0000          .0000       .10000E+07
    25 'norm      '    .47539       1.0000          .0000       .10000E+07
    26 'Normalizat'    .92928       1.0000         .10000E-01   10.000    
    27 'Prefactor '    1.0067       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5060E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   34276.86     FROM MIGRAD    STATUS=CONVERGED    153 CALLS     2402 TOTAL
                     EDM=   .13E-08  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  3.7%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     17.767        1.5425       -.19302E-08   -.35158E-01
   2  Prefactor     24.943        27.220        .30410E-06    .16552    
   3  norm          2.1547        1.7401        .34600E-08   -.27500E-03
   4  Prefactor     .24430E-06    36.957       -.12324E-05** at limit **
   5  norm          13.113        2.1027       -.10862E-06   -.22628E-02
   6  norm          10.466        2.0070       -.35933E-07    .20047E-02
   7  Prefactor     18.391        1.6696        .15885E-07   -.84515E-02
   8  norm          1.9217        1.1435       -.37780E-07   -.11105E-02
   9  Prefactor     .33862E-08    6.5368       -.35701E-06** at limit **
  10  Prefactor      .0000        2.7903       -.14983E-06** at limit **
  11  norm          .53433        .29852        .10762E-07   -.54932E-02
  12  Prefactor     2.6727        1.5328        .72168E-08    .52719E-02
  13  norm          2.7550        1.7898        .23928E-06   -.42045E-02
  14  Prefactor     3.1734        2.3691       -.26939E-07   -.47799E-03
  15  Prefactor     .55511E-10    3.0320       -.92450E-07** at limit **
  16  norm          .27756E-09    5.7049       -.19873E-07** at limit **
  17  Prefactor     93.589        33.395        .18013E-06   -.26532    
  18  Prefactor     .20872E-07    8.4863        .83670E-07** at limit **
  19  norm          3.2362        4.6822       -.21948E-06    .25766E-03
  20  norm          .92429        .62056       -.51969E-07    .40523E-03
  21  Prefactor     .21649E-08    9.4276       -.37604E-07** at limit **
  22  Prefactor     14.150        8.8955        .79267E-07    .15781E-01
  23  Prefactor     8.1710        4.4102        .14449E-06   -.15013E-02
  24  norm          .38858E-09    5.1850        .93641E-07** at limit **
  25  norm          .50617        3.6754        .13948E-06   -.33471E-03
  26  Normalizat    .92853        .17459        .16402E-04   -.16535E-03
  27  Prefactor     1.0067        .41083E-01   -.18818E-05   -.32038E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 17.7667
  Prefactor  = 24.9435
  norm       = 2.1547
  Prefactor  = 2.44305e-07
  norm       = 13.1125
  norm       = 10.4659
  Prefactor  = 18.3911
  norm       = 1.92166
  Prefactor  = 3.38618e-09
  Prefactor  = 0
  norm       = 0.534326
  Prefactor  = 2.67273
  norm       = 2.75497
  Prefactor  = 3.17343
  Prefactor  = 5.55112e-11
  norm       = 2.77556e-10
  Prefactor  = 93.5893
  Prefactor  = 2.08722e-08
  norm       = 3.23623
  norm       = 0.924288
  Prefactor  = 2.16493e-09
  Prefactor  = 14.1503
  Prefactor  = 8.17101
  norm       = 3.88578e-10
  norm       = 0.506174
  Normalizat = 0.928526
  Prefactor  = 1.0067
 **********
 **   18 **HESSE 
 **********

 FCN=   34276.86     FROM HESSE     STATUS=OK           558 CALLS     2960 TOTAL
                     EDM=   .95E-05    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     17.767        15.104        .23707E-03   -1.5624    
   2  Prefactor     24.943        35.949        .20340E-03   -1.5608    
   3  norm          2.1547        1.9521        .70192E-03   -1.5679    
   4  Prefactor     .24430E-06    36.973        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   5  norm          13.113        2.1186        .27627E-03   -1.5636    
   6  norm          10.466        2.0163        .30953E-03   -1.5643    
   7  Prefactor     18.391        15.109        .23341E-03   -1.5622    
   8  norm          1.9217        1.1656        .74963E-03   -1.5680    
   9  Prefactor     .33862E-08    6.5588        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor      .0000        2.7998        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  11  norm          .53433        .30484        .75326E-03   -1.5693    
  12  Prefactor     2.6727        14.276        .62444E-03   -1.5675    
  13  norm          2.7550        1.8038        .61321E-03   -1.5675    
  14  Prefactor     3.1734        2.3803        .56867E-03   -1.5672    
  15  Prefactor     .55511E-10    3.0161        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  16  norm          .27756E-09    5.7161        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  17  Prefactor     93.589        50.158        .10359E-03   -1.5514    
  18  Prefactor     .20872E-07    1.1816        .71468E-02   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  19  norm          3.2362        4.7267        .56137E-03   -1.5672    
  20  norm          .92429        .62695        .44087E-03   -1.5689    
  21  Prefactor     .21649E-08    9.5519        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  22  Prefactor     14.150        15.672        .26705E-03   -1.5633    
  23  Prefactor     8.1710        4.4476        .35009E-03   -1.5651    
  24  norm          .38858E-09    5.1919        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  25  norm          .50617        3.5742        .81225E-03   -1.5694    
  26  Normalizat    .92853        .17794        .13787       -.95465    
  27  Prefactor     1.0067        .39555E-01    .33149E-01   -.92506    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 9.5319e-06
Minuit parameter uncertainties:
  1  15.104
  2  35.949
  3  1.9521
  4  0.00601116
  5  2.11859
  6  2.01629
  7  15.1094
  8  1.16565
  9  0.000298304
  10  1.3504e-05
  11  0.304835
  12  12.3543
  13  1.80384
  14  2.38026
  15  2.61859e-05
  16  7.75315e-05
  17  50.1578
  18  0.000314164
  19  4.72675
  20  0.626946
  21  0.000286533
  22  15.6725
  23  4.44758
  24  9.10755e-05
  25  2.69011
  26  0.178057
  27  0.0395566
Done.

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

Extracting fit parameters...

4FGL J0509.4+0542
   Spectrum: LogParabola
203         norm:  2.755e+00  1.804e+00  0.000e+00  1.000e+06 ( 1.000e-12)
204        alpha:  1.996e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
205         beta:  5.199e-02  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
206           Eb:  1.074e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
499    Prefactor:  1.007e+00  3.956e-02  0.000e+00  1.000e+01 ( 1.000e+00)
500        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
501        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
498   Normalization:  9.285e-01  1.781e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 5.87
Ra Dec: 77.359 5.701
Photon Index (Fixed Index): 2.00 +/- 0.00
Photon Flux (Fixed Index): 2.74e-08 +/- 1.79e-08
Energy Flux (Fixed Index): 1.75e-05 +/- 1.15e-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) = 34276.3649087
delta logL = 0.497056682325

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 34276.3535621
delta logL = 0.508403314845

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'norm      '    2.5363       1.0000          .0000       .10000E+07
     2 'alpha     '    2.4773       1.0000          .0000       5.0000    
     3 'Normalizat'    .90182       1.0000         .10000E-01   10.000    
     4 'Prefactor '    1.0095       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5060E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   34276.35     FROM MIGRAD    STATUS=CONVERGED     54 CALLS      225 TOTAL
                     EDM=   .15E-07    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  norm          2.5362        17.110        .64104E-03    .45203E-01
   2  alpha         2.4772        3.5919        .41154        .24302E-03
   3  Normalizat    .90182        .62684E-01    .13968        .46797E-03
   4  Prefactor     1.0095        .12506E-01    .33103E-01   -.24312E-03
                               ERR DEF=  .500    
Final values: 
  norm       = 2.53617
  alpha      = 2.47724
  Normalizat = 0.90182
  Prefactor  = 1.00955
 **********
 **   18 **HESSE 
 **********

 FCN=   34276.35     FROM HESSE     STATUS=OK            33 CALLS      258 TOTAL
                     EDM=   .85E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  norm          2.5362        1.6815        .15087E-04   -1.5676    
   2  alpha         2.4772        .49845        .19498E-01   -.91037E-02
   3  Normalizat    .90182        .15880        .62026E-03   -.96396    
   4  Prefactor     1.0095        .38959E-01    .14629E-03   -.92412    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 8.52831e-10
Minuit parameter uncertainties:
  1  1.68146
  2  0.501811
  3  0.158887
  4  0.0389605
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) = 34276.3535621
delta logL = 0.508403319458

Extracting fit parameters...

4FGL J0509.4+0542
   Spectrum: LogParabola
203         norm:  2.536e+00  1.681e+00  0.000e+00  1.000e+06 ( 1.000e-12)
204        alpha:  2.477e+00  5.018e-01  0.000e+00  5.000e+00 ( 1.000e+00)
205         beta:  5.199e-02  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
206           Eb:  1.074e+03  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
499    Prefactor:  1.010e+00  3.896e-02  0.000e+00  1.000e+01 ( 1.000e+00)
500        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
501        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
498   Normalization:  9.018e-01  1.589e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 6.96
Ra Dec: 77.359 5.701
Photon Index (Free Index): 2.48 +/- 0.50
Photon Flux (Free Index): 5.19e-08 +/- 3.57e-08
Energy Flux (Free Index): 1.60e-05 +/- 8.69e-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/36604960/cmap_HighResolution_724032001_724636801_4FGL_J0509.4+0542_weekly_bin802.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='2.74e-08', energy_flux2='1.60e-05', photon_flux_error='1.79e-08', dlogl='5.08e-01', energy_flux='1.75e-05', photon_flux2='5.19e-08', job_status='DONE', time_completed='2023-12-19 00:25:47.723113', photon_index_error2='0.50', photon_index2='2.48', ts='5.87', fit_tolerance='1e-08', GAL='1.01', photon_index_error='0.00', energy_flux_error2='8.69e-06', EG='0.93', time_epoch_completed='1702974347.72', return_code='0', job_id='36604960', GAL2='1.01', EG2='0.90', return_code2='0', energy_flux_error='1.15e-05', photon_flux_error2='3.57e-08', ts2='6.96', photon_index='2.00' WHERE bin_id='802' AND source_name='4FGL J0509.4+0542' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Dec 19 00:25:47 PST 2023

