Skip to content

Commit

Permalink
minor docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
JarronL committed Oct 3, 2024
1 parent 7ae0090 commit 61c31ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion webbpsf_ext/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ def download_votable(target_name, radius=1, **kwargs):
Reads from Vizier URL:
f'ttps://vizier.cds.unistra.fr/viz-bin/sed?-c={target}&-c.rs={radius}'
f'https://vizier.cds.unistra.fr/viz-bin/sed?-c={target}&-c.rs={radius}'
Parameters
----------
Expand Down
25 changes: 25 additions & 0 deletions webbpsf_ext/synphot_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,36 @@ def filter_width(self):
return None

def ObsBandpass(filtername):
"""Load pre-defined filter bandpass.
Parameters
----------
filtername : str
Filter name. Choose from 'bessel_j', 'bessel_h', 'bessel_k',
'cousins_r', 'cousins_i', 'johnson_u', 'johnson_b', 'johnson_v',
'johnson_r', 'johnson_i', 'johnson_j', or 'johnson_k'.
kwargs : dict
Keywords acceptable by :func:`~synphot.specio.read_remote_spec`.
Returns
-------
bp : `SpectralElement`
Empirical bandpass.
Raises
------
synphot.exceptions.SynphotError
Invalid filter name.
"""

# check if 'bessel', 'johnson', or 'cousins' string exist in filtername
filtername_lower = filtername.lower()
if np.any([s in filtername_lower for s in ['bessel', 'johnson', 'cousins']]):
return Bandpass.from_filter(filtername_lower.replace(',', '_'))
elif filtername_lower in 'ubvrijk':
return Bandpass.from_filter('johnson_' + filtername_lower)
else:
raise ValueError(f'{filtername} not a valid bandpass. If using HST filters, use stsynphot package.')

Expand Down

0 comments on commit 61c31ce

Please sign in to comment.