Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sia query doesn't accept scalar coordinate #305

Closed
keflavich opened this issue Dec 5, 2021 · 2 comments · Fixed by #459
Closed

sia query doesn't accept scalar coordinate #305

keflavich opened this issue Dec 5, 2021 · 2 comments · Fixed by #459

Comments

@keflavich
Copy link
Contributor

@andamian this looks like a bug in how pyvo is handlign the pos keyword (or, I don't understand what's expected, but in that case it's clearly a documentation issue)

>>> from astroquery.alma import Alma
>>> from astropy import coordinates
>>> from astropy import units as u
>>> galactic_center = coordinates.SkyCoord(0*u.deg, 0*u.deg, frame='galactic')
>>> Alma.query_sia(pos=galactic_center, pol='XX')

Traceback (most recent call last):
  File "<ipython-input-3-cfb9f36d29ef>", line 1, in <module>
    Alma.query_sia(pos=galactic_center, pol='XX')
  File "/Users/adam/miniconda3/envs/python3.9/lib/python3.9/site-packages/astroquery/alma/core.py", line 406, in query_sia
    return self.sia.search(
  File "/Users/adam/miniconda3/envs/python3.9/lib/python3.9/site-packages/pyvo/dal/sia2.py", line 192, in search
    return SIAQuery(self.query_ep, pos=pos, band=band,
  File "/Users/adam/miniconda3/envs/python3.9/lib/python3.9/site-packages/pyvo/dal/sia2.py", line 265, in __init__
    self.pos.add(pp)
  File "/Users/adam/miniconda3/envs/python3.9/lib/python3.9/site-packages/pyvo/dal/params.py", line 255, in add
    if item in self:
  File "/Users/adam/miniconda3/envs/python3.9/lib/python3.9/site-packages/pyvo/dal/params.py", line 276, in __contains__
    return self.get_dal_format(item) in self.dal
  File "/Users/adam/miniconda3/envs/python3.9/lib/python3.9/site-packages/pyvo/dal/params.py", line 298, in get_dal_format
    self._validate_pos(val)
  File "/Users/adam/miniconda3/envs/python3.9/lib/python3.9/site-packages/pyvo/dal/params.py", line 319, in _validate_pos
    if len(pos) == 3:
  File "/Users/adam/repos/astropy/astropy/utils/shapes.py", line 209, in __len__
    raise TypeError("Scalar {!r} object has no len()"
TypeError: Scalar 'SkyCoord' object has no len()
@bsipocz
Copy link
Member

bsipocz commented Dec 6, 2021

If this is indeed a pyvo bug we can move the issue over to that repo.

@keflavich
Copy link
Contributor Author

Agree. I just don't know for sure yet.

@bsipocz bsipocz transferred this issue from astropy/astroquery Feb 24, 2022
@bsipocz bsipocz changed the title ALMA: sia query doesn't accept coordinates sia query doesn't accept scalar coordinate Feb 24, 2022
@bsipocz bsipocz added bug and removed alma labels Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants