We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The FilterResponse object's pad_spectrum method appears to not add elements along the correct axis. For example...
FilterResponse
pad_spectrum
import numpy as np, astropy.units as u, speclite.filters as filters # 1-dim wavelength array lam0 = np.arange(3800., 5500., 1.) * u.AA # compatible datacube shape flam0 = np.tile(np.ones_like(lam0.value)[..., None, None], (1, 20, 20)) * \ u.Unit('1e-17 erg/s/cm2/AA') sdss = filters.load_filters('sdss2010-*') flam, lam = sdss.pad_spectrum(spectrum=flam0, wavelength=lam0, method='zero', axis=0) print(flam0.shape, lam0.shape, flam.shape, lam.shape)
which outputs (1700, 20, 237) (1917,) instead of (1917, 20, 20), (1917,)
(1700, 20, 237) (1917,)
(1917, 20, 20), (1917,)
my version is 0.5
The workaround seems to be to np.moveaxis from 0 ==> -1 prior to calling pad_spectrum, and then reversing that operation after.
np.moveaxis
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The
FilterResponse
object'spad_spectrum
method appears to not add elements along the correct axis. For example...which outputs
(1700, 20, 237) (1917,)
instead of(1917, 20, 20), (1917,)
my version is 0.5
The workaround seems to be to
np.moveaxis
from 0 ==> -1 prior to callingpad_spectrum
, and then reversing that operation after.The text was updated successfully, but these errors were encountered: