<p>I have an (observed) SED of a galaxy, and am attempting to match model SEDs to it. To do this I need to be able to see its shape better, which would involve some sort of smoothing of the spectrum. I would like to do this in Python. I've looked through scipy's various smoothing tools (like UnivariateSpline), but don't know if that's on the right track since that would only be some best fit to my spectral data.</p>

<p>I also used the Iris software to perform an interpolation of my spectrum with 1000 bins and the smoothing option turned on, but I do not understand the computational process behind this. How might I accomplish this in Python?</p>

CC BY-SA 4.0
2019-04-12T21:04:31.100Z
Are you trying to fit to the continuum level, in which a low order polynomial or spline (as you suggest) will work or trying to smooth the absorption/emission line features to make the model and observed SED match better ? In the latter case, something like `Box1DKernel ` or `Gaussian1DKernel` from `astropy.convolution` would probably work better
astrosnapper
CC BY-SA 4.0
2019-04-12T21:18:36.947Z
Yes, I'm interested in the latter case. However I'm struggling to come to terms with how a Gaussian filter would be appropriate for smoothing an SED. Do you mind elaborating on why this might be preferred?
curious_cosmo
CC BY-SA 4.0
2019-04-16T01:15:58.557Z
Sorry Friday's reply vanished into the ether. You want a resolution in your model SED that matches the instrumental resolution so that you don't overfit to features that aren't resolvable in the data. The effect of the finite spectrograph slit width is to add broadening which is normally approximated by a Gaussian. In addition a spread in velocity of the stars making up the galaxy's SED will also cause broadening of the model. There is more information on the fitting [in this review](http://www.sedfitting.org/Paper_vs1.0_online/walcher_ms.html) and in general at http://www.sedfitting.org
astrosnapper
<spectra><python><post-processing>
Smoothing an SED with binning
curious_cosmo
# Smoothing an SED with binning

(Asked by: username_0 on 2019-04-12)

I have an (observed) SED of a galaxy, and am attempting to match model SEDs to it. To do this I need to be able to see its shape better, which would involve some sort of smoothing of the spectrum. I would like to do this in Python. I've looked through scipy's various smoothing tools (like UnivariateSpline), but don't know if that's on the right track since that would only be some best fit to my spectral data.

I also used the Iris software to perform an interpolation of my spectrum with 1000 bins and the smoothing option turned on, but I do not understand the computational process behind this. How might I accomplish this in Python?

**Tags:** spectra, python, post-processing

> **Comments:**
> **username_1**: Are you trying to fit to the continuum level, in which a low order polynomial or spline (as you suggest) will work or trying to smooth the absorption/emission line features to make the model and observed SED match better ? In the latter case, something like `Box1DKernel ` or `Gaussian1DKernel` from `astropy.convolution` would probably work better  
> **username_0**: Yes, I'm interested in the latter case. However I'm struggling to come to terms with how a Gaussian filter would be appropriate for smoothing an SED. Do you mind elaborating on why this might be preferred?  
> **username_1**: Sorry Friday's reply vanished into the ether. You want a resolution in your model SED that matches the instrumental resolution so that you don't overfit to features that aren't resolvable in the data. The effect of the finite spectrograph slit width is to add broadening which is normally approximated by a Gaussian. In addition a spread in velocity of the stars making up the galaxy's SED will also cause broadening of the model. There is more information on the fitting [in this review](http://www.sedfitting.org/Paper_vs1.0_online/walcher_ms.html) and in general at http://www.sedfitting.org  

---

## 0 answers

