Skip to content

Add get_zeropoint and more flexible metadata querying to SVO FPS#3545

Open
keflavich wants to merge 7 commits intoastropy:mainfrom
keflavich:svo_fps-zeropoint
Open

Add get_zeropoint and more flexible metadata querying to SVO FPS#3545
keflavich wants to merge 7 commits intoastropy:mainfrom
keflavich:svo_fps-zeropoint

Conversation

@keflavich
Copy link
Copy Markdown
Contributor

There is metadata on SVO FPS that is inaccessible but should be.

#3528 showed the right mechanism to retrieve metadata, but it didn't allow querying on PhotCalID - while data_from_svo allowed specification of this parameter, the mechanism we are using to parse the votable drops the relevant data.

This PR adds a new get_zeropoint mechanism to very explicitly and cleanly retrieve zeropoints and also generalizes get_filter_metadata.

Note that I have made some serious mistakes in recent publications because I failed to realize the default zeropoint was vega, so it's high importance for me to expose the get_zeropoint method with an explicit mag_sys keyword to users.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.26%. Comparing base (44c0c4c) to head (ac4b698).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/svo_fps/core.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3545      +/-   ##
==========================================
+ Coverage   73.20%   73.26%   +0.05%     
==========================================
  Files         226      226              
  Lines       20966    20975       +9     
==========================================
+ Hits        15349    15368      +19     
+ Misses       5617     5607      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bsipocz bsipocz added this to the 0.4.12 milestone Mar 3, 2026
Copy link
Copy Markdown
Member

@cgobat cgobat left a comment

Choose a reason for hiding this comment

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

Nice. I like it.

Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

The changes look good, and tests are happy.

However, I'm less happy about introducing back the **kwarg approach. Could we maybe expand it out and list all the options explicitly? If nothing else, it would make the docstring more useful.

)

def get_filter_metadata(self, filter_id, *, cache=True, timeout=None):
def get_filter_metadata(self, filter_id, *, cache=True, timeout=None, **kwargs):
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.

can we be more specific about the acceptable kwargs? Or is the list very long?

(I try to get rid of these wildcarded kwargs as they swallow a lot of problems as users can pass on practically anything even if it has no effect; besides it means that our documentation is practically useless.)

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.

I would still think we should spell these out; if for nothing else to show the users of what parameters are available.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the kwargs are specifically query args that then go through validation

query.update(kwargs)
bad_params = [param for param in query if param not in QUERY_PARAMETERS]

we could refactor to put all these as explicit parameters:

# Valid query parameters taken from
# https://svo2.cab.inta-csic.es/theory/fps/index.php?mode=voservice
_params_with_range = {"WavelengthRef", "WavelengthMean", "WavelengthEff",
                      "WavelengthMin", "WavelengthMax", "WidthEff", "FWHM"}
QUERY_PARAMETERS = _params_with_range.copy()
for suffix in ("_min", "_max"):
    QUERY_PARAMETERS.update(param + suffix for param in _params_with_range)
QUERY_PARAMETERS.update(("Instrument", "Facility", "PhotSystem", "ID", "PhotCalID",
                         "FORMAT", "VERB"))

would you prefer that? It's 21 parameters, but maybe it's more helpful to users to have them all explicitly specified?

@keflavich keflavich force-pushed the svo_fps-zeropoint branch from bb82061 to ac4b698 Compare April 9, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants