Esempio n. 1
0
)

background_estimator.run()


# In[ ]:


# print(background_estimator.result[0])


# In[ ]:


plt.figure(figsize=(8, 8))
background_estimator.plot()


# ## Source statistic
# 
# Next we're going to look at the overall source statistics in our signal region. For more info about what debug plots you can create check out the [ObservationSummary](http://docs.gammapy.org/dev/api/gammapy.data.ObservationSummary.html#gammapy.data.ObservationSummary) class.

# In[ ]:


stats = []
for obs, bkg in zip(obs_list, background_estimator.result):
    stats.append(ObservationStats.from_obs(obs, bkg))

print(stats[1])
background_estimator = ReflectedRegionsBackgroundEstimator(
    observations=observations,
    on_region=on_region,
    exclusion_mask=exclusion_mask,
)

background_estimator.run()

# In[ ]:

# print(background_estimator.result[0])

# In[ ]:

plt.figure(figsize=(8, 8))
background_estimator.plot(add_legend=True)

# ## Source statistic
#
# Next we're going to look at the overall source statistics in our signal region. For more info about what debug plots you can create check out the [ObservationSummary](https://docs.gammapy.org/0.10/api/gammapy.data.ObservationSummary.html#gammapy.data.ObservationSummary) class.

# In[ ]:

stats = []
for obs, bkg in zip(observations, background_estimator.result):
    stats.append(ObservationStats.from_observation(obs, bkg))

print(stats[1])

obs_summary = ObservationSummary(stats)
fig = plt.figure(figsize=(10, 6))
Esempio n. 3
0
    xref=image_center.l.deg,
    yref=image_center.b.deg,
    proj='TAN',
    coordsys='GAL',
)

exclusion_mask = exclusion_mask.region_mask(exclusion_region)
exclusion_mask.data = 1. - exclusion_mask.data

background_estimator = ReflectedRegionsBackgroundEstimator(
    obs_list=obs_list, on_region=on_region, exclusion_mask=exclusion_mask)

background_estimator.run()

plt.figure(figsize=(8, 8))
bkg_ex_plot = background_estimator.plot()
plt.show(bkg_ex_plot)

#######################
stats = []
for obs, bkg in zip(obs_list, background_estimator.result):
    stats.append(ObservationStats.from_obs(obs, bkg))

print(stats[1])

obs_summary = ObservationSummary(stats)
fig = plt.figure(figsize=(10, 6))
ax1 = fig.add_subplot(121)

aa = obs_summary.plot_excess_vs_livetime(ax=ax1)
ax2 = fig.add_subplot(122)