Open
Description
This is a companion issue to #602 . There I gave an idea for how we might have box_smooth
accept spectral axes as an argument to the box size. This issue is to try to do the same for convolution_smooth
.
The issue is: convolution_smooth
takes kernel objects instead of an actual pixel size. So specutils
does not control the API. I see two immediate ways to fix this:
- Do a PR to Astropy to allow some way for unit-ful kernels to be passed into convolution kernels. This is a non-trivial thing, though, because the unit-to-pixel mapping here is specific to a spectral context. So it would also need some sort of callback with a reference to the
Spectrum1D
and so on, which starts getting complicated and of questionable utility pretty quickly. - Have a specutils function that takes in a spectrum and a "kernel size" in spectral axis units and outputs the best-guess at the corresponding pixel size. This would basically be the solution I suggested in Have box_smooth accept spectral axis units instead of just pixels #602 but with the machinery broken out as a separate function that can be called independently from
box_smooth
. Then the user has to explicitly do something likeconvolution_smooth(spectrum, MyFavoriteKernel(some_size_parameter=estimate_pixel_from_spectral_axis(spectrum, 2*u.angstrom))
.
It's probably clear from my tone that I favor option 2, but there might be other ideas for solving this I haven't thought of...