6
6
from astropy .coordinates import SkyCoord
7
7
8
8
try :
9
- from regions import CircleSkyRegion , PolygonSkyRegion
9
+ from regions import CircleSkyRegion
10
10
11
11
HAS_REGIONS = True
12
12
except ImportError :
@@ -41,10 +41,10 @@ def approximate_primary_beam_sizes(frq_sup_str=frq_sup_str,
41
41
-28.681414 266.530644 -28.685630 266.521788 -28.689453 266.519784
42
42
-28.694332 266.521332 -28.699778'''
43
43
44
+
44
45
@pytest .mark .skipif (not HAS_REGIONS , reason = "regions is required" )
45
46
def test_footprint_to_reg_mosaic (mosaic_footprint_str = mosaic_footprint_str ):
46
47
47
-
48
48
pairs = zip (mosaic_footprint_str .split ()[2 ::2 ], mosaic_footprint_str .split ()[3 ::2 ])
49
49
vertices = [SkyCoord (float (ra ) * u .deg , float (dec ) * u .deg , frame = 'icrs' )
50
50
for ra , dec in pairs ]
@@ -80,6 +80,7 @@ def test_footprint_to_reg_mosaic_multiple(mosaic_footprint_str=mosaic_footprint_
80
80
81
81
pointing_footprint_str = 'Circle ICRS 266.519781 -28.724666 0.01'
82
82
83
+
83
84
@pytest .mark .skipif (not HAS_REGIONS , reason = "regions is required" )
84
85
def test_footprint_to_reg_pointing (pointing_footprint_str = pointing_footprint_str ):
85
86
@@ -89,12 +90,10 @@ def test_footprint_to_reg_pointing(pointing_footprint_str=pointing_footprint_str
89
90
90
91
actual_reg = CircleSkyRegion (center , radius = float (rad ) * u .deg )
91
92
92
-
93
93
reg_output = utils .footprint_to_reg (pointing_footprint_str )
94
94
95
95
assert len (reg_output ) == 1
96
96
97
97
assert actual_reg .center .ra == reg_output [0 ].center .ra
98
98
assert actual_reg .center .dec == reg_output [0 ].center .dec
99
99
assert actual_reg .radius == reg_output [0 ].radius
100
-
0 commit comments