Skip to content

[SIMBAD] Add filter names as possible votable fields #3052

Merged
bsipocz merged 2 commits into
astropy:mainfrom
cds-astro:fix-add-votable-fields-fluxes
Jun 27, 2024
Merged

[SIMBAD] Add filter names as possible votable fields #3052
bsipocz merged 2 commits into
astropy:mainfrom
cds-astro:fix-add-votable-fields-fluxes

Conversation

@ManonMarchand

Copy link
Copy Markdown
Member

I'd like to tweak a bit the way I handled the fluxes votable fields deprecations in the SIMBAD rework.

In the current version, this:

from astroquery.simbad import Simbad
simbad = Simbad()
simbad.add_votable_fields("flux(u)")

works with a warning that does not say how this should be replaced.

This PR adds new votable fields for the SIMBAD's filters. And thus we can provide a clearer warning that points to this new replacement. This uses the allfluxes table from SIMBAD's relational schema (http://simbad.cds.unistra.fr/simbad/tap/tapsearch.html) that only contains the magnitude value.

There is also a clearer error message for the deprecated flux_**() votable fields that were falling in the generic error message for unknown fields. There is now a message that says that the replacement is the votable field flux which adds the whole flux table with every information covered by these former votable fields.


In addition, the allfluxes votable field was broken

from astroquery.simbad import Simbad
simbad = Simbad()
simbad.add_votable_fields("allfluxes")

would make every query fail because the names of the columns are casefolded while this table is an exception in the database and is case-sensitive. This is fixed in this PR.

@keflavich keflavich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks great to me. Thanks for your detailed attention to the user experience! It's especially good to see users no longer being asked to write SQL.

@bsipocz bsipocz added this to the v0.4.8 milestone Jun 26, 2024
@bsipocz bsipocz added the simbad label Jun 26, 2024

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good pending a minor clarification. I don't think that changelog is required as the VO backend refactoring hasn't yet been released yet.

Comment thread astroquery/simbad/core.py Outdated
- "table": a table other than basic that has a declared direct join
- "bundle of basic columns": a pre-selected bundle of columns of basic. Ex: "parallax" will add all
columns relevant to parallax
- "filter": a filter name

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rephrase the description to make sure it's clear that filter is for an optical filter rather than a VO/any other computing filtering expression. I expected the latter :)

(maybe if possible, then rename it to filter name? that would make it unambiguous)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sure! Did not think about that ^^
This is renamed (and I also tried to make it a bit clearer in the documentation)

@ManonMarchand
ManonMarchand force-pushed the fix-add-votable-fields-fluxes branch from f530766 to 9670d00 Compare June 27, 2024 09:40
@bsipocz
bsipocz merged commit 1be9420 into astropy:main Jun 27, 2024
@bsipocz

bsipocz commented Jun 27, 2024

Copy link
Copy Markdown
Member

Thanks!

@ManonMarchand
ManonMarchand deleted the fix-add-votable-fields-fluxes branch October 18, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants