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

Not able to query_region using 'II/349/ps1" catalog #2887

Closed
StandinKP opened this issue Nov 29, 2023 · 8 comments
Closed

Not able to query_region using 'II/349/ps1" catalog #2887

StandinKP opened this issue Nov 29, 2023 · 8 comments

Comments

@StandinKP
Copy link

StandinKP commented Nov 29, 2023

from astroquery.vizier import Vizier

w = WCS(header)
[raImage, decImage] = w.all_pix2world(data.shape[0]/2, data.shape[1]/2, 1)
boxsize = 30 # arcminutes
maxmag = 18

catNum = 'II/349/ps1'
print('\nQuerying Vizier %s around RA %.4f, Dec %.4f with a radius of %.4f arcmin'%(catNum, raImage, decImage, boxsize))

try:
#You can set the filters for the individual columns (magnitude range, number of detections) inside the Vizier query
v = Vizier(columns=['*'], column_filters={"gmag":"<%.2f"%maxmag, "Nd":">6", "e_gmag":"<1.086/3"}, row_limit=-1)
Q = v.query_region(SkyCoord(ra = raImage, dec = decImage, unit = (u.deg, u.deg)), radius = str(boxsize)+'m', catalog=catNum, cache=False)
#query vizier around (ra, dec) with a radius of boxsize
print(Q[0])
except:
print('I cannnot reach the Vizier database. Is the internet working?')

Using the above code with
astropy: '6.0.0'
astroquery: '0.4.6'

The same code works for 'I/345/gaia2' and 'II/246' as well. Can anyone help with this?

@ManonMarchand
Copy link
Member

Good catch, looks like we have a corrupted file on VizieR side. We're investigating to get it back in shape soon! Thanks for reporting.

@ManonMarchand
Copy link
Member

ManonMarchand commented Nov 30, 2023

Aaaaah no! Actually it's the division in your criteria for "e_gmag". The / character in the string corrupts your result.
If you calculate 1.086/3 beforehand it works

@StandinKP
Copy link
Author

Thanks @ManonMarchand, this worked.

@gilleslandais
Copy link

The vizier code has been fixed to encode QUERY_RESULT text. The correction will be available in the next version.
Thank for the report !

@StandinKP StandinKP reopened this Nov 30, 2023
@StandinKP
Copy link
Author

Will close this once next version becomes available to its easier to track. Is it possible to link the release to this issue? @gilleslandais

@ManonMarchand
Copy link
Member

@StandinKP : just to be clear, this won't make / legit. The thing Gilles solved in VizieR will ensure that the next person gets a clearer error message (in QUERY RESULT) than the one you got.

@StandinKP
Copy link
Author

Yes Yes. I got that. Thanks

@bsipocz
Copy link
Member

bsipocz commented Nov 30, 2023

Is it possible to link the release to this issue?

I'm closing this as it appears to be upstream and there isn't really much we'll do about this in the next astroquery release.

@bsipocz bsipocz closed this as completed Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants