Location: Glucose Uptake in Enterocyte @ c052b0c46028 / SEDML_files / plot_func.py

Author:
nima <nafs080@aucklanduni.ac.nz>
Date:
2020-09-30 10:48:46+13:00
Desc:
Renamed the files
Permanent Source URI:
https://models.physiomeproject.org/workspace/572/rawfile/c052b0c460280139dad150937fbee4fa6a026505/SEDML_files/plot_func.py


def smooth_func(x,y,fil,order,kind='linear'):
	import numpy as np
	from scipy.signal import savgol_filter
	from scipy.interpolate import interp1d

	xx = np.linspace(x.min(),x.max(), 1000)
	itp = interp1d(x,y, kind=kind)
	window_size, poly_order = fil, order
	yy_sg = savgol_filter(itp(xx), window_size, poly_order)

	return xx, yy_sg