smoothing
convolution of a scaled window with the signal
Smoothing of a 1D signal, 2D signal — SciPy Cookbook documentation
https://scipy-cookbook.readthedocs.io/items/SignalSmooth.html
Convolution and Filtering (astropy.convolution) — Astropy
http://docs.astropy.org/en/stable/convolution/
Proper treatment of NaN values (ignoring them during convolution and replacing NaN pixels with interpolated values)
MetPy Mondays `#87 - Smoothing Data - YouTube
https://www.youtube.com/watch?v=7k5rKTSEDKA
2D smoothing
code:python
def smooth(x,n):
import scipy as sp
w=np.ones((n,n),dtype=float)
w=w/w.sum()
xn=sp.signal.convolve(x,w,mode="same")
return xn
#scipy.signal
Filtfilt
Filtfilt — SciPy Cookbook documentation
https://scipy-cookbook.readthedocs.io/items/FiltFilt.html
Savitzky Golay Filtering
Savitzky Golay Filtering — SciPy Cookbook documentation
1D, 2D
https://scipy-cookbook.readthedocs.io/items/SavitzkyGolay.html
MetPy Mondays 88 - Savitzky-Golay : Unidata Developer's Blog
#scipy #numpy #pandas
https://www.unidata.ucar.edu/blogs/developer/entry/metpy-mondays-88-savitzky-golay
Laplace filter
Create maps using Etopo1 and matplotlib | Trond Kristiansen
http://www.trondkristiansen.com/?page_id=846
lanczos filter
Filtering out tides with pandas, iris and numpy
https://ocefpaf.github.io/python4oceanographers/blog/2014/11/24/filter/
LOESS/LOWESS
LOESS - Towards Data Science
https://towardsdatascience.com/loess-373d43b03564
statsmodels
statsmodels.nonparametric.smoothers_lowess.lowess
https://www.statsmodels.org/stable/generated/statsmodels.nonparametric.smoothers_lowess.lowess.html#statsmodels.nonparametric.smoothers_lowess.lowess
PythonでのLOWESSの信頼区間 - コードログ
https://codeday.me/jp/qa/20190211/235125.html
n-point smoothing
metpy calc smooth_n_point
https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.smooth_n_point.html
MetPy Mondays `#117 - Smoothing and Plotting : Unidata Developer's Blog
https://www.unidata.ucar.edu/blogs/developer/entry/metpy-mondays-117-smoothing-and
xarray
5-point smoothing
Median Filter
scipy.signal.medfilt
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.medfilt.html
MetPy Mondays `#87 - Smoothing Data - YouTube
https://www.youtube.com/watch?v=7k5rKTSEDKA
MetPy Mondays `#129 - Cleaning Up Glitchy Data : Unidata Developer's Blog
https://www.unidata.ucar.edu/blogs/developer/en/entry/metpy-mondays-129-cleaning-up
#QC
Tips
numpy - Detrend or Filter a sawtooth signal (Python) - Stack Overflow
https://stackoverflow.com/questions/35458363/detrend-or-filter-a-sawtooth-signal-python
Gaussian smoothing
#MetPy
smooth_gaussian
https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.smooth_gaussian.html
See also
#low-pass filtering