1
|
def hap:
|
2
|
|
3
|
on_region = load_region('user input')
|
4
|
exclusion_regions = load_region('user input')
|
5
|
GObservations obs = load_obs('user input filename')
|
6
|
models = GModels('models.xml')
|
7
|
energy_bounds = GEbounds('user input filename')
|
8
|
|
9
|
runs = GCTAOnOffObservations(obs, energy_bounds, models)
|
10
|
runs.set_debug_level(3)
|
11
|
|
12
|
for run in runs.spectra:
|
13
|
|
14
|
run.set_on_region(on_region)
|
15
|
run.set_exclusion_regions(exclusion_regions)
|
16
|
|
17
|
|
18
|
run.compute_off_regions()
|
19
|
run.fill_spectra()
|
20
|
|
21
|
for run in runs.observations:
|
22
|
run.compute_bg_acceptance()
|
23
|
for run in runs.observations:
|
24
|
run.compute_response()
|
25
|
|
26
|
runs.save()
|
27
|
|
28
|
|
29
|
|
30
|
runs.load()
|
31
|
runs.fit_parametric_model(models)
|
32
|
runs.compute_flux_points(models)
|
33
|
|
34
|
|
35
|
class GCTAOnOffObservations:
|
36
|
"""Container for spectra; one spectrum per run"""
|
37
|
std::vector<GCTAOnOffObservation> observations
|
38
|
|
39
|
def compute_total_observations():
|
40
|
"""Sum run-spectra into total spectrum.
|
41
|
Store again in spectra member"""
|
42
|
|
43
|
class GCTAOnOffObservation:
|
44
|
"""Represents all data / response / analysis parameters
|
45
|
for one run"""
|
46
|
Regions on_regions
|
47
|
Regions off_regions
|
48
|
|
49
|
Regions on_exclusion_regions
|
50
|
Regions off_exclusion_regions
|
51
|
|
52
|
GCTAOnOffSpectrum spectrum
|
53
|
GCTAOnOffResponse response
|
54
|
|
55
|
compute_significance()
|
56
|
compute_flux()
|
57
|
|
58
|
load()
|
59
|
save()
|
60
|
|
61
|
|
62
|
class GCTAOnOffResponse:
|
63
|
GCTABackgroundAcceptanceSpectrum bg_acceptance_on
|
64
|
GCTABackgroundAcceptanceSpectrum bg_acceptance_off
|
65
|
|
66
|
ARF gamma_exposure
|
67
|
GEnergyResolution energy_resolution
|
68
|
|
69
|
class GCTAOnOffSpectrum:
|
70
|
|
71
|
GCountsSpectrum n_on
|
72
|
GCountsSpectrum n_off
|
73
|
|
74
|
class GCountsSpectrum:
|
75
|
GEbounds energy_bounds
|
76
|
std::vector<double> counts
|
77
|
to_pha()
|
78
|
from_pha()
|
79
|
fill_from(GEventList events)
|
80
|
|
81
|
class ARF:
|
82
|
GEbounds energy_bounds
|
83
|
std::vector<double> effective_area
|
84
|
double obs_time
|
85
|
to_arf()
|
86
|
from_arf()
|
87
|
fill_from(GResponse response, GModel model)
|
88
|
|
89
|
class GCTABackgroundAcceptanceSpectrum:
|
90
|
GEbounds energy_bounds
|
91
|
std::vector<double> effective_area
|
92
|
double obs_time
|
93
|
to_arf()
|
94
|
from_arf()
|
95
|
fill_from(GResponse response, GModel model)
|
96
|
|
97
|
class GEnergyResolution:
|
98
|
GMatrix energy_resolution_matrix
|
99
|
to_rmf()
|
100
|
from_rmf()
|