Coverage for lst_auto_rta/Analyse_DL3.py: 0%
34 statements
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-17 14:47 +0000
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-17 14:47 +0000
1import os
2import warnings
4import matplotlib.colors as mcolors
5import matplotlib.pyplot as plt
6import numpy as np
8# import DL2_Analysis_Wobble
9import Plot_DL1_event
10from gammapy.data import DataStore, EventList
11from SourceAnalyse import event
13warnings.filterwarnings("ignore")
14warnings.simplefilter("ignore")
15import glob
16import time
18import toml
19from PIL import Image
22def CreatePlots(id_=0):
23 directory = "/home/sami.caroff/DL3_Fake_RTA/mergedDL3/"
25 datastore = DataStore.from_dir(directory)
27 Analysis = event(directory, [9952])
28 # Analysis = event(directory,[9917,9918,9919,9920])
30 # Analysis.create_on_region(330.68,42.28) #BL Lac
31 Analysis.create_on_region(166.108, 38.21) # Mrk421
32 # Analysis.create_on_region()
33 Analysis.create_exclusion_mask()
34 Analysis.reduction_chain()
35 Analysis.data_maker()
36 Analysis.data_run()
37 Analysis.signal_info()
38 Analysis.fit_spectrum()
40 Analysis.plot_timee(id_=id_)
41 excess_reflected, excess_reflected_uncertainty, c, d, sig_reflected, sig_livetime = Analysis.signal_info()
42 Analysis.flux_plot(plot=False, id_=id_)
44 Analysis.calculate_acceptance_model(plot=False)
45 Analysis.add_acceptance_map()
46 Analysis.map_geometry(plot=False)
47 ring_excess, ring_sqrt_ts, ring_bg, uncertainty_excess_ring = Analysis.ring_data_estimation()
48 Analysis.excess_significance_plot(plot=True, id_=id_)
49 # Analysis.off_distribution_plot(plot=False)
50 return (
51 excess_reflected,
52 excess_reflected_uncertainty,
53 sig_reflected,
54 sig_livetime,
55 ring_excess,
56 uncertainty_excess_ring,
57 ring_sqrt_ts,
58 )