-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
Vizier search often emits UnitsWarning: Unit 'e' not supported by the VOUnit standard. #2352
Comments
I think electrons per second is not a VO-supported unit, as the warning suggests - this isn't just a syntax issue, but a totally unsupported unit. I'm not sure there's anything we can do about this. @aoberto are there any discussions within CDS about how to handle non-VO-compliant units? |
somewhat related to #2349. In the ideal world the data providers would release fits files that adhere to fits standards and votables that are VO compliant, but being pragmatic I think we could add some workarounds into astroquery, either by silencing these warnings within astroquery, or fix the units ourselves (for heasarch I think the latter makes sense, vizier is a bit different as there could be a lot of non-vo compliant content that were pulled from papers). |
My use case is to pull data Gaia catalog for interactive uses. The warning just creates noises for end users. I could silence those warnings on end. But it seems to me that the use case is common enough (pulling data from Vizier. I suspect there are many other catalogs that contain data with electrons as an unit, in addition to Gaia), that astroquery should handle it as well. |
When working with gaia you may want to use astroquery.gaia instead than pulling the whole catalogue from vizier. Anyway, the noise is good, it has its well-intended purpose, and I don't think we should start fixing things for the purpose of silencing those, basically, astroquery shouldn't be the one making decisions for the user (you can always decide to silence warnings), or cleanup for the data provider. |
The intent of the code in astroquery/astroquery/vizier/core.py Lines 753 to 759 in db3f08b
However, only VOWarning instances are suppressed and the reported UnitsWarning is not such an instance:astroquery/astroquery/utils/commons.py Lines 338 to 345 in db3f08b
If there is agreement that astroquery.astroquery.utils.commons.suppress_vo_warnings() should also suppress VOTable-related UnitsWarning instances then I can open a pull request for that.
|
Hmm, that is very interesting and makes me really wonder whether this should really be fixed upstream to make those in fact VOWarnings rather than UnitsWarning? E.g. W50 looks to be there for this case. |
I looked a bit more into this and came to the conclusion that the reported issue is caused by a bug in |
But I still see warning now like:
(Why do you only support SI units?) |
As the labels indicate, this is an upstream and rather complicated issue, there isn't much we can do about it in astroquery. Do filter the warnings out as a workaround at the user level if they are too bothersome. |
Just to add to the conversation, right now there is no plan to change the units in already published VizieR tables. |
When performing Vizier search, it often emits the following (arguably useless) warning.
It appears that if the search result contains data with the unit of electron (e.g., flux), the warning is emitted.
Example
The following code snippet would emit the warning.
If one removes column
"FG"
(G-band mean flux, with the unit ofe-/s
) from result, there will be no warning.Environment:
Astroquery: 0.4.6
Astropy: 5.0.3
Some older version of Astroquery + Astropy does not emits the warnings, e.g.,
Astroquery: 0.4.2
Astropy: 4.2.1
The text was updated successfully, but these errors were encountered: