ENH: SVO FPS - add method to easily retrieve filter metadata#3528
ENH: SVO FPS - add method to easily retrieve filter metadata#3528bsipocz merged 5 commits intoastropy:mainfrom
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
bsipocz
left a comment
There was a problem hiding this comment.
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?
|
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: |
|
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?) |
|
The biggest problem with that proposal is that a number of filters at SVO's FPS don't have an associated "facility", so the 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. |
|
Nice catch about "TrasmissionCurve" though—I had never noticed that. :) |
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?
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. |
|
Yeah, maybe hacky wasn't quite the right word there. Thanks for your approval. Here are a couple examples of facility-less filters:
|
bsipocz
left a comment
There was a problem hiding this comment.
This all looks good to me now; thank you!
|
I interpret Adam's comment above as a thumbs up, so let's merge this now. |
This PR adds a new method:
SvoFpsClass.get_filter_params(). It follows the same call signature as the existingSvoFpsClass.get_transmission_data(), and returns adictcontaining 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"].