astroquery
astroquery copied to clipboard
table = eso.query_main(column_filters={'instrument': 'vircam'}) is case sensitive
Hi,
It looks like there is a case-sensitive feature with eso.query_main.
The helpful example has: table = eso.query_main(column_filters={'instrument': 'APICAM', 'filter_path': 'LUMINANCE', 'stime':'2019-04-26', 'etime':'2019-04-27'}, cache=False)
but all the instruments listed by list_instruments are lower case. I also note that 'APICAM/apicam' is not listed!
eso.list_instruments() ['fors1', 'fors2', 'sphere', 'vimos', 'omegacam', 'eris', 'hawki', 'isaac', 'naco', 'visir', 'vircam', 'apex', 'giraffe', 'uves', 'xshooter', 'espresso', 'muse', 'crires', 'kmos', 'sinfoni', 'amber', 'gravity', 'matisse', 'midi', 'pionier', 'wlgsu']
table = eso.query_main(column_filters={'instrument': 'vircam'}) returns: WARNING: NoResultsWarning: Query returned no results [astroquery.eso.core]
table = eso.query_main(column_filters={'instrument': 'VIRCAM'}) works OK print(len(table)) 99
Thanks for the report @richardgmcmahon , I confirm this is at least incorrect documentation, and possibly a bug.
To investigate: Should we always pass instrument names as uppercase? Or do we just need to make list_instruments
return the correct case?
Thanks @keflavich for the speedy response.
I am using astroquery 0.4.3 and Python 3.8.16 | packaged by conda-forge | (default, Feb 1 2023, 16:05:36) [Clang 14.0.6 ]
For info table = eso.query_instrument('vircam') works as expected.
I do not have a preference on case. I suggest making the query code case insensitive i.e. query_main and query_instrument. OR make the instrument list upper case to follow ESO.
ESO list all their instruments here: http://archive.eso.org/cms/eso-data/instrument-specific-query-forms.html
All are all uppercase except for "X-Shooter" which is mixed case and has a hyphen. I note that eso.list_instruments() returns "xshooter" i.e the hypen is removed. eso.list_instruments() returns xshooter.
table = eso.query_main(column_filters={'instrument': 'XSHOOTER'}) works OK table = eso.query_main(column_filters={'instrument': 'xshooter'}) fails
table = eso.query_instrument('XSHOOTER') works OK table = eso.query_instrument('xshooter') works OK
So it looks like query_instrument is case insensitive. e.g. table = eso.query_instrument('XsHoOtEr') works
So, I am not sure what to suggest or to call this a "documented feature"