|
1 | 1 | # This code is part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS). |
2 | | -# Last modified by David J Turner ([email protected]) 4/29/26, 9:39 AM. Copyright (c) The Contributors. |
| 2 | +# Last modified by David J Turner ([email protected]) 5/5/26, 11:35 PM. Copyright (c) The Contributors. |
3 | 3 |
|
4 | 4 | import unittest |
5 | 5 |
|
6 | 6 | from astropy.units import Quantity |
| 7 | + |
7 | 8 | from xga.generate.esass.phot import evtool_image, expmap |
8 | 9 | from xga.samples import ClusterSample |
9 | | - |
10 | 10 | from .. import get_test_source, CLUSTER_SMP |
11 | 11 | from ..utils import require_esass |
12 | 12 |
|
13 | 13 |
|
14 | 14 | class TestEsassPhotFuncs(unittest.TestCase): |
15 | 15 | @classmethod |
16 | 16 | def setUpClass(cls): |
17 | | - cls.src = get_test_source('erosita') |
| 17 | + cls.src = get_test_source('erass') |
18 | 18 |
|
19 | 19 | @require_esass |
20 | 20 | def test_evtool_image(self): |
21 | 21 | evtool_image(self.src, Quantity(0.4, 'keV'), Quantity(3, 'keV')) |
22 | 22 |
|
23 | | - im = self.src.get_images(lo_en=Quantity(0.4, 'keV'), hi_en=Quantity(3, 'keV'), |
24 | | - telescope='erosita')[0] |
| 23 | + im = self.src.get_images(lo_en=Quantity(0.4, 'keV'), hi_en=Quantity(3, 'keV'), |
| 24 | + telescope='erass')[0] |
25 | 25 | if isinstance(im, list): |
26 | 26 | for i in im: |
27 | | - assert i.telescope == 'erosita' |
| 27 | + assert i.telescope == 'erass' |
28 | 28 | assert i.energy_bounds[0] == Quantity(0.4, 'keV') |
29 | 29 | assert i.energy_bounds[1] == Quantity(3, 'keV') |
30 | 30 | else: |
31 | | - assert im.telescope == 'erosita' |
| 31 | + assert im.telescope == 'erass' |
32 | 32 | assert im.energy_bounds[0] == Quantity(0.4, 'keV') |
33 | 33 | assert im.energy_bounds[1] == Quantity(3, 'keV') |
34 | 34 |
|
35 | 35 | @require_esass |
36 | 36 | def test_evtool_image_combined_obs(self): |
37 | 37 | evtool_image(self.src, Quantity(0.5, 'keV'), Quantity(3, 'keV'), combine_obs=True) |
38 | 38 |
|
39 | | - im = self.src.get_combined_images(lo_en=Quantity(0.5, 'keV'), hi_en=Quantity(3, 'keV'), |
40 | | - telescope='erosita') |
| 39 | + im = self.src.get_combined_images(lo_en=Quantity(0.5, 'keV'), hi_en=Quantity(3, 'keV'), |
| 40 | + telescope='erass') |
41 | 41 |
|
42 | | - assert im.telescope == 'erosita' |
| 42 | + assert im.telescope == 'erass' |
43 | 43 | assert im.energy_bounds[0] == Quantity(0.5, 'keV') |
44 | 44 | assert im.energy_bounds[1] == Quantity(3, 'keV') |
45 | 45 |
|
46 | 46 | @require_esass |
47 | 47 | def test_expmap(self): |
48 | 48 | expmap(self.src, Quantity(0.4, 'keV'), Quantity(3, 'keV')) |
49 | 49 |
|
50 | | - exp = self.src.get_expmaps(lo_en=Quantity(0.4, 'keV'), hi_en=Quantity(3, 'keV'), |
51 | | - telescope='erosita') |
| 50 | + exp = self.src.get_expmaps(lo_en=Quantity(0.4, 'keV'), hi_en=Quantity(3, 'keV'), |
| 51 | + telescope='erass') |
52 | 52 |
|
53 | 53 | for e in exp: |
54 | | - assert e.telescope == 'erosita' |
| 54 | + assert e.telescope == 'erass' |
55 | 55 | assert e.energy_bounds[0] == Quantity(0.4, 'keV') |
56 | 56 | assert e.energy_bounds[1] == Quantity(3, 'keV') |
57 | 57 |
|
58 | 58 | @require_esass |
59 | 59 | def test_expmap_combined_obs(self): |
60 | 60 | expmap(self.src, Quantity(0.5, 'keV'), Quantity(3, 'keV'), combine_obs=True) |
61 | 61 |
|
62 | | - exp = self.src.get_combined_expmaps(lo_en=Quantity(0.5, 'keV'), hi_en=Quantity(3, 'keV'), |
63 | | - telescope='erosita') |
| 62 | + exp = self.src.get_combined_expmaps(lo_en=Quantity(0.5, 'keV'), hi_en=Quantity(3, 'keV'), |
| 63 | + telescope='erass') |
64 | 64 |
|
65 | | - assert exp.telescope == 'erosita' |
| 65 | + assert exp.telescope == 'erass' |
66 | 66 | assert exp.energy_bounds[0] == Quantity(0.5, 'keV') |
67 | 67 | assert exp.energy_bounds[1] == Quantity(3, 'keV') |
68 | | - |
| 68 | + |
69 | 69 | @require_esass |
70 | 70 | def test_evtool_image_w_sample_w_odd_telescopes(self): |
71 | 71 | """ |
72 | 72 | There was an old bug that occured when product generation functions were run with samples |
73 | 73 | with sources that didn't all have the same telescopes. So this is testing that this bug has |
74 | 74 | been fixed! |
75 | 75 | """ |
76 | | - test_smp = ClusterSample(CLUSTER_SMP["ra"].values, CLUSTER_SMP["dec"].values, |
77 | | - CLUSTER_SMP["z"].values, CLUSTER_SMP["name"].values, |
| 76 | + test_smp = ClusterSample(CLUSTER_SMP["ra"].values, CLUSTER_SMP["dec"].values, |
| 77 | + CLUSTER_SMP["z"].values, CLUSTER_SMP["name"].values, |
78 | 78 | r500=Quantity(CLUSTER_SMP["r500"].values, 'kpc'), use_peak=False, |
79 | | - search_distance={'erosita': Quantity(3.6, 'deg')}) |
| 79 | + search_distance={'erass': Quantity(3.6, 'deg')}) |
80 | 80 |
|
81 | | - test_smp[0].disassociate_obs('erosita') |
| 81 | + test_smp[0].disassociate_obs('erass') |
82 | 82 | evtool_image(test_smp) |
83 | 83 |
|
84 | 84 | if __name__ == "__main__": |
|
0 commit comments