lightkurve.periodogram.Periodogram.smooth#
- Periodogram.smooth(method='boxkernel', filter_width=0.1)[source]#
Smooths the power spectrum using the ‘boxkernel’ or ‘logmedian’ method.
If
methodis set to ‘boxkernel’, this method will smooth the power spectrum by convolving with a numpy Box1DKernel with a width offilter_width, wherefilter widthis in units of frequency. This is best for filtering out noise while maintaining seismic mode peaks. This method requires the Periodogram to have an evenly spaced grid of frequencies. AValueErrorexception will be raised if this is not the case.If
methodis set to ‘logmedian’, it smooths the power spectrum using a moving median which moves across the power spectrum in a steps oflog10(x0) + 0.5 * filter_width
where
filter widthis in log10(frequency) space. This is best for estimating the noise background, as it filters over the seismic peaks.Periodograms that are unsmoothed have multiplicative noise that is distributed as chi squared 2 degrees of freedom. This noise distribution has a well defined mean and median but the two are not equivalent. The mean of a chi squared 2 dof distribution is 2, but the median is 2(8/9)**3. (see https://en.wikipedia.org/wiki/Chi-squared_distribution) In order to maintain consistency between ‘boxkernel’ and ‘logmedian’ a correction factor of (8/9)**3 is applied to (i.e., the median is divided by the factor) to the median values.
In addition to consistency with the ‘boxkernel’ method, the correction of the median values is useful when applying the periodogram flatten method. The flatten method divides the periodgram by the smoothed periodogram using the ‘logmedian’ method. By appyling the correction factor we follow asteroseismic convention that the signal-to-noise power has a mean value of unity. (note the signal-to-noise power is really the signal plus noise divided by the noise and hence should be unity in the absence of any signal)
- Parameters
- methodstr, one of ‘boxkernel’ or ‘logmedian’
The smoothing method to use. Defaults to ‘boxkernel’.
- filter_widthfloat
If
method= ‘boxkernel’, this is the width of the smoothing filter in units of frequency. If method =logmedian, this is the width of the smoothing filter in log10(frequency) space.
- Returns
- smoothed_pg
Periodogramobject Returns a new
Periodogramobject in which the power spectrum has been smoothed.
- smoothed_pg