/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).

Run: [ERROR] Server responded with an error: [3011] No servers are available to read the file. (source)

Run: [ERROR] Server responded with an error: [3011] No servers are available to read the file. (source)

Run: [FATAL] Invalid address:  (source)
Run: [ERROR] Server responded with an error: [3011] No servers are available to read the file. (source)

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


Performing analysis on: 4FGL_J0358.9+6004_weekly_bin821
RA = 59.7328, Dec = 60.0767
tmin = 735523201, tmax = 736128001
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='45340755', job_status='RUN', time_executed='2024-04-30 00:19:21.840597', time_epoch_executed='1714461561.84' WHERE source_name='4FGL J0358.9+6004' and cadence='weekly' and bin_id='821'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/45340755

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

Retrieving the FT1 file...

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

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

Retrieving 107 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/45340755/ft1_4FGL_J0358.9+6004_weekly_bin821.fits


Retrieving the FT1 file...

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

Retrieving 107 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/45340755/ft1_4FGL_J0358.9+6004_weekly_bin821.fits outfile=/lscratch/kocevski/45340755/ft1_filteredMKT_4FGL_J0358.9+6004_weekly_bin821.fits ra=59.7328 dec=60.0767 rad=12.0 tmin=735523201.0 tmax=736128001.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.44
user 4.13
sys 0.24

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.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/45340755/ft1_filteredMKT_4FGL_J0358.9+6004_weekly_bin821.fits evtable="EVENTS" outfile="/lscratch/kocevski/45340755/ft1_filtered_4FGL_J0358.9+6004_weekly_bin821.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.19
sys 0.14

Number of photons that the gtmktime cut: 7935

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/45340755/ft1_filtered_4FGL_J0358.9+6004_weekly_bin821.fits" evtable="EVENTS" scfile=/lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits sctable="SC_DATA"Run: [FATAL] Invalid address:  (source)
Done.


Performing analysis on: 4FGL_J0358.9+6004_weekly_bin821
RA = 59.7328, Dec = 60.0767
tmin = 735523201, tmax = 736128001
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='45340793', job_status='RUN', time_executed='2024-04-30 00:20:22.866560', time_epoch_executed='1714461622.87' WHERE source_name='4FGL J0358.9+6004' and cadence='weekly' and bin_id='821'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/45340793

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

Retrieving the FT1 file...

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

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

Retrieving 107 files...
Done.


Merging files...

[Errno 2] No such file or directory: '/lscratch/kocevski/45340793/gll_ph_p305_r0735713477_v001.fit'
Traceback (most recent call last):
  File "/sdf/group/fermi/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py", line 2860, in sourceAnalysis
    dataAvailibility_ft1 = dataCatalogQuery(FT1_options, verbose=verbose)
  File "/sdf/group/fermi/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py", line 1962, in dataCatalogQuery
    FTmerge.ft1merge(dataCatalogFiles_local, mergedFile, verbose=verbose)
  File "/sdf/data/fermi/g/LCRepository/Likelihood/Scripts/FTmerge.py", line 59, in ft1merge
    tstart, tstop = _getTimeKeywords(infiles)
  File "/sdf/data/fermi/g/LCRepository/Likelihood/Scripts/FTmerge.py", line 40, in _getTimeKeywords
    header = pyfits.open(item)[extnum].header
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 148, in fitsopen
    lazy_load_hdus, **kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 402, in fromfile
    lazy_load_hdus=lazy_load_hdus, **kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 1006, in _readfrom
    fileobj = _File(fileobj, mode=mode, memmap=memmap, cache=cache)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/utils/decorators.py", line 522, in wrapper
    return function(*args, **kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/file.py", line 150, in __init__
    self._open_filename(fileobj, mode, overwrite)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/file.py", line 506, in _open_filename
    self._file = fileobj_open(self.name, IO_FITS_MODES[mode])
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/util.py", line 395, in fileobj_open
    return open(filename, mode)
IOError: [Errno 2] No such file or directory: '/lscratch/kocevski/45340793/gll_ph_p305_r0735713477_v001.fit'


Retrieving the FT1 file...

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

Retrieving 107 files...
Done.


Merging files...
[Errno 2] No such file or directory: '/lscratch/kocevski/45340793/gll_pt_p310_r0735543054_v001.fit'
Traceback (most recent call last):
  File "/sdf/group/fermi/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py", line 2886, in sourceAnalysis
    dataAvailibility_ft2 = dataCatalogQuery(FT2_options, verbose=verbose)
  File "/sdf/group/fermi/g/LCRepository/Likelihood/Scripts/LikelihoodAnalysis.py", line 1967, in dataCatalogQuery
    FTmerge.ft2merge(dataCatalogFiles_local, mergedFile, verbose=verbose)
  File "/sdf/data/fermi/g/LCRepository/Likelihood/Scripts/FTmerge.py", line 133, in ft2merge
    tstart, tstop = _getTimeKeywords(infiles_arg)
  File "/sdf/data/fermi/g/LCRepository/Likelihood/Scripts/FTmerge.py", line 40, in _getTimeKeywords
    header = pyfits.open(item)[extnum].header
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 148, in fitsopen
    lazy_load_hdus, **kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 402, in fromfile
    lazy_load_hdus=lazy_load_hdus, **kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 1006, in _readfrom
    fileobj = _File(fileobj, mode=mode, memmap=memmap, cache=cache)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/utils/decorators.py", line 522, in wrapper
    return function(*args, **kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/file.py", line 150, in __init__
    self._open_filename(fileobj, mode, overwrite)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/file.py", line 506, in _open_filename
    self._file = fileobj_open(self.name, IO_FITS_MODES[mode])
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/astropy/io/fits/util.py", line 395, in fileobj_open
    return open(filename, mode)
IOError: [Errno 2] No such file or directory: '/lscratch/kocevski/45340793/gll_pt_p310_r0735543054_v001.fit'

UPDATE lightcurve_data_v2 SET job_status='FAIL', comment='No available data', time_epoch_completed='1714461871.39', time_completed='2024-04-30 00:24:31.393195', job_id='45340793' WHERE bin_id='821' AND source_name='4FGL J0358.9+6004' AND cadence='weekly';
2003: Can't connect to MySQL server on 'mysql-node01:3307' (-2 Name or service not known)
Traceback (most recent call last):
  File "/sdf/data/fermi/g/LCRepository/Likelihood/Scripts/DatabaseTools.py", line 110, in executeCommand
    mydb = mysql.connector.connect(host=host, user=user, passwd=passwd, database=database, port=port)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/__init__.py", line 179, in connect
    return MySQLConnection(*args, **kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/connection.py", line 95, in __init__
    self.connect(**kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/abstracts.py", line 722, in connect
    self._open_connection()
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/connection.py", line 208, in _open_connection
    self._socket.open_connection()
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/network.py", line 501, in open_connection
    errno=2003, values=(self.get_address(), _strioerror(err)))
InterfaceError: 2003: Can't connect to MySQL server on 'mysql-node01:3307' (-2 Name or service not known)

Command execution failed.

Waiting 22.218268963 seconds and trying again...


UPDATE lightcurve_data_v2 SET job_status='FAIL', comment='No available data', time_epoch_completed='1714461871.39', time_completed='2024-04-30shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
 00:24:31.393195', job_id='45340793' WHERE bin_id='821' AND source_name='4FGL J0358.9+6004' AND cadence='weekly';

Database successfully updated.

Error: could not find cmap file: /lscratch/kocevski/45340793/cmap_HighResolution_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.fits
Continuing... 

Cleaning up...

** Nuclear option initiated! **


Analysis Complete.


Tue Apr 30 00:25:01 PDT 2024

 outfile=/lscratch/kocevski/45340755/ltcube_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.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/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits
.....................!
real 15.39
user 15.07
sys 0.23

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/45340755/ft1_filtered_4FGL_J0358.9+6004_weekly_bin821.fits evtable="EVENTS" scfile=/lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits sctable="SC_DATA" expcube=/lscratch/kocevski/45340755/ltcube_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.fits outfile=/lscratch/kocevski/45340755/expmap_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.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/45340755/ltcube_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.fits
.....................!
real 59.01
user 55.39
sys 3.39

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 G150.3+4.5 in ROI with RadialDisk spatial model.
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 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 170 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 J0358.9+6004 @ 59.7328 60.0767

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/45340755/ft1_filtered_4FGL_J0358.9+6004_weekly_bin821.fits scfile=/lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits outfile=/lscratch/kocevski/45340755/cmap_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.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=59.7328 yref=60.0767 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.39
user 0.21
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/45340755/ft1_filtered_4FGL_J0358.9+6004_weekly_bin821.fits scfile=/lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits outfile=/lscratch/kocevski/45340755/cmap_HighResolution_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.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=59.7328 yref=60.0767 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 6.42
user 0.21
sys 0.14

Computing the diffuse response:
time -p gtdiffrsp evfile=/lscratch/kocevski/45340755/ft1_filtered_4FGL_J0358.9+6004_weekly_bin821.fits evtable="EVENTS" scfile=/lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/45340755/Model_4FGL_J0358.9+6004_weekly_bin821.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/45340755/ft1_filtered_4FGL_J0358.9+6004_weekly_bin821.fits.....................!
real 403.29
user 401.07
sys 0.86

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/45340755/ft1_filtered_4FGL_J0358.9+6004_weekly_bin821.fits', '/lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits', expMap='/lscratch/kocevski/45340755/expmap_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.fits', expCube='/lscratch/kocevski/45340755/ltcube_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/45340755/Model_4FGL_J0358.9+6004_weekly_bin821.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J0358.9+6004'

4FGL J0358.9+6004
   Spectrum: PowerLaw
327    Prefactor:  8.342e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-13)
328        Index:  2.597e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
329        Scale:  9.308e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/45340755/ft1_filtered_4FGL_J0358.9+6004_weekly_bin821.fits
Spacecraft file(s): /lscratch/kocevski/45340755/ft2_4FGL_J0358.9+6004_weekly_bin821.fits
Exposure map: /lscratch/kocevski/45340755/expmap_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.fits
Exposure cube: /lscratch/kocevski/45340755/ltcube_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/45340755/Model_4FGL_J0358.9+6004_weekly_bin821.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) = 72955.0773538

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'norm      '    5.2867       1.0000          .0000       .10000E+07
     2 'norm      '    2.8103       1.0000          .0000       .10000E+07
     3 'Prefactor '    .10140E-04   1.0000          .0000       .10000E+07
     4 'Prefactor '    8.0489       1.0000          .0000       .10000E+07
     5 'Prefactor '    1.9508       1.0000          .0000       .10000E+07
     6 'Prefactor '    .84879       1.0000          .0000       .10000E+07
     7 'Prefactor '    .78962E-03   1.0000          .0000       .10000E+07
     8 'Prefactor '    23.794       1.0000          .0000       .10000E+07
     9 'norm      '    11.964       1.0000          .0000       .10000E+07
    10 'norm      '    6.4773       1.0000          .0000       .10000E+07
    11 'norm      '    .61007E-07   1.0000          .0000       .10000E+07
    12 'Prefactor '    .45630E-07   1.0000          .0000       .10000E+07
    13 'Normalizat'    .99991       1.0000         .10000E-01   10.000    
    14 'Prefactor '    .98821       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5900E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   72954.86     FROM MIGRAD    STATUS=CONVERGED    108 CALLS      777 TOTAL
                     EDM=   .35E-11  STRATEGY=1  ERROR MATRIX UNCERTAINTY=  2.3%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  norm          5.2867        .41171       -.45695E-09   -.57144E-03
   2  norm          2.8108        2.5525        .15269E-07   -.24203E-03
   3  Prefactor      .0000        20.668       -.17115E-06** at limit **
   4  Prefactor     8.0471        3.1976       -.22091E-08    .26558E-04
   5  Prefactor     1.9504        1.8652       -.28602E-07    .18777E-04
   6  Prefactor     .53919        152.58        .88788E-06   -.93440E-04
   7  Prefactor      .0000        35.948       -.28028E-06** at limit **
   8  Prefactor     24.055        19.274       -.65458E-07    .17654E-03
   9  norm          11.977        5.8152       -.13555E-07    .50315E-04
  10  norm          6.4798        5.5127        .97899E-08    .44958E-04
  11  norm           .0000        5.4587        .90014E-07** at limit **
  12  Prefactor      .0000        1.9483       -.79617E-08** at limit **
  13  Normalizat    .99978        .18673       -.39784E-06    .16886E-05
  14  Prefactor     .98821        .20790E-01    .17007E-07    .13768E-04
                               ERR DEF=  .500    
Final values: 
  norm       = 5.28672
  norm       = 2.81077
  Prefactor  = 0
  Prefactor  = 8.04709
  Prefactor  = 1.95043
  Prefactor  = 0.539193
  Prefactor  = 0
  Prefactor  = 24.0546
  norm       = 11.9766
  norm       = 6.47976
  norm       = 0
  Prefactor  = 0
  Normalizat = 0.99978
  Prefactor  = 0.988215
 **********
 **   18 **HESSE 
 **********

 FCN=   72954.86     FROM HESSE     STATUS=OK           196 CALLS      973 TOTAL
                     EDM=   .12E-05    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  norm          5.2867        .41245        .43689E-03   -1.5662    
   2  norm          2.8108        2.5684        .60653E-03   -1.5674    
   3  Prefactor      .0000        20.725        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  Prefactor     8.0471        3.2010        .35316E-03   -1.5651    
   5  Prefactor     1.9504        1.8840        .74269E-03   -1.5680    
   6  Prefactor     .53919        153.74        .49367E-03   -1.5693    
   7  Prefactor      .0000        36.107        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   8  Prefactor     24.055        19.335        .20505E-03   -1.5610    
   9  norm          11.977        5.8196        .28937E-03   -1.5639    
  10  norm          6.4798        5.5175        .39410E-03   -1.5657    
  11  norm           .0000        5.4828        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  Prefactor      .0000        1.9520        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  13  Normalizat    .99978        .19707        .23935       -.93038    
  14  Prefactor     .98821        .21288E-01    .26472E-01   -.93123    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.22531e-06
Minuit parameter uncertainties:
  1  0.412449
  2  2.56841
  3  1.09461e-05
  4  3.20095
  5  1.88403
  6  18.2097
  7  4.21205e-05
  8  19.3353
  9  5.81965
  10  5.51755
  11  1.20834e-06
  12  6.06507e-07
  13  0.197214
  14  0.0212881
Done.

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

Extracting fit parameters...

4FGL J0358.9+6004
   Spectrum: PowerLaw
327    Prefactor:  2.405e+01  1.934e+01  0.000e+00  1.000e+06 ( 1.000e-13)
328        Index:  2.597e+00  0.000e+00  0.000e+00  1.000e+01 (-1.000e+00) fixed
329        Scale:  9.308e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
575    Prefactor:  9.882e-01  2.129e-02  0.000e+00  1.000e+01 ( 1.000e+00)
576        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
577        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
570   Normalization:  9.998e-01  1.972e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 1.99
Ra Dec: 59.733 60.077
Photon Index (Fixed Index): 2.60 +/- 0.00
Photon Flux (Fixed Index): 4.95e-08 +/- 3.97e-08
Energy Flux (Fixed Index): 1.30e-05 +/- 1.05e-05

TS (Fixed Index): 1.99
Ra Dec: 59.733 60.077
Photon Flux Upper Limit: 1.26300366572e-07 ph cm-2 s-1
Energy Flux Upper Limit: 0.00988255481454 MeV cm-2 s-1

Saving results to:
/lscratch/kocevski/45340755/likelihoodResults_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.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) = 72954.1141292
delta logL = 0.743294404427

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 72954.0827463
delta logL = 0.7746773088

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    42.098       1.0000          .0000       .10000E+07
     2 'Index     '    2.0185       1.0000          .0000       10.000    
     3 'Normalizat'    1.0151       1.0000         .10000E-01   10.000    
     4 'Prefactor '    .98724       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .5900E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   72954.08     FROM MIGRAD    STATUS=CONVERGED     70 CALLS      282 TOTAL
                     EDM=   .12E-08    STRATEGY= 1      ERR MATRIX NOT POS-DEF

  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     42.072        258.06        .15414E-03    .83906E-03
   2  Index         2.0192        1.1835        .42816       -.16828E-04
   3  Normalizat    1.0151        .48194E-01    .23779        .35968E-03
   4  Prefactor     .98724        .47984E-02    .26482E-01   -.97600E-04
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 42.0721
  Index      = 2.01917
  Normalizat = 1.01513
  Prefactor  = 0.987235
 **********
 **   18 **HESSE 
 **********

 FCN=   72954.08     FROM HESSE     STATUS=OK            33 CALLS      315 TOTAL
                     EDM=   .45E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     42.072        27.923        .30828E-04   -1.5578    
   2  Index         2.0192        .38898        .10489E-01   -.63872    
   3  Normalizat    1.0151        .18530        .10619E-02   -.92525    
   4  Prefactor     .98724        .20480E-01    .11704E-03   -.93156    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 4.5066e-11
Minuit parameter uncertainties:
  1  27.9234
  2  0.389594
  3  0.185421
  4  0.0204805
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 72954.0827442
delta logL = 0.774679385417

Extracting fit parameters...

4FGL J0358.9+6004
   Spectrum: PowerLaw
327    Prefactor:  4.207e+01  2.792e+01  0.000e+00  1.000e+06 ( 1.000e-13)
328        Index:  2.019e+00  3.896e-01  0.000e+00  1.000e+01 (-1.000e+00)
329        Scale:  9.308e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
575    Prefactor:  9.872e-01  2.048e-02  0.000e+00  1.000e+01 ( 1.000e+00)
576        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
577        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
570   Normalization:  1.015e+00  1.854e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 3.52
Ra Dec: 59.733 60.077
Photon Index (Free Index): 2.02 +/- 0.39
Photon Flux (Free Index): 3.73e-08 +/- 3.03e-08
Energy Flux (Free Index): 2.46e-05 +/- 2.00e-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/45340755/cmap_HighResolution_735523201_736128001_4FGL_J0358.9+6004_weekly_bin821.png

Cleaning up...

** Nuclear option initiated! **

Updating database...
UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='9.88e-03', comment='SUCCESS', photon_flux='4.95e-08', energy_flux2='2.46e-05', photon_flux_error='3.97e-08', dlogl='7.75e-01', energy_flux='1.30e-05', photon_flux2='3.73e-08', job_status='DONE', time_completed='2024-04-30 00:43:18.971512', photon_index_error2='0.39', photon_index2='2.02', ts='1.99', fit_tolerance='1e-08', GAL='0.99', photon_index_error='0.00', photon_flux_upper_limit='1.26e-07', energy_flux_error2='2.00e-05', EG='1.00', time_epoch_completed='1714462998.97', return_code='0', job_id='45340755', GAL2='0.99', EG2='1.02', return_code2='0', energy_flux_error='1.05e-05', photon_flux_error2='3.03e-08', ts2='3.52', photon_index='2.60' WHERE bin_id='821' AND source_name='4FGL J0358.9+6004' AND cadence='weekly';
2003: Can't connect to MySQL server on 'mysql-node01:3307' (-2 Name or service not known)
Traceback (most recent call last):
  File "/sdf/data/fermi/g/LCRepository/Likelihood/Scripts/DatabaseTools.py", line 110, in executeCommand
    mydb = mysql.connector.connect(host=host, user=user, passwd=passwd, database=database, port=port)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/__init__.py", line 179, in connect
    return MySQLConnection(*args, **kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/connection.py", line 95, in __init__
    self.connect(**kwargs)
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/abstracts.py", line 722, in connect
    self._open_connection()
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/connection.py", line 208, in _open_connection
    self._socket.open_connection()
  File "/sdf/group/fermi/u/kocevski/software/conda/envs/fermitools_v1.0.5/lib/python2.7/site-packages/mysql/connector/network.py", line 501, in open_connection
    errno=2003, values=(self.get_address(), _strioerror(err)))
InterfaceError: 2003: Can't connect to MySQL server on 'mysql-node01:3307' (-2 Name or service not known)

Command execution failed.

Waiting 8.55371782431 seconds and trying again...


UPDATE lightcurve_data_v2 SET energy_flux_upper_limit='9.88e-03', comment='SUCCESS', photon_flux='4.95e-08', energy_flux2='2.46e-05', photon_flux_error='3.97e-08', dlogl='7.75e-01', energy_flux='1.30e-05', photon_flux2='3.73e-08', job_status='DONE', time_completed='2024-04-30 00:43:18.971512', photon_index_error2='0.39', photon_index2='2.02', ts='1.99', fit_tolerance='1e-08', GAL='0.99', photon_index_error='0.00', photon_flux_upper_limit='1.26e-07', energy_flux_error2='2.00e-05', EG='1.00', time_epoch_completed=shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
'1714462998.97', return_code='0', job_id='45340755', GAL2='0.99', EG2='1.02', return_code2='0', energy_flux_error='1.05e-05', photon_flux_error2='3.03e-08', ts2='3.52', photon_index='2.60' WHERE bin_id='821' AND source_name='4FGL J0358.9+6004' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Apr 30 00:43:30 PDT 2024

