Skip to content

Commit 3172b82

Browse files
authored
Merge pull request #3285 from SpacialTree/alma-visual
Changed visual to have mpl kwargs for Alma
2 parents 310967b + 4c2caa2 commit 3172b82

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ API changes
1414
Service fixes and enhancements
1515
------------------------------
1616

17+
alma
18+
^^^^
19+
20+
- Bug fix in ``footprint_to_reg`` that did not allow regions to be plotted. [#3285]
21+
1722
heasarc
1823
^^^^^^^
1924

astroquery/alma/tests/test_alma_utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,19 @@ 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+
102+
@pytest.mark.skipif(not HAS_REGIONS, reason="regions is required")
103+
def test_footprint_to_reg_plot(pointing_footprint_str=pointing_footprint_str):
104+
reg_output = utils.footprint_to_reg(pointing_footprint_str)
105+
106+
from astropy.wcs import WCS
107+
ww = WCS(naxis=2)
108+
ww.wcs.crpix = [250.0, 250.0]
109+
ww.wcs.cdelt = [-7.500000005754e-05, 7.500000005754e-05]
110+
ww.wcs.ctype = ['RA---SIN', 'DEC--SIN']
111+
ww.wcs.crval = [reg_output[0].center.ra.value, reg_output[0].center.dec.value]
112+
113+
pix_region = reg_output[0].to_pixel(ww)
114+
artist = pix_region.as_artist()
115+
assert artist is not None

astroquery/alma/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ def footprint_to_reg(footprint):
6060
reglist = []
6161

6262
meta = {'source': 1, 'include': 1, 'fixed': 0, 'text': ''}
63-
visual = {'color': 'green', 'dash': '0', 'dashlist': '8 3',
64-
'font': '"helvetica 10 normal roman"', 'width': '1'}
63+
visual = {'color': 'green', 'linestyle': 'solid', 'linewidth': 1.0}
6564

6665
entries = footprint.split()
6766
if entries[0] == 'Circle':

0 commit comments

Comments
 (0)