Skip to content

Commit 815415a

Browse files
committed
added test to make sure footprint_to_reg can make an artist
1 parent 50df915 commit 815415a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

astroquery/alma/tests/test_alma_utils.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,18 @@ def test_footprint_to_reg_pointing(pointing_footprint_str=pointing_footprint_str
9797
assert actual_reg.center.ra == reg_output[0].center.ra
9898
assert actual_reg.center.dec == reg_output[0].center.dec
9999
assert actual_reg.radius == reg_output[0].radius
100+
101+
@pytest.mark.skipif(not HAS_REGIONS, reason="regions is required")
102+
def test_footprint_to_reg_plot(pointing_footprint_str=pointing_footprint_str):
103+
reg_output = footprint_to_reg(pointing_footprint_str)
104+
105+
from astropy.wcs import WCS
106+
ww = WCS(naxis=2)
107+
ww.wcs.crpix = [250.0, 250.0]
108+
ww.wcs.cdelt = [-7.500000005754e-05, 7.500000005754e-05]
109+
ww.wcs.ctype = ['RA---SIN', 'DEC--SIN']
110+
ww.wcs.crval = [reg_output[0].center.ra.value, reg_output[0].center.dec.value]
111+
112+
pix_region = reg_output[0].to_pixel(ww)
113+
artist = pix_region.as_artist()
114+
assert artist is not None

0 commit comments

Comments
 (0)