Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ sbpy.photometry
- Added Rubin Observatory's LSSTCam filter set to `bandpass()`. [#431]


Bug Fixes
---------

sbpy.spectroscopy
^^^^^^^^^^^^^^^^^

- Avoid deprecation warning on flux_unit and wave_unit keyword arguments in
`sbpy.spectroscopy.sources.SpectralSource.from_file` when using synphot's
read_fits_spec. [#447]


v0.6.0 (2025-12-02)
===================

Expand Down
11 changes: 9 additions & 2 deletions sbpy/spectroscopy/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,18 @@ def from_file(cls, filename, wave_unit=None, flux_unit=None,

# URL cache because synphot.SourceSpectrum.from_file does not
if _is_url(filename):
fn = download_file(filename, cache=True)
fn = download_file(filename, cache=cache)
else:
fn = filename

spec = read_spec(fn, wave_unit=wave_unit, flux_unit=flux_unit)
# flux_unit and wave_unit were deprecated for FITS files in synphot 1.4;
# only use them if requested
read_kwargs = {}
if wave_unit is not None:
read_kwargs["wave_unit"] = wave_unit
read_kwargs["flux_unit"] = flux_unit

spec = read_spec(fn, **read_kwargs)
i = np.isfinite(spec[1] * spec[2])
source = synphot.SourceSpectrum(
synphot.Empirical1D, points=spec[1][i], lookup_table=spec[2][i],
Expand Down
Loading