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

astroquery.vizier does not return all the columns specified #1502

Closed
ysBach opened this issue Jul 7, 2019 · 6 comments · Fixed by #2012
Closed

astroquery.vizier does not return all the columns specified #1502

ysBach opened this issue Jul 7, 2019 · 6 comments · Fixed by #2012
Labels

Comments

@ysBach
Copy link

ysBach commented Jul 7, 2019

If I specify too many (N = 16?) columns, the query returns only the first N columns and ignores the other columns:

import astroquery
from astroquery.vizier import Vizier
from astropy.coordinates import SkyCoord
from astropy import units as u

print(astroquery.__version__)
# 0.3.10.dev5533

columns = ['objID', 'RAJ2000', 'DEJ2000',
                            'e_RAJ2000', 'e_DEJ2000',
                            'Ng', 'gmag', 'e_gmag', 'gmagStd',
                            'Nr', 'rmag', 'e_rmag', 'rmagStd',
                            'Ni', 'imag', 'e_imag', 'imagStd',
                            'Nz', 'zmag', 'e_zmag', 'zmagStd',
                            'Ny', 'ymag', 'e_ymag', 'ymagStd'
                            ]

vquery = Vizier(columns=columns, row_limit=-1)

field = SkyCoord(ra=100*u.deg, dec=20*u.deg, frame='icrs')

queried = vquery.query_region(field,
                               radius=0.01*u.deg,
                               catalog="II/349/ps1")[0]

print(len(queried.colnames), len(columns))
# 16 25

image

If I use the identical code but replacing columns = ["*"] or columns=["**"], it works as expected.

I encountered with this while doing an urgent work, and thus have not yet tested for other catalogs.

@keflavich
Copy link
Contributor

cc @bmatthieu3 is this a problem on our side or is this a limitation built in to the server?

@philastrophist
Copy link

shen11 = Vizier.query_constraints('J/ApJS/194/45', z='> 0.34 & < 0.4', columns=["**"])
assert len(shen11[0].colnames) ==142

This fails and only returns the default columns on Vizier, I need all of them!

@odysseus9672
Copy link
Contributor

odysseus9672 commented Dec 15, 2019

I'm not sure where the problem is, myself, but I can work around it with columns=["all"] and then deleting the columns I don't want in astroquery 0.3.9.

@hamogu
Copy link
Member

hamogu commented Mar 7, 2020

I've independently found this, too. The limit seems to be 14 columns.

from astroquery.vizier import Vizier

cols = ['_q', '_d', '_2RXS', 'RAJ2000', 'DEJ2000', 'Cts', 'e_Cts', 'HR1', 'e_HR1', 'HR2', 'e_HR2',
        'CRate', 'e_CRate', 
        'NHfitm', 'e_NHfitm', 'Tempfitm', 'e_Tempfitm', 'Fluxm', 'Chi2rspm']
v = Vizier(columns=cols)
cat_2rxs = Vizier(columns=cols).query_region("Sirius", radius="30s", catalog="J/A+A/588/A103")
print(cat_2rxs)

@jwoillez
Copy link
Member

@philastrophist Sorry for the late feedback. Your syntax is off. All keywords inside the query_constraint() call are constraints on columns. The syntax you are after is:

shen11 = Vizier(catalog='J/ApJS/194/45', columns=['**']).query_constraints(z='> 0.34 & < 0.4')

@jwoillez
Copy link
Member

@ysBach With PR #2012, I cannot reproduce the issue and can obtain all 25 requested columns. No idea if this is a change on the Vizier side, or a code change on the astroquery side.

@keflavich, @bsipocz, I recommend closing this issue, or I mark it as fixed in #2012. Let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants