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


Performing analysis on: 4FGL_J2049.9+1002_weekly_bin780
RA = 312.478, Dec = 10.0407
tmin = 710726401, tmax = 711331201
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='19664452', job_status='RUN', time_executed='2023-07-18 01:51:49.446492', time_epoch_executed='1689670309.45' WHERE source_name='4FGL J2049.9+1002' and cadence='weekly' and bin_id='780'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/19664452

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

Retrieving the FT1 file...

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

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

Retrieving 106 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/19664452/ft1_4FGL_J2049.9+1002_weekly_bin780.fits


Retrieving the FT1 file...

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

Retrieving 106 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/19664452/ft1_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19664452/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits ra=312.478 dec=10.0407 rad=12.0 tmin=710726401.0 tmax=711331201.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.92
user 3.79
sys 0.25

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.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/19664452/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" outfile="/lscratch/kocevski/19664452/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.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.93
user 0.20
sys 0.13

Number of photons that the gtmktime cut: 1969

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/19664452/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits" evtable="EVENTS" scfile=/lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA"/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).

 outfile=/lscratch/kocevski/19664452/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 17.09
user 16.10
sys 0.24

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/19664452/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" expcube=/lscratch/kocevski/19664452/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19664452/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19664452/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 64.61
user 60.15
sys 3.67

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 W 51C in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/W51C.fits is the correct path to the extended template.
Extended source Cygnus Loop in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/CygnusLoop.fits is the correct path to the extended template.
Added 201 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 J2049.9+1002 @ 312.478 10.0407

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/19664452/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19664452/cmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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.95
user 0.22
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/19664452/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19664452/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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 1.15
user 0.22
sys 0.13

Computing the diffuse response:
time -number of points = 17189
number of fields = 31
RA_SUN column already exists. File will not be modified.
Done.


Performing analysis on: 4FGL_J2049.9+1002_weekly_bin780
RA = 312.478, Dec = 10.0407
tmin = 710726401, tmax = 711331201
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='19665276', job_status='RUN', time_executed='2023-07-18 01:56:46.345569', time_epoch_executed='1689670606.35' WHERE source_name='4FGL J2049.9+1002' and cadence='weekly' and bin_id='780'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/19665276

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

Retrieving the FT1 file...

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

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

Retrieving 106 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/19665276/ft1_4FGL_J2049.9+1002_weekly_bin780.fits


Retrieving the FT1 file...

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

Retrieving 106 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/19665276/ft1_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665276/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits ra=312.478 dec=10.0407 rad=12.0 tmin=710726401.0 tmax=711331201.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.46
user 3.48
sys 0.24

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.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/19665276/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" outfile="/lscratch/kocevski/19665276/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.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 1.27
user 0.19
sys 0.14

Number of photons that the gtmktime cut: 1969

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/19665276/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits" evtable="EVENTS" scfile=/lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA"p gtdiffrsp evfile=/lscratch/kocevski/19664452/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/19664452/Model_4FGL_J2049.9+1002_weekly_bin780.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 Cygnus Loop
adding source EG_v02
adding source GAL_V02
adding source W 51C
Working on...
/lscratch/kocevski/19664452/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits.....................!
real 148.06
user 145.42
sys 1.06

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/19664452/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits', '/lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits', expMap='/lscratch/kocevski/19664452/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', expCube='/lscratch/kocevski/19664452/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/19664452/Model_4FGL_J2049.9+1002_weekly_bin780.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J2049.9+1002'

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  4.360e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/19664452/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits
Spacecraft file(s): /lscratch/kocevski/19664452/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure map: /lscratch/kocevski/19664452/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure cube: /lscratch/kocevski/19664452/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/19664452/Model_4FGL_J2049.9+1002_weekly_bin780.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) = 20815.0911766

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    10.362       1.0000          .0000       .10000E+07
     2 'Prefactor '    3.9105       1.0000          .0000       .10000E+07
     3 'Prefactor '    .11742E-03   1.0000          .0000       .10000E+07
     4 'norm      '    .31229       1.0000          .0000       .10000E+07
     5 'Prefactor '    48.228       1.0000          .0000       .10000E+07
     6 'norm      '    8.5971       1.0000          .0000       .10000E+07
     7 'Prefactor '    7.2719       1.0000          .0000       .10000E+07
     8 'Prefactor '    30.520       1.0000          .0000       .10000E+07
     9 'Prefactor '    .18355E-03   1.0000          .0000       .10000E+07
    10 'Prefactor '    10.780       1.0000          .0000       .10000E+07
    11 'Prefactor '    .19893E-02   1.0000          .0000       .10000E+07
    12 'norm      '    4.3578       1.0000          .0000       .10000E+07
    13 'Prefactor '    .16573E-01   1.0000          .0000       .10000E+07
    14 'Prefactor '    .50904E-07   1.0000          .0000       .10000E+07
    15 'Normalizat'    .66560       1.0000         .10000E-01   10.000    
    16 'Prefactor '    1.0532       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINnumber of points = 17189
number of fields = 31
RA_SUN column already exists. File will not be modified.
Done.


Performing analysis on: 4FGL_J2049.9+1002_weekly_bin780
RA = 312.478, Dec = 10.0407
tmin = 710726401, tmax = 711331201
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='19665356', job_status='RUN', time_executed='2023-07-18 01:57:09.123241', time_epoch_executed='1689670629.12' WHERE source_name='4FGL J2049.9+1002' and cadence='weekly' and bin_id='780'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/19665356

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

Retrieving the FT1 file...

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

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

Retrieving 106 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/19665356/ft1_4FGL_J2049.9+1002_weekly_bin780.fits


Retrieving the FT1 file...

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

Retrieving 106 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/19665356/ft1_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665356/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits ra=312.478 dec=10.0407 rad=12.0 tmin=710726401.0 tmax=711331201.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.68
user 3.51
sys 0.20

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.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/19665356/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" outfile="/lscratch/kocevski/19665356/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.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 1.14
user 0.19
sys 0.13

Number of photons that the gtmktime cut: 1969

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/19665356/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits" evtable="EVENTS" scfile=/lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA"IMIZE    .6980E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   20815.07     FROM MIGRAD    STATUS=CONVERGED    114 CALLS     1119 TOTAL
                     EDM=   .64E-10  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .6%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     10.315        8.4055       -.41388E-07    .97036E-04
   2  Prefactor     3.8731        7.3064       -.45990E-07    .98750E-03
   3  Prefactor     .61617E-08    48.390       -.16098E-05** at limit **
   4  norm          .31360        .41539       -.64253E-07    .59710E-02
   5  Prefactor     47.707        4.2982       -.67568E-07   -.77047E-02
   6  norm          8.6112        5.3340        .74554E-07    .58334E-03
   7  Prefactor     7.2915        1.5989        .23424E-07   -.12845E-01
   8  Prefactor     30.539        1.4905        .86882E-08    .35551E-01
   9  Prefactor      .0000        6.8655       -.13099E-06** at limit **
  10  Prefactor     10.612        10.804       -.14356E-06    .23938E-03
  11  Prefactor      .0000        19.723       -.36069E-07** at limit **
  12  norm          4.3561        2.4509        .43885E-07   -.65554E-03
  13  Prefactor      .0000        33.352       -.17711E-06** at limit **
  14  Prefactor      .0000        2.1843       -.35283E-06** at limit **
  15  Normalizat    .66623        .18251       -.22116E-05    .33052E-04
  16  Prefactor     1.0533        .64393E-01   -.10689E-05    .10532E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 10.3149
  Prefactor  = 3.87313
  Prefactor  = 6.16174e-09
  norm       = 0.313599
  Prefactor  = 47.7073
  norm       = 8.61123
  Prefactor  = 7.29148
  Prefactor  = 30.5389
  Prefactor  = 0
  Prefactor  = 10.6117
  Prefactor  = 0
  norm       = 4.35611
  Prefactor  = 0
  Prefactor  = 0
  Normalizat = 0.666231
  Prefactor  = 1.05325
 outfile=/lscratch/kocevski/19665276/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 16.17
user 15.11
sys 0.24

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/19665276/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" expcube=/lscratch/kocevski/19665276/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665276/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19665276/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 59.99
user 55.63
sys 3.40

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 W 51C in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/W51C.fits is the correct path to the extended template.
Extended source Cygnus Loop in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/CygnusLoop.fits is the correct path to the extended template.
Added 201 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 J2049.9+1002 @ 312.478 10.0407

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/19665276/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665276/cmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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 1.31
user 0.21
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/19665276/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665276/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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 1.18
user 0.22
sys 0.14

Computing the diffuse response:
time - **********
 **   18 **HESSE 
 **********

 FCN=   20815.07     FROM HESSE     STATUS=OK           245 CALLS     1364 TOTAL
                     EDM=   .14E-07    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     10.315        8.4871        .31102E-03   -1.5644    
   2  Prefactor     3.8731        7.6876        .50995E-03   -1.5669    
   3  Prefactor     .61617E-08    48.631        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  norm          .31360        .45574        .10045E-02   -1.5697    
   5  Prefactor     47.707        32.917        .14401E-03   -1.5570    
   6  norm          8.6112        5.5332        .34164E-03   -1.5649    
   7  Prefactor     7.2915        12.011        .37172E-03   -1.5654    
   8  Prefactor     30.539        12.174        .18104E-03   -1.5597    
   9  Prefactor      .0000        6.9152        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     10.612        10.944        .30490E-03   -1.5643    
  11  Prefactor      .0000        19.759        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  norm          4.3561        2.4567        .48226E-03   -1.5666    
  13  Prefactor      .0000        5.3279        .11974E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor      .0000        2.1758        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Normalizat    .66623        .17892        .11460       -1.0524    
  16  Prefactor     1.0533        .59015E-01    .39726E-01   -.90975    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.40294e-08
Minuit parameter uncertainties:
  1  8.48712
  2  7.68766
  3  0.00109245
  4  0.455743
  5  32.9172
  6  5.53319
  7  12.0107
  8  12.1742
  9  8.83682e-06
  10  10.9443
  11  1.82525e-05
  12  2.45666
  13  1.94412e-07
  14  4.3839e-06
  15  0.179074
  16  0.0590189
Done.

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

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.611e+00  5.533e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.053e+00  5.902e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.662e-01  1.791e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 4.92
Ra Dec: 312.478 10.041
Photon Index (Fixed Index): 2.39 +/- 0.00
Photon Flux (Fixed Index): 4.10e-08 +/- 2.63e-08
Energy Flux (Fixed Index): 1.30e-05 +/- 8.34e-06

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) = 20814.807306
delta logL = 0.262725582732

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 20814.8038598
delta logL = 0.266171759868

Fit tolerance = 1e-08

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

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

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   20814.80     FROM MIGRAD    STATUS=CONVERGED     55 CALLS      214 TOTAL
                     EDM=   .82E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  norm          8.0974        5.8404        .35197E-03    .62946E-03
   2  alpha         1.8562        .55976        .43014       -.10938E-03
   3  Normalizat    .68726        .16544        .11298        .12405E-03
   4  Prefactor     1.0495        .58072E-01    .39942E-01   -.28261E-04
                               ERR DEF=  .500    
Final values: 
  norm       = 8.09736
  alpha      = 1.85624
  Normalizat = 0.687259
  Prefactor  = 1.04947
 **********
 **   18 **HESSE 
 **********

 FCN=   20814.80     FROM HESSE     STATUS=OK            33 CALLS      247 TOTAL
                     EDM=   .28E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  norm          8.0974        5.9856        .14079E-04   -1.5651    
   2  alpha         1.8562        .68259        .29536E-01   -.26044    
   3  Normalizat    .68726        .18250        .50096E-03   -1.0440    
   4  Prefactor     1.0495        .64405E-01    .14514E-03   -.91098    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.75264e-11
Minuit parameter uncertainties:
  1  5.9856
  2  0.692013
  3  0.182658
  4  0.0644093
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) = 20814.8038572
delta logL = 0.2661743233

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.097e+00  5.986e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  1.856e+00  6.920e-01  0.000e+00  5.000e+00 ( 1.000e+00)
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.049e+00  6.441e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.873e-01  1.827e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 5.45
Ra Dec: 312.478 10.041
Photon Index (Free Index): 1.86 +/- 0.69
Photon Flux (Free Index): 2.37e-08 +/- 2.51e-08
Energy Flux (Free Index): 1.42e-05 +/- 9.89e-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/19664452/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='4.10e-08', energy_flux2='1.42e-05', photon_flux_error='2.63e-08', dlogl='2.66e-01', energy_flux='1.30e-05', photon_flux2='2.37e-08', job_status='DONE', time_completed='2023-07-18 02:10:15.761950', photon_index_error2='0.69', photon_index2='1.86', ts='4.92', fit_tolerance='1e-08', GAL='1.05', photon_index_error='0.00', energy_flux_error2='9.89e-06', EG='0.67', time_epoch_completed='1689671415.76', return_code='0', job_id='19664452', GAL2='1.05', EG2='0.69', return_code2='0', energy_flux_error='8.34e-06', photon_flux_error2='2.51e-08', ts2='5.45', photon_index='2.39' WHERE bin_id='780' AND source_name='4FGL J2049.9+1002' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Jul 18 02:10:17 PDT 2023

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


Performing analysis on: 4FGL_J2049.9+1002_weekly_bin780
RA = 312.478, Dec = 10.0407
tmin = 710726401, tmax = 711331201
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='19665804', job_status='RUN', time_executed='2023-07-18 01:59:35.916854', time_epoch_executed='1689670775.92' WHERE source_name='4FGL J2049.9+1002' and cadence='weekly' and bin_id='780'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/19665804

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

Retrieving the FT1 file...

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

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

Retrieving 106 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/19665804/ft1_4FGL_J2049.9+1002_weekly_bin780.fits


Retrieving the FT1 file...

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

Retrieving 106 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/19665804/ft1_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665804/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits ra=312.478 dec=10.0407 rad=12.0 tmin=710726401.0 tmax=711331201.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.92
user 3.80
sys 0.20

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.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/19665804/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" outfile="/lscratch/kocevski/19665804/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.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 1.16
user 0.20
sys 0.15

Number of photons that the gtmktime cut: 1969

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/19665804/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits" evtable="EVENTS" scfile=/lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" outfile=/lscratch/kocevski/19665356/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 16.06
user 15.10
sys 0.25

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/19665356/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" expcube=/lscratch/kocevski/19665356/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665356/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19665356/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 61.62
user 56.78
sys 3.71

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 W 51C in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/W51C.fits is the correct path to the extended template.
Extended source Cygnus Loop in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/CygnusLoop.fits is the correct path to the extended template.
Added 201 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 J2049.9+1002 @ 312.478 10.0407

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/19665356/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665356/cmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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 1.21
user 0.22
sys 0.13

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/19665356/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665356/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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 1.19
user 0.21
sys 0.14

Computing the diffuse response:
time - outfile=/lscratch/kocevski/19665804/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 17.08
user 15.95
sys 0.26

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/19665804/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" expcube=/lscratch/kocevski/19665804/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665804/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19665804/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 63.77
user 58.95
sys 3.80

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 W 51C in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/W51C.fits is the correct path to the extended template.
Extended source Cygnus Loop in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/CygnusLoop.fits is the correct path to the extended template.
Added 201 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 J2049.9+1002 @ 312.478 10.0407

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/19665804/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665804/cmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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 1.23
user 0.21
sys 0.15

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/19665804/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19665804/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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.92
user 0.22
sys 0.14

Computing the diffuse response:
time -number of points = 17189
number of fields = 31
RA_SUN column already exists. File will not be modified.
Done.


Performing analysis on: 4FGL_J2049.9+1002_weekly_bin780
RA = 312.478, Dec = 10.0407
tmin = 710726401, tmax = 711331201
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='19666412', job_status='RUN', time_executed='2023-07-18 02:02:52.918155', time_epoch_executed='1689670972.92' WHERE source_name='4FGL J2049.9+1002' and cadence='weekly' and bin_id='780'

Database successfully updated.
Done.

Creating custom output directory:
/lscratch/kocevski/19666412

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

Retrieving the FT1 file...

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

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

Retrieving 106 files...
Done.


Merging files...

Checksum keywords updated successfully.

Merged file saved to:
/lscratch/kocevski/19666412/ft1_4FGL_J2049.9+1002_weekly_bin780.fits


Retrieving the FT1 file...

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

Retrieving 106 files...
Done.


Merging files...

Merged file saved to:
/lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits


Selecting the photons:
time -p gtselect infile=/lscratch/kocevski/19666412/ft1_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19666412/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits ra=312.478 dec=10.0407 rad=12.0 tmin=710726401.0 tmax=711331201.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.67
user 3.71
sys 0.24

Adding sun position to ft2 file:
/sdf/group/fermi/g/LCRepository/Repository/bin/sunpos /lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits

Selecting the good time intervals:
time -p gtmktime scfile=/lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.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/19666412/ft1_filteredMKT_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" outfile="/lscratch/kocevski/19666412/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.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.94
user 0.20
sys 0.13

Number of photons that the gtmktime cut: 1969

Generating the livetime cube:
time -p gtltcube evfile="/lscratch/kocevski/19666412/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits" evtable="EVENTS" scfile=/lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA"p gtdiffrsp evfile=/lscratch/kocevski/19665276/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/19665276/Model_4FGL_J2049.9+1002_weekly_bin780.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 Cygnus Loop
adding source EG_v02
adding source GAL_V02
adding source W 51C
Working on...
/lscratch/kocevski/19665276/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits.....................!
real 137.66
user 135.23
sys 1.02

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/19665276/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits', '/lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits', expMap='/lscratch/kocevski/19665276/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', expCube='/lscratch/kocevski/19665276/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/19665276/Model_4FGL_J2049.9+1002_weekly_bin780.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J2049.9+1002'

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  4.360e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/19665276/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits
Spacecraft file(s): /lscratch/kocevski/19665276/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure map: /lscratch/kocevski/19665276/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure cube: /lscratch/kocevski/19665276/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/19665276/Model_4FGL_J2049.9+1002_weekly_bin780.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) = 20815.0911766

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    10.362       1.0000          .0000       .10000E+07
     2 'Prefactor '    3.9105       1.0000          .0000       .10000E+07
     3 'Prefactor '    .11742E-03   1.0000          .0000       .10000E+07
     4 'norm      '    .31229       1.0000          .0000       .10000E+07
     5 'Prefactor '    48.228       1.0000          .0000       .10000E+07
     6 'norm      '    8.5971       1.0000          .0000       .10000E+07
     7 'Prefactor '    7.2719       1.0000          .0000       .10000E+07
     8 'Prefactor '    30.520       1.0000          .0000       .10000E+07
     9 'Prefactor '    .18355E-03   1.0000          .0000       .10000E+07
    10 'Prefactor '    10.780       1.0000          .0000       .10000E+07
    11 'Prefactor '    .19893E-02   1.0000          .0000       .10000E+07
    12 'norm      '    4.3578       1.0000          .0000       .10000E+07
    13 'Prefactor '    .16573E-01   1.0000          .0000       .10000E+07
    14 'Prefactor '    .50904E-07   1.0000          .0000       .10000E+07
    15 'Normalizat'    .66560       1.0000         .10000E-01   10.000    
    16 'Prefactor '    1.0532       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .6980E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   20815.07     FROM MIGRAD    STATUS=CONVERGED    114 CALLS     1119 TOTAL
                     EDM=   .64E-10  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .6%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     10.315        8.4055       -.41388E-07    .97036E-04
   2  Prefactor     3.8731        7.3064       -.45990E-07    .98750E-03
   3  Prefactor     .61617E-08    48.390       -.16098E-05** at limit **
   4  norm          .31360        .41539       -.64253E-07    .59710E-02
   5  Prefactor     47.707        4.2982       -.67568E-07   -.77047E-02
   6  norm          8.6112        5.3340        .74554E-07    .58334E-03
   7  Prefactor     7.2915        1.5989        .23424E-07   -.12845E-01
   8  Prefactor     30.539        1.4905        .86882E-08    .35551E-01
   9  Prefactor      .0000        6.8655       -.13099E-06** at limit **
  10  Prefactor     10.612        10.804       -.14356E-06    .23938E-03
  11  Prefactor      .0000        19.723       -.36069E-07** at limit **
  12  norm          4.3561        2.4509        .43885E-07   -.65554E-03
  13  Prefactor      .0000        33.352       -.17711E-06** at limit **
  14  Prefactor      .0000        2.1843       -.35283E-06** at limit **
  15  Normalizat    .66623        .18251       -.22116E-05    .33052E-04
  16  Prefactor     1.0533        .64393E-01   -.10689E-05    .10532E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 10.3149
  Prefactor  = 3.87313
  Prefactor  = 6.16174e-09
  norm       = 0.313599
  Prefactor  = 47.7073
  norm       = 8.61123
  Prefactor  = 7.29148
  Prefactor  = 30.5389
  Prefactor  = 0
  Prefactor  = 10.6117
  Prefactor  = 0
  norm       = 4.35611
  Prefactor  = 0
  Prefactor  = 0
  Normalizat = 0.666231
  Prefactor  = 1.05325
 **********
 **   18 **HESSE 
 **********

 FCN=   20815.07     FROM HESSE     STATUS=OK           245 CALLS     1364 TOTAL
                     EDM=   .14E-07    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     10.315        8.4871        .31102E-03   -1.5644    
   2  Prefactor     3.8731        7.6876        .50995E-03   -1.5669    
   3  Prefactor     .61617E-08    48.631        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  norm          .31360        .45574        .10045E-02   -1.5697    
   5  Prefactor     47.707        32.917        .14401E-03   -1.5570    
   6  norm          8.6112        5.5332        .34164E-03   -1.5649    
   7  Prefactor     7.2915        12.011        .37172E-03   -1.5654    
   8  Prefactor     30.539        12.174        .18104E-03   -1.5597    
   9  Prefactor      .0000        6.9152        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     10.612        10.944        .30490E-03   -1.5643    
  11  Prefactor      .0000        19.759        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  norm          4.3561        2.4567        .48226E-03   -1.5666    
  13  Prefactor      .0000        5.3279        .11974E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor      .0000        2.1758        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Normalizat    .66623        .17892        .11460       -1.0524    
  16  Prefactor     1.0533        .59015E-01    .39726E-01   -.90975    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.40294e-08
Minuit parameter uncertainties:
  1  8.48712
  2  7.68766
  3  0.00109245
  4  0.455743
  5  32.9172
  6  5.53319
  7  12.0107
  8  12.1742
  9  8.83682e-06
  10  10.9443
  11  1.82525e-05
  12  2.45666
  13  1.94412e-07
  14  4.3839e-06
  15  0.179074
  16  0.0590189
p gtdiffrsp evfile=/lscratch/kocevski/19665356/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/19665356/Model_4FGL_J2049.9+1002_weekly_bin780.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 Cygnus Loop
adding source EG_v02
adding source GAL_V02
adding source W 51C
Working on...
/lscratch/kocevski/19665356/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits.....................!
real 143.26
user 140.97
sys 0.71

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/19665356/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits', '/lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits', expMap='/lscratch/kocevski/19665356/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', expCube='/lscratch/kocevski/19665356/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/19665356/Model_4FGL_J2049.9+1002_weekly_bin780.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J2049.9+1002'

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  4.360e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/19665356/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits
Spacecraft file(s): /lscratch/kocevski/19665356/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure map: /lscratch/kocevski/19665356/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure cube: /lscratch/kocevski/19665356/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/19665356/Model_4FGL_J2049.9+1002_weekly_bin780.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) = 20815.0911766

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    10.362       1.0000          .0000       .10000E+07
     2 'Prefactor '    3.9105       1.0000          .0000       .10000E+07
     3 'Prefactor '    .11742E-03   1.0000          .0000       .10000E+07
     4 'norm      '    .31229       1.0000          .0000       .10000E+07
     5 'Prefactor '    48.228       1.0000          .0000       .10000E+07
     6 'norm      '    8.5971       1.0000          .0000       .10000E+07
     7 'Prefactor '    7.2719       1.0000          .0000       .10000E+07
     8 'Prefactor '    30.520       1.0000          .0000       .10000E+07
     9 'Prefactor '    .18355E-03   1.0000          .0000       .10000E+07
    10 'Prefactor '    10.780       1.0000          .0000       .10000E+07
    11 'Prefactor '    .19893E-02   1.0000          .0000       .10000E+07
    12 'norm      '    4.3578       1.0000          .0000       .10000E+07
    13 'Prefactor '    .16573E-01   1.0000          .0000       .10000E+07
    14 'Prefactor '    .50904E-07   1.0000          .0000       .10000E+07
    15 'Normalizat'    .66560       1.0000         .10000E-01   10.000    
    16 'Prefactor '    1.0532       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINDone.

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

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.611e+00  5.533e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.053e+00  5.902e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.662e-01  1.791e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 4.92
Ra Dec: 312.478 10.041
Photon Index (Fixed Index): 2.39 +/- 0.00
Photon Flux (Fixed Index): 4.10e-08 +/- 2.63e-08
Energy Flux (Fixed Index): 1.30e-05 +/- 8.34e-06

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) = 20814.807306
delta logL = 0.262725582732

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 20814.8038598
delta logL = 0.266171759868

Fit tolerance = 1e-08

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

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

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   20814.80     FROM MIGRAD    STATUS=CONVERGED     55 CALLS      214 TOTAL
                     EDM=   .82E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  norm          8.0974        5.8404        .35197E-03    .62946E-03
   2  alpha         1.8562        .55976        .43014       -.10938E-03
   3  Normalizat    .68726        .16544        .11298        .12405E-03
   4  Prefactor     1.0495        .58072E-01    .39942E-01   -.28261E-04
                               ERR DEF=  .500    
Final values: 
  norm       = 8.09736
  alpha      = 1.85624
  Normalizat = 0.687259
  Prefactor  = 1.04947
 **********
 **   18 **HESSE 
 **********

 FCN=   20814.80     FROM HESSE     STATUS=OK            33 CALLS      247 TOTAL
                     EDM=   .28E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  norm          8.0974        5.9856        .14079E-04   -1.5651    
   2  alpha         1.8562        .68259        .29536E-01   -.26044    
   3  Normalizat    .68726        .18250        .50096E-03   -1.0440    
   4  Prefactor     1.0495        .64405E-01    .14514E-03   -.91098    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.75264e-11
Minuit parameter uncertainties:
  1  5.9856
  2  0.692013
  3  0.182658
  4  0.0644093
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) = 20814.8038572
delta logL = 0.2661743233

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.097e+00  5.986e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  1.856e+00  6.920e-01  0.000e+00  5.000e+00 ( 1.000e+00)
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.049e+00  6.441e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.873e-01  1.827e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 5.45
Ra Dec: 312.478 10.041
Photon Index (Free Index): 1.86 +/- 0.69
Photon Flux (Free Index): 2.37e-08 +/- 2.51e-08
Energy Flux (Free Index): 1.42e-05 +/- 9.89e-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/19665276/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='4.10e-08', energy_flux2='1.42e-05', photon_flux_error='2.63e-08', dlogl='2.66e-01', energy_flux='1.30e-05', photon_flux2='2.37e-08', job_status='DONE', time_completed='2023-07-18 02:15:23.726192', photon_index_error2='0.69', photon_index2='1.86', ts='4.92', fit_tolerance='1e-08', GAL='1.05', photon_index_error='0.00', energy_flux_error2='9.89e-06', EG='0.67', time_epoch_completed='1689671723.73', return_code='0', job_id='19665276', GAL2='1.05', EG2='0.69', return_code2='0', energy_flux_error='8.34e-06', photon_flux_error2='2.51e-08', ts2='5.45', photon_index='2.39' WHERE bin_id='780' AND source_name='4FGL J2049.9+1002' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Jul 18 02:15:24 PDT 2023

 outfile=/lscratch/kocevski/19666412/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 17.13
user 16.05
sys 0.26

Generating the exposure map:
time -p gtexpmap evfile=/lscratch/kocevski/19666412/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" expcube=/lscratch/kocevski/19666412/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19666412/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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/19666412/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
.....................!
real 62.37
user 57.61
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 W 51C in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/W51C.fits is the correct path to the extended template.
Extended source Cygnus Loop in ROI, make sure /sdf/group/fermi/g/LCRepository/Likelihood/ExtendedSources/Extended_8years/Templates/CygnusLoop.fits is the correct path to the extended template.
Added 201 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 J2049.9+1002 @ 312.478 10.0407

Creating the counts map:
time -p gtbin evfile=/lscratch/kocevski/19666412/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19666412/cmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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.92
user 0.20
sys 0.14

Creating the high resolution counts map:
time -p gtbin evfile=/lscratch/kocevski/19666412/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits scfile=/lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits outfile=/lscratch/kocevski/19666412/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.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=312.478 yref=10.0407 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 1.18
user 0.20
sys 0.14

Computing the diffuse response:
time -IMIZE    .6980E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   20815.07     FROM MIGRAD    STATUS=CONVERGED    114 CALLS     1119 TOTAL
                     EDM=   .64E-10  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .6%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     10.315        8.4055       -.41388E-07    .97036E-04
   2  Prefactor     3.8731        7.3064       -.45990E-07    .98750E-03
   3  Prefactor     .61617E-08    48.390       -.16098E-05** at limit **
   4  norm          .31360        .41539       -.64253E-07    .59710E-02
   5  Prefactor     47.707        4.2982       -.67568E-07   -.77047E-02
   6  norm          8.6112        5.3340        .74554E-07    .58334E-03
   7  Prefactor     7.2915        1.5989        .23424E-07   -.12845E-01
   8  Prefactor     30.539        1.4905        .86882E-08    .35551E-01
   9  Prefactor      .0000        6.8655       -.13099E-06** at limit **
  10  Prefactor     10.612        10.804       -.14356E-06    .23938E-03
  11  Prefactor      .0000        19.723       -.36069E-07** at limit **
  12  norm          4.3561        2.4509        .43885E-07   -.65554E-03
  13  Prefactor      .0000        33.352       -.17711E-06** at limit **
  14  Prefactor      .0000        2.1843       -.35283E-06** at limit **
  15  Normalizat    .66623        .18251       -.22116E-05    .33052E-04
  16  Prefactor     1.0533        .64393E-01   -.10689E-05    .10532E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 10.3149
  Prefactor  = 3.87313
  Prefactor  = 6.16174e-09
  norm       = 0.313599
  Prefactor  = 47.7073
  norm       = 8.61123
  Prefactor  = 7.29148
  Prefactor  = 30.5389
  Prefactor  = 0
  Prefactor  = 10.6117
  Prefactor  = 0
  norm       = 4.35611
  Prefactor  = 0
  Prefactor  = 0
  Normalizat = 0.666231
  Prefactor  = 1.05325
 **********
 **   18 **HESSE 
 **********

 FCN=   20815.07     FROM HESSE     STATUS=OK           245 CALLS     1364 TOTAL
                     EDM=   .14E-07    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     10.315        8.4871        .31102E-03   -1.5644    
   2  Prefactor     3.8731        7.6876        .50995E-03   -1.5669    
   3  Prefactor     .61617E-08    48.631        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  norm          .31360        .45574        .10045E-02   -1.5697    
   5  Prefactor     47.707        32.917        .14401E-03   -1.5570    
   6  norm          8.6112        5.5332        .34164E-03   -1.5649    
   7  Prefactor     7.2915        12.011        .37172E-03   -1.5654    
   8  Prefactor     30.539        12.174        .18104E-03   -1.5597    
   9  Prefactor      .0000        6.9152        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     10.612        10.944        .30490E-03   -1.5643    
  11  Prefactor      .0000        19.759        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  norm          4.3561        2.4567        .48226E-03   -1.5666    
  13  Prefactor      .0000        5.3279        .11974E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor      .0000        2.1758        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Normalizat    .66623        .17892        .11460       -1.0524    
  16  Prefactor     1.0533        .59015E-01    .39726E-01   -.90975    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.40294e-08
Minuit parameter uncertainties:
  1  8.48712
  2  7.68766
  3  0.00109245
  4  0.455743
  5  32.9172
  6  5.53319
  7  12.0107
  8  12.1742
  9  8.83682e-06
  10  10.9443
  11  1.82525e-05
  12  2.45666
  13  1.94412e-07
  14  4.3839e-06
  15  0.179074
  16  0.0590189
Done.

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

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.611e+00  5.533e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.053e+00  5.902e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.662e-01  1.791e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 4.92
Ra Dec: 312.478 10.041
Photon Index (Fixed Index): 2.39 +/- 0.00
Photon Flux (Fixed Index): 4.10e-08 +/- 2.63e-08
Energy Flux (Fixed Index): 1.30e-05 +/- 8.34e-06

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) = 20814.807306
delta logL = 0.262725582732

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 20814.8038598
delta logL = 0.266171759868

Fit tolerance = 1e-08

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

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

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   20814.80     FROM MIGRAD    STATUS=CONVERGED     55 CALLS      214 TOTAL
                     EDM=   .82E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  norm          8.0974        5.8404        .35197E-03    .62946E-03
   2  alpha         1.8562        .55976        .43014       -.10938E-03
   3  Normalizat    .68726        .16544        .11298        .12405E-03
   4  Prefactor     1.0495        .58072E-01    .39942E-01   -.28261E-04
                               ERR DEF=  .500    
Final values: 
  norm       = 8.09736
  alpha      = 1.85624
  Normalizat = 0.687259
  Prefactor  = 1.04947
 **********
 **   18 **HESSE 
 **********

 FCN=   20814.80     FROM HESSE     STATUS=OK            33 CALLS      247 TOTAL
                     EDM=   .28E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  norm          8.0974        5.9856        .14079E-04   -1.5651    
   2  alpha         1.8562        .68259        .29536E-01   -.26044    
   3  Normalizat    .68726        .18250        .50096E-03   -1.0440    
   4  Prefactor     1.0495        .64405E-01    .14514E-03   -.91098    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.75264e-11
Minuit parameter uncertainties:
  1  5.9856
  2  0.692013
  3  0.182658
  4  0.0644093
p gtdiffrsp evfile=/lscratch/kocevski/19665804/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/19665804/Model_4FGL_J2049.9+1002_weekly_bin780.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 Cygnus Loop
adding source EG_v02
adding source GAL_V02
adding source W 51C
Working on...
/lscratch/kocevski/19665804/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits.....................!
real 142.53
user 139.89
sys 0.96

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/19665804/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits', '/lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits', expMap='/lscratch/kocevski/19665804/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', expCube='/lscratch/kocevski/19665804/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/19665804/Model_4FGL_J2049.9+1002_weekly_bin780.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J2049.9+1002'

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  4.360e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/19665804/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits
Spacecraft file(s): /lscratch/kocevski/19665804/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure map: /lscratch/kocevski/19665804/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure cube: /lscratch/kocevski/19665804/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/19665804/Model_4FGL_J2049.9+1002_weekly_bin780.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) = 20815.0911766

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    10.362       1.0000          .0000       .10000E+07
     2 'Prefactor '    3.9105       1.0000          .0000       .10000E+07
     3 'Prefactor '    .11742E-03   1.0000          .0000       .10000E+07
     4 'norm      '    .31229       1.0000          .0000       .10000E+07
     5 'Prefactor '    48.228       1.0000          .0000       .10000E+07
     6 'norm      '    8.5971       1.0000          .0000       .10000E+07
     7 'Prefactor '    7.2719       1.0000          .0000       .10000E+07
     8 'Prefactor '    30.520       1.0000          .0000       .10000E+07
     9 'Prefactor '    .18355E-03   1.0000          .0000       .10000E+07
    10 'Prefactor '    10.780       1.0000          .0000       .10000E+07
    11 'Prefactor '    .19893E-02   1.0000          .0000       .10000E+07
    12 'norm      '    4.3578       1.0000          .0000       .10000E+07
    13 'Prefactor '    .16573E-01   1.0000          .0000       .10000E+07
    14 'Prefactor '    .50904E-07   1.0000          .0000       .10000E+07
    15 'Normalizat'    .66560       1.0000         .10000E-01   10.000    
    16 'Prefactor '    1.0532       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINshell-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) = 20814.8038572
delta logL = 0.2661743233

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.097e+00  5.986e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  1.856e+00  6.920e-01  0.000e+00  5.000e+00 ( 1.000e+00)
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.049e+00  6.441e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.873e-01  1.827e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 5.45
Ra Dec: 312.478 10.041
Photon Index (Free Index): 1.86 +/- 0.69
Photon Flux (Free Index): 2.37e-08 +/- 2.51e-08
Energy Flux (Free Index): 1.42e-05 +/- 9.89e-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/19665356/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='4.10e-08', energy_flux2='1.42e-05', photon_flux_error='2.63e-08', dlogl='2.66e-01', energy_flux='1.30e-05', photon_flux2='2.37e-08', job_status='DONE', time_completed='2023-07-18 02:16:29.497959', photon_index_error2='0.69', photon_index2='1.86', ts='4.92', fit_tolerance='1e-08', GAL='1.05', photon_index_error='0.00', energy_flux_error2='9.89e-06', EG='0.67', time_epoch_completed='1689671789.5', return_code='0', job_id='19665356', GAL2='1.05', EG2='0.69', return_code2='0', energy_flux_error='8.34e-06', photon_flux_error2='2.51e-08', ts2='5.45', photon_index='2.39' WHERE bin_id='780' AND source_name='4FGL J2049.9+1002' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Jul 18 02:16:30 PDT 2023

IMIZE    .6980E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   20815.07     FROM MIGRAD    STATUS=CONVERGED    114 CALLS     1119 TOTAL
                     EDM=   .64E-10  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .6%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     10.315        8.4055       -.41388E-07    .97036E-04
   2  Prefactor     3.8731        7.3064       -.45990E-07    .98750E-03
   3  Prefactor     .61617E-08    48.390       -.16098E-05** at limit **
   4  norm          .31360        .41539       -.64253E-07    .59710E-02
   5  Prefactor     47.707        4.2982       -.67568E-07   -.77047E-02
   6  norm          8.6112        5.3340        .74554E-07    .58334E-03
   7  Prefactor     7.2915        1.5989        .23424E-07   -.12845E-01
   8  Prefactor     30.539        1.4905        .86882E-08    .35551E-01
   9  Prefactor      .0000        6.8655       -.13099E-06** at limit **
  10  Prefactor     10.612        10.804       -.14356E-06    .23938E-03
  11  Prefactor      .0000        19.723       -.36069E-07** at limit **
  12  norm          4.3561        2.4509        .43885E-07   -.65554E-03
  13  Prefactor      .0000        33.352       -.17711E-06** at limit **
  14  Prefactor      .0000        2.1843       -.35283E-06** at limit **
  15  Normalizat    .66623        .18251       -.22116E-05    .33052E-04
  16  Prefactor     1.0533        .64393E-01   -.10689E-05    .10532E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 10.3149
  Prefactor  = 3.87313
  Prefactor  = 6.16174e-09
  norm       = 0.313599
  Prefactor  = 47.7073
  norm       = 8.61123
  Prefactor  = 7.29148
  Prefactor  = 30.5389
  Prefactor  = 0
  Prefactor  = 10.6117
  Prefactor  = 0
  norm       = 4.35611
  Prefactor  = 0
  Prefactor  = 0
  Normalizat = 0.666231
  Prefactor  = 1.05325
 **********
 **   18 **HESSE 
 **********

 FCN=   20815.07     FROM HESSE     STATUS=OK           245 CALLS     1364 TOTAL
                     EDM=   .14E-07    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     10.315        8.4871        .31102E-03   -1.5644    
   2  Prefactor     3.8731        7.6876        .50995E-03   -1.5669    
   3  Prefactor     .61617E-08    48.631        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  norm          .31360        .45574        .10045E-02   -1.5697    
   5  Prefactor     47.707        32.917        .14401E-03   -1.5570    
   6  norm          8.6112        5.5332        .34164E-03   -1.5649    
   7  Prefactor     7.2915        12.011        .37172E-03   -1.5654    
   8  Prefactor     30.539        12.174        .18104E-03   -1.5597    
   9  Prefactor      .0000        6.9152        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     10.612        10.944        .30490E-03   -1.5643    
  11  Prefactor      .0000        19.759        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  norm          4.3561        2.4567        .48226E-03   -1.5666    
  13  Prefactor      .0000        5.3279        .11974E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor      .0000        2.1758        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Normalizat    .66623        .17892        .11460       -1.0524    
  16  Prefactor     1.0533        .59015E-01    .39726E-01   -.90975    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.40294e-08
Minuit parameter uncertainties:
  1  8.48712
  2  7.68766
  3  0.00109245
  4  0.455743
  5  32.9172
  6  5.53319
  7  12.0107
  8  12.1742
  9  8.83682e-06
  10  10.9443
  11  1.82525e-05
  12  2.45666
  13  1.94412e-07
  14  4.3839e-06
  15  0.179074
  16  0.0590189
Done.

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

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.611e+00  5.533e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.053e+00  5.902e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.662e-01  1.791e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 4.92
Ra Dec: 312.478 10.041
Photon Index (Fixed Index): 2.39 +/- 0.00
Photon Flux (Fixed Index): 4.10e-08 +/- 2.63e-08
Energy Flux (Fixed Index): 1.30e-05 +/- 8.34e-06

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) = 20814.807306
delta logL = 0.262725582732

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 20814.8038598
delta logL = 0.266171759868

Fit tolerance = 1e-08

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

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

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   20814.80     FROM MIGRAD    STATUS=CONVERGED     55 CALLS      214 TOTAL
                     EDM=   .82E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  norm          8.0974        5.8404        .35197E-03    .62946E-03
   2  alpha         1.8562        .55976        .43014       -.10938E-03
   3  Normalizat    .68726        .16544        .11298        .12405E-03
   4  Prefactor     1.0495        .58072E-01    .39942E-01   -.28261E-04
                               ERR DEF=  .500    
Final values: 
  norm       = 8.09736
  alpha      = 1.85624
  Normalizat = 0.687259
  Prefactor  = 1.04947
 **********
 **   18 **HESSE 
 **********

 FCN=   20814.80     FROM HESSE     STATUS=OK            33 CALLS      247 TOTAL
                     EDM=   .28E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  norm          8.0974        5.9856        .14079E-04   -1.5651    
   2  alpha         1.8562        .68259        .29536E-01   -.26044    
   3  Normalizat    .68726        .18250        .50096E-03   -1.0440    
   4  Prefactor     1.0495        .64405E-01    .14514E-03   -.91098    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.75264e-11
Minuit parameter uncertainties:
  1  5.9856
  2  0.692013
  3  0.182658
  4  0.0644093
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) = 20814.8038572
delta logL = 0.2661743233

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.097e+00  5.986e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  1.856e+00  6.920e-01  0.000e+00  5.000e+00 ( 1.000e+00)
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.049e+00  6.441e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.873e-01  1.827e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 5.45
Ra Dec: 312.478 10.041
Photon Index (Free Index): 1.86 +/- 0.69
Photon Flux (Free Index): 2.37e-08 +/- 2.51e-08
Energy Flux (Free Index): 1.42e-05 +/- 9.89e-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/19665804/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='4.10e-08', energy_flux2='1.42e-05', photon_flux_error='2.63e-08', dlogl='2.66e-01', energy_flux='1.30e-05', photon_flux2='2.37e-08', job_status='DONE', time_completed='2023-07-18 02:17:40.568763', photon_index_error2='0.69', photon_index2='1.86', ts='4.92', fit_tolerance='1e-08', GAL='1.05', photon_index_error='0.00', energy_flux_error2='9.89e-06', EG='0.67', time_epoch_completed='1689671860.57', return_code='0', job_id='19665804', GAL2='1.05', EG2='0.69', return_code2='0', energy_flux_error='8.34e-06', photon_flux_error2='2.51e-08', ts2='5.45', photon_index='2.39' WHERE bin_id='780' AND source_name='4FGL J2049.9+1002' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Jul 18 02:17:41 PDT 2023

p gtdiffrsp evfile=/lscratch/kocevski/19666412/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits evtable="EVENTS" scfile=/lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits sctable="SC_DATA" srcmdl=/lscratch/kocevski/19666412/Model_4FGL_J2049.9+1002_weekly_bin780.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 Cygnus Loop
adding source EG_v02
adding source GAL_V02
adding source W 51C
Working on...
/lscratch/kocevski/19666412/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits.....................!
real 142.42
user 139.65
sys 1.05

Creating the likelihood object...
obs = UnbinnedObs('/lscratch/kocevski/19666412/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits', '/lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits', expMap='/lscratch/kocevski/19666412/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', expCube='/lscratch/kocevski/19666412/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits', irfs='P8R3_SOURCE_V2')
like = UnbinnedAnalysis(obs, '/lscratch/kocevski/19666412/Model_4FGL_J2049.9+1002_weekly_bin780.xml', optimizer='MINUIT')

Using source of interest name: '4FGL J2049.9+1002'

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  4.360e+00  0.000e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed


Likelihood Fit Parameters:
Event file(s): /lscratch/kocevski/19666412/ft1_filtered_4FGL_J2049.9+1002_weekly_bin780.fits
Spacecraft file(s): /lscratch/kocevski/19666412/ft2_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure map: /lscratch/kocevski/19666412/expmap_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
Exposure cube: /lscratch/kocevski/19666412/ltcube_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.fits
IRFs: P8R3_SOURCE_V2
Source model file: /lscratch/kocevski/19666412/Model_4FGL_J2049.9+1002_weekly_bin780.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) = 20815.0911766

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

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

Fit tolerance = 1e-08

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

 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 'Prefactor '    10.362       1.0000          .0000       .10000E+07
     2 'Prefactor '    3.9105       1.0000          .0000       .10000E+07
     3 'Prefactor '    .11742E-03   1.0000          .0000       .10000E+07
     4 'norm      '    .31229       1.0000          .0000       .10000E+07
     5 'Prefactor '    48.228       1.0000          .0000       .10000E+07
     6 'norm      '    8.5971       1.0000          .0000       .10000E+07
     7 'Prefactor '    7.2719       1.0000          .0000       .10000E+07
     8 'Prefactor '    30.520       1.0000          .0000       .10000E+07
     9 'Prefactor '    .18355E-03   1.0000          .0000       .10000E+07
    10 'Prefactor '    10.780       1.0000          .0000       .10000E+07
    11 'Prefactor '    .19893E-02   1.0000          .0000       .10000E+07
    12 'norm      '    4.3578       1.0000          .0000       .10000E+07
    13 'Prefactor '    .16573E-01   1.0000          .0000       .10000E+07
    14 'Prefactor '    .50904E-07   1.0000          .0000       .10000E+07
    15 'Normalizat'    .66560       1.0000         .10000E-01   10.000    
    16 'Prefactor '    1.0532       1.0000          .0000       10.000    
 **********
 **   15 **SET ERR    .5000    
 **********
 **********
 **   16 **SET GRAD    1.000    
 **********
 **********
 **   17 **MINIMIZE    .6980E+05   .2000E-04
 **********

 MIGRAD MINIMIZATION HAS CONVERGED.

 FCN=   20815.07     FROM MIGRAD    STATUS=CONVERGED    114 CALLS     1119 TOTAL
                     EDM=   .64E-10  STRATEGY=1  ERROR MATRIX UNCERTAINTY=   .6%

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  Prefactor     10.315        8.4055       -.41388E-07    .97036E-04
   2  Prefactor     3.8731        7.3064       -.45990E-07    .98750E-03
   3  Prefactor     .61617E-08    48.390       -.16098E-05** at limit **
   4  norm          .31360        .41539       -.64253E-07    .59710E-02
   5  Prefactor     47.707        4.2982       -.67568E-07   -.77047E-02
   6  norm          8.6112        5.3340        .74554E-07    .58334E-03
   7  Prefactor     7.2915        1.5989        .23424E-07   -.12845E-01
   8  Prefactor     30.539        1.4905        .86882E-08    .35551E-01
   9  Prefactor      .0000        6.8655       -.13099E-06** at limit **
  10  Prefactor     10.612        10.804       -.14356E-06    .23938E-03
  11  Prefactor      .0000        19.723       -.36069E-07** at limit **
  12  norm          4.3561        2.4509        .43885E-07   -.65554E-03
  13  Prefactor      .0000        33.352       -.17711E-06** at limit **
  14  Prefactor      .0000        2.1843       -.35283E-06** at limit **
  15  Normalizat    .66623        .18251       -.22116E-05    .33052E-04
  16  Prefactor     1.0533        .64393E-01   -.10689E-05    .10532E-03
                               ERR DEF=  .500    
Final values: 
  Prefactor  = 10.3149
  Prefactor  = 3.87313
  Prefactor  = 6.16174e-09
  norm       = 0.313599
  Prefactor  = 47.7073
  norm       = 8.61123
  Prefactor  = 7.29148
  Prefactor  = 30.5389
  Prefactor  = 0
  Prefactor  = 10.6117
  Prefactor  = 0
  norm       = 4.35611
  Prefactor  = 0
  Prefactor  = 0
  Normalizat = 0.666231
  Prefactor  = 1.05325
 **********
 **   18 **HESSE 
 **********

 FCN=   20815.07     FROM HESSE     STATUS=OK           245 CALLS     1364 TOTAL
                     EDM=   .14E-07    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  Prefactor     10.315        8.4871        .31102E-03   -1.5644    
   2  Prefactor     3.8731        7.6876        .50995E-03   -1.5669    
   3  Prefactor     .61617E-08    48.631        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
   4  norm          .31360        .45574        .10045E-02   -1.5697    
   5  Prefactor     47.707        32.917        .14401E-03   -1.5570    
   6  norm          8.6112        5.5332        .34164E-03   -1.5649    
   7  Prefactor     7.2915        12.011        .37172E-03   -1.5654    
   8  Prefactor     30.539        12.174        .18104E-03   -1.5597    
   9  Prefactor      .0000        6.9152        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  10  Prefactor     10.612        10.944        .30490E-03   -1.5643    
  11  Prefactor      .0000        19.759        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  12  norm          4.3561        2.4567        .48226E-03   -1.5666    
  13  Prefactor      .0000        5.3279        .11974E-01   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  14  Prefactor      .0000        2.1758        .42118E-03   -1.5708    
                                 WARNING -   - ABOVE PARAMETER IS AT LIMIT.
  15  Normalizat    .66623        .17892        .11460       -1.0524    
  16  Prefactor     1.0533        .59015E-01    .39726E-01   -.90975    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 1.40294e-08
Minuit parameter uncertainties:
  1  8.48712
  2  7.68766
  3  0.00109245
  4  0.455743
  5  32.9172
  6  5.53319
  7  12.0107
  8  12.1742
  9  8.83682e-06
  10  10.9443
  11  1.82525e-05
  12  2.45666
  13  1.94412e-07
  14  4.3839e-06
  15  0.179074
  16  0.0590189
Done.

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

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.611e+00  5.533e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  2.394e+00  0.000e+00  0.000e+00  5.000e+00 ( 1.000e+00) fixed
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.053e+00  5.902e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.662e-01  1.791e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Fixed Index): 4.92
Ra Dec: 312.478 10.041
Photon Index (Fixed Index): 2.39 +/- 0.00
Photon Flux (Fixed Index): 4.10e-08 +/- 2.63e-08
Energy Flux (Fixed Index): 1.30e-05 +/- 8.34e-06

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) = 20814.807306
delta logL = 0.262725582732

Fit tolerance = 0.0001

Performing likelihood fit...
Done.

MINUIT Return Code (Free Index): 0
logL (Free Index) = 20814.8038598
delta logL = 0.266171759868

Fit tolerance = 1e-08

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

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

 MIGRAD MINIMIZATION HAS CONVERGED.

 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.

 FCN=   20814.80     FROM MIGRAD    STATUS=CONVERGED     55 CALLS      214 TOTAL
                     EDM=   .82E-09    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE 
   1  norm          8.0974        5.8404        .35197E-03    .62946E-03
   2  alpha         1.8562        .55976        .43014       -.10938E-03
   3  Normalizat    .68726        .16544        .11298        .12405E-03
   4  Prefactor     1.0495        .58072E-01    .39942E-01   -.28261E-04
                               ERR DEF=  .500    
Final values: 
  norm       = 8.09736
  alpha      = 1.85624
  Normalizat = 0.687259
  Prefactor  = 1.04947
 **********
 **   18 **HESSE 
 **********

 FCN=   20814.80     FROM HESSE     STATUS=OK            33 CALLS      247 TOTAL
                     EDM=   .28E-10    STRATEGY= 1      ERROR MATRIX ACCURATE 

  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME        VALUE          ERROR       STEP SIZE       VALUE   
   1  norm          8.0974        5.9856        .14079E-04   -1.5651    
   2  alpha         1.8562        .68259        .29536E-01   -.26044    
   3  Normalizat    .68726        .18250        .50096E-03   -1.0440    
   4  Prefactor     1.0495        .64405E-01    .14514E-03   -.91098    
                               ERR DEF=  .500    
Minuit fit quality: 3   estimated distance: 2.75264e-11
Minuit parameter uncertainties:
  1  5.9856
  2  0.692013
  3  0.182658
  4  0.0644093
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) = 20814.8038572
delta logL = 0.2661743233

Extracting fit parameters...

4FGL J2049.9+1002
   Spectrum: LogParabola
407         norm:  8.097e+00  5.986e+00  0.000e+00  1.000e+06 ( 1.000e-12)
408        alpha:  1.856e+00  6.920e-01  0.000e+00  5.000e+00 ( 1.000e+00)
409         beta:  1.463e-01  0.000e+00 -5.000e+00  1.000e+01 ( 1.000e+00) fixed
410           Eb:  6.403e+02  0.000e+00  3.000e+01  5.000e+05 ( 1.000e+00) fixed

GAL_V02
   Spectrum: PowerLaw
691    Prefactor:  1.049e+00  6.441e-02  0.000e+00  1.000e+01 ( 1.000e+00)
692        Index:  0.000e+00  0.000e+00 -1.000e+00  1.000e+00 ( 1.000e+00) fixed
693        Scale:  1.000e+02  0.000e+00  5.000e+01  2.000e+02 ( 1.000e+00) fixed

EG_v02
   Spectrum: FileFunction
690   Normalization:  6.873e-01  1.827e-01  1.000e-02  1.000e+01 ( 1.000e+00)


TS (Free Index): 5.45
Ra Dec: 312.478 10.041
Photon Index (Free Index): 1.86 +/- 0.69
Photon Flux (Free Index): 2.37e-08 +/- 2.51e-08
Energy Flux (Free Index): 1.42e-05 +/- 9.89e-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/19666412/cmap_HighResolution_710726401_711331201_4FGL_J2049.9+1002_weekly_bin780.png

Cleaning up...

** Nuclear option initiated! **

Updating database...

UPDATE lightcurve_data_v2 SET comment='SUCCESS', photon_flux='4.10e-08', energy_flux2='1.42e-05', photon_flux_error='2.63e-08', dlogl='2.66e-01', energy_flux='1.30e-05', photon_flux2='2.37e-08', job_status='DONE', time_completed='2023-07-18 02:21:26.235918', photon_index_error2='0.69', photon_index2='1.86', ts='4.92', fit_tolerance='1e-08', GAL='1.05', photon_index_error='0.00', energy_flux_error2='9.89e-06', EG='0.67', time_epoch_completed='1689672086.24', return_code='0', job_id='19666412', GAL2='1.05', EG2='0.69', return_code2='0', energy_flux_error='8.34e-06', photon_flux_error2='2.51e-08', ts2='5.45', photon_index='2.39' WHERE bin_id='780' AND source_name='4FGL J2049.9+1002' AND cadence='weekly';

Database successfully updated.


Analysis Complete.


Tue Jul 18 02:21:27 PDT 2023

