astropy / pyvo

An Astropy affiliated package providing access to remote data and services of the Virtual Observatory (VO) using Python.
https://pyvo.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
75 stars 52 forks source link

("IMAGE/JPEG") is either illegal or unsupported when searching 2MASS #394

Open stephtdouglas opened 1 year ago

stephtdouglas commented 1 year ago

I am modifying the image search cheat-sheet to look at 2MASS images, and it failed because the 2MASS ASKY AT / 2MASS All-Sky Atlas Image Service doesn't appear to support jpeg images. Here is what I ran (still labelled uvot even though I changed to IR, sorry!)

from astropy import coordinates as coord
import pyvo as vo

uvot_services = vo.regsearch(servicetype='sia',waveband='infrared',keywords=['2MASS'])
uvot_services.to_table()['ivoid','short_name','res_title']

coords = coord.SkyCoord.from_name("Cl* NGC 2632 JS364")
print(coords)

im_table = uvot_services[0].search(pos=coords,size=0.2,format='image/jpeg')

And then that returns

DALQueryError: getSIAFormat() ../src/wsvc/2MASS/IM/imapp.c:531 Simple Image Access FORMAT query parameter value ("IMAGE/JPEG") is either illegal or unsupported

I discussed with @bsipocz and it seems like this should return an empty result if an archive contains no data in that format, rather than throwing an error.

stephtdouglas commented 1 year ago

Actually, it is also throwing the error if I query for format='image/fits' as well...

msdemlei commented 1 year ago

On Sun, Jan 08, 2023 at 11:19:12AM -0800, Stephanie Douglas wrote:

I discussed with @bsipocz and it seems like this should return an empty result if an archive contains no data in that format, rather than throwing an error.

This is definitely the case. SIA v1 is explicit on this:

If formats indicated by this parameter are not supported by the implementing service, the returned table should be empty.

(sect. 4.1 lit 4). But we can't do much about this here, as it's the service that's broken. Fortunately, pyVO can tell you who to ask about this:

svcs[0].get_contact() 'IRSA Support Team @.***>'

Would you complain there? And perhaps close this bug when they have acknowledged they will do something about it?

msdemlei commented 1 year ago

@stephtdouglas, would you close this if it's been resolved or else tell us if there's stuff to change in pyvo after all? Thanks!