astropy / astroquery

Functions and classes to access online data resources. Maintainers: @keflavich and @bsipocz and @ceb8
http://astroquery.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
699 stars 397 forks source link

Unexpected warning when trying to query catalog #2480

Closed astrofrog closed 8 months ago

astrofrog commented 2 years ago

I haven't had time to dig further into this, but got a strange warning when trying to do a simple query:

from astroquery.vizier import Vizier
result = Vizier(catalog='IV/38/tic').query_constraints(TIC='1402786096')
WARNING: UnitsWarning: Unit 'Sun' not supported by the VOUnit standard. Did you mean uN? [astropy.units.format.vounit]
WARNING:astroquery:UnitsWarning: Unit 'Sun' not supported by the VOUnit standard. Did you mean uN?
keflavich commented 2 years ago

Looks like this is supposed to be a unit referring to "solar metallicity"

from astroquery.vizier import Vizier
result = Vizier(catalog='IV/38/tic').query_constraints_async(TIC='1402786096')
print(result.text.split("\n")[97:102])
['    <FIELD name="[M/H]" ucd="PHYS_ABUND_Z" datatype="double" width="7" precision="4" unit="log(Sun)">', '      <DESCRIPTION>[-4.7/1.4]? Metallicity (M/H) (17)</DESCRIPTION>', '      <VALUES null="NaN" />', '    </FIELD>', '    <FIELD name="e_[M/H]" ucd="ERROR" datatype="float" width="7" precision="4" unit="log(Sun)">']

(see "log(Sun)" above)

This might be an upstream issue. I'm not sure what the VO standard has to say about it.

ManonMarchand commented 8 months ago

The bug is upstream in astropy, the linked PR should solve it