test.py
1 |
#! /usr/bin/env python
|
---|---|
2 |
import gammalib |
3 |
|
4 |
# Load OG only
|
5 |
obs = gammalib.GObservations('obs.xml')
|
6 |
print('=== Observation without response ===')
|
7 |
print(obs[0])
|
8 |
obs.save('write_obs.xml')
|
9 |
|
10 |
# Load OG with response group
|
11 |
obs = gammalib.GObservations('obs_rspgrp.xml')
|
12 |
print('')
|
13 |
print('=== Observation with response group ===')
|
14 |
print(obs[0])
|
15 |
obs.save('write_obs_rspgrp.xml')
|
16 |
|
17 |
# Save IRF FITS file (we need this later)
|
18 |
obs[0].response().save('irf.fits', True) |
19 |
|
20 |
# Load OG with response file
|
21 |
obs = gammalib.GObservations('obs_rspfile.xml')
|
22 |
print('')
|
23 |
print('=== Observation with response file for continuum IRF ===')
|
24 |
print(obs[0])
|
25 |
obs.save('write_obs_rspfile.xml')
|
26 |
|
27 |
# Save IRF FITS file (we need this later)
|
28 |
obs[0].response().save('irf.fits', True) |
29 |
|
30 |
# Load OG with response group for line response
|
31 |
obs = gammalib.GObservations('obs_rspgrp_line.xml')
|
32 |
print('')
|
33 |
print('=== Observation with response file for line IRF ===')
|
34 |
print(obs[0])
|
35 |
obs.save('write_obs_rspgrp_line.xml')
|