UnrecognizedUnit() from Vizier tables
If I get a catalog from Vizier, not all the units are recognized, even if they look standard on the Vizier query page. For example:
from astroquery.vizier import Vizier
cat_name = "J/A+A/528/A122/xrtcat"
cat = Vizier(columns=['**'], row_limit=-1).get_catalogs(cat_name)
cat = cat[0]
col_list = cat.colnames
cat0['Flux.s'].unit
Gives me:
UnrecognizedUnit(mW.m**-2)
This is the webpage where you can see the units of the Flux.s column are mW/m2, which should be recognized.
The . between mW and m**-2 looks to me like the problem, but I'm not sure if this is a genuine error in the Vizier database or something that astropy should be able to handle.
Can anyone chime in on whether mW.m**-2 is a valid unit under any spec we should be handling? Or is this an upstream bug to report?
The unit is given as a valid string in the vounit standard, and there don't seem to be any problems parsing it using the development versions of astropy and astroquery:
>>> from astroquery.vizier import Vizier
>>> cat_name = "J/A+A/528/A122/xrtcat"
>>> cat = Vizier(columns=['**'], row_limit=-1).get_catalogs(cat_name)[0]
>>> cat['Flux.s'].unit
Unit("mW / m2")
The astropy and astroquery versions that produced the bug are not included in the bug report, but I suspect they are outdated and upgrading them should solve the problem.
As per the last comment above, this example works as expected using the latest version.
If you still un into this issue with the latest version, please feel free to reopen and provide more information about versions, etc.