Sat May  8 05:11:22 PDT 2021
from time import perf_counter
from wtlike import WtLike, Config, PointSource, PoissonRep
from utilities.ipynb_docgen import *

config = Config() 
source = PointSource('BL Lac')
wtl = WtLike('BL Lac', clear=False)
photons and exposure for BL Lac: Restoring from cache with key "BL Lac__data"
BBanalysis: Source BL Lac with:
	 data:       404,789 photons from   2008-08-04 to 2021-04-28
	 exposure: 3,171,944 intervals from 2008-08-04 to 2021-04-28
Rebin with 4650 1-day from 54683.0 to 59333.0
renormalizing exposure to fraction of total: total, sum: 72355436 1
Loaded 4522 / 4522 cells with exposure > 1e-06 for light curve analysis
L = wtl.full_likelihood(); PoissonRep(L).info()
{'flux': 1.0, 'ts': 96666.9, 'errors': (0.005, -0.005), 'limit': 1.0082}
pd.set_option('display.precision', 4)
pd.Series(PoissonRep(wtl.full_likelihood()).info())
flux                    1
ts              9.667e+04
errors    (0.005, -0.005)
limit               1.008
dtype: object
wtl.plot_flux(source_name=source.name, )
wtl1 = wtl.rebinned_copy((-3,0, 1/24))
wtl1.plot_flux(tzero=59330, fmt='o', source_name=source.name);
plt.gca().axhline(0, color='grey', ls='--');
Rebin with 72 1-hour from 59330.0 to 59333.0
renormalizing exposure to fraction of total: total, sum: 4064761 1
The new range is within old--bin exposure factor 17.8
Loaded 66 / 66 cells with exposure > 1e-06 for light curve analysis
wtl2 = wtl.rebinned_copy((59331, 59331.5, 5/24/60))
Rebin with 144 5-min from 59331.0 to 59331.5
renormalizing exposure to fraction of total: total, sum: 348999 1
The new range is within old--bin exposure factor 207.3
Loaded 52 / 52 cells with exposure > 1e-06 for light curve analysis
wtl2.plot_flux(tzero=59331, fmt='o',source_name=source.name);
plt.gca().axhline(0, color='grey', ls='--');
wtl2.flux_table().head()
t tw n flux ts errors limit
0 59331.0017 0.0035 4 0.4410 2.4 (-0.337, 0.562) 1.8547
1 59331.0052 0.0035 9 0.6632 2.6 (-0.455, 0.604) 1.9476
2 59331.0087 0.0035 1 0.0000 0.0 (0, 0.085) 0.5108
3 59331.0122 0.0035 6 0.1712 1.0 (-0.171, 0.293) 0.9274
4 59331.0156 0.0035 7 0.5114 5.1 (-0.289, 0.406) 1.4082