Skip to content

Comments

ENH: SVO FPS - add method to easily retrieve filter metadata#3528

Merged
bsipocz merged 5 commits intoastropy:mainfrom
cgobat:main
Feb 13, 2026
Merged

ENH: SVO FPS - add method to easily retrieve filter metadata#3528
bsipocz merged 5 commits intoastropy:mainfrom
cgobat:main

Conversation

@cgobat
Copy link
Member

@cgobat cgobat commented Feb 11, 2026

This PR adds a new method: SvoFpsClass.get_filter_params(). It follows the same call signature as the existing SvoFpsClass.get_transmission_data(), and returns a dict containing the VOTable PARAMs returned by the FPS. This includes things like the filter zero point, min/max/effective wavelength, description, etc.

For example, one often needs the effective wavelength of a filter. Without this method, the practical options were either to retrieve the full transmission profile and do the numerical integration yourself, or manually go to the FPS website and find it on the webpage, then hardcode it. With this new method, it is as simple as lambda_eff = SvoFps.get_filter_params(my_filter_id)["WavelengthEff"].

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 8.33333% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.67%. Comparing base (81f2ac5) to head (459ed3a).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/svo_fps/core.py 8.33% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3528      +/-   ##
==========================================
+ Coverage   72.39%   72.67%   +0.27%     
==========================================
  Files         219      219              
  Lines       20432    20485      +53     
==========================================
+ Hits        14792    14887      +95     
+ Misses       5640     5598      -42     

☔ 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 Feb 11, 2026
Copy link
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.

Thank you. Overall it looks good, but there are a few minor changes that would make it better.

Also, would you mind adding an example for the narrative docs?

@keflavich
Copy link
Contributor

Could you clarify the aim of this? The suggested motivation is that "Without this method, the practical options were either to retrieve the full transmission profile and do the numerical integration yourself, or manually go to the FPS website and find it on the webpage, then hardcode it. ", but as far as I can tell, this is part of the default returns, e.g.:

from astroquery.svo_fps import SvoFps
filterlist = SvoFps.get_filter_list('JWST')
filterlist[ 'filterID',  'WavelengthEff' ]

gives a list like:

       filterID        WavelengthEff
                          Angstrom
--------------------- ---------------
    JWST/NIRCam.F070W 6988.4272768359
JWST/NIRCam2025.F070W 6996.0621457337
                  ...             ...
     JWST/MIRI.F2100W 205601.06046254
     JWST/MIRI.F2300C  224493.7622614
     JWST/MIRI.F2550W 251515.98944653
Length = 88 rows

@keflavich
Copy link
Contributor

The full set of metadata is accessible:

>>> SvoFps.get_filter_list('JWST').colnames
['FilterProfileService',
 'filterID',
 'WavelengthUnit',
 'WavelengthUCD',
 'PhotSystem',
 'DetectorType',
 'Band',
 'Instrument',
 'Facility',
 'ProfileReference',
 'CalibrationReference',
 'Description',
 'Comments',
 'WavelengthRef',
 'WavelengthMean',
 'WavelengthEff',
 'WavelengthMin',
 'WavelengthMax',
 'WidthEff',
 'WavelengthCen',
 'WavelengthPivot',
 'WavelengthPeak',
 'WavelengthPhot',
 'FWHM',
 'Fsun',
 'PhotCalID',
 'MagSys',
 'ZeroPoint',
 'ZeroPointUnit',
 'Mag0',
 'ZeroPointType',
 'AsinhSoft',
 'TrasmissionCurve']

then you can select by matching on filterID. Since the tables of instruments are pretty small, this isn't much of an overhead

("Trasmission Curve" instead of "Transmission Curve" is apparently an upstream issue?)

@cgobat
Copy link
Member Author

cgobat commented Feb 13, 2026

The biggest problem with that proposal is that a number of filters at SVO's FPS don't have an associated "facility", so the get_filter_list method doesn't work at all for them.

Even if that weren't the case, I would still argue that this is a useful addition—it is a very (maybe even more?) common use case to not actually care about the exact structure of a filter's response curve, and really just need to know some defining characteristics like the FWHM, effective width, pivot wavelength, effective wavelength, etc. Given that, there should be a straightforward, non-hacky way to retrieve that kind of information directly, without having to pull down other filters or data you don't need.

@cgobat
Copy link
Member Author

cgobat commented Feb 13, 2026

Nice catch about "TrasmissionCurve" though—I had never noticed that. :)

@cgobat cgobat requested a review from bsipocz February 13, 2026 05:16
@keflavich
Copy link
Contributor

The biggest problem with that proposal is that a number of filters at SVO's FPS don't have an associated "facility", so the get_filter_list method doesn't work at all for them.

Is this really true? The website is listed facility-first; I didn't think there were any filters without an associated facility, even if it's just a placeholder. Do you have examples?

Even if that weren't the case, I would still argue that this is a useful addition—it is a very (maybe even more?) common use case to not actually care about the exact structure of a filter's response curve, and really just need to know some defining characteristics like the FWHM, effective width, pivot wavelength, effective wavelength, etc. Given that, there should be a straightforward, non-hacky way to retrieve that kind of information directly, without having to pull down other filters or data you don't need.

I agree, this is a more convenient way to get access to those metadata, which I frequently use. I don't think the current approach is hacky, but it is a tiny bit more clunky, so I'm onboard with adding this.

@cgobat
Copy link
Member Author

cgobat commented Feb 13, 2026

Yeah, maybe hacky wasn't quite the right word there. Thanks for your approval.

Here are a couple examples of facility-less filters:

Copy link
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.

This all looks good to me now; thank you!

@bsipocz
Copy link
Member

bsipocz commented Feb 13, 2026

I interpret Adam's comment above as a thumbs up, so let's merge this now.

@bsipocz bsipocz merged commit ae23215 into astropy:main Feb 13, 2026
10 of 11 checks passed
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