def _damp_flux(flux, taperwidth):
"""Apply damping to the sides of the input flux. The damping applies to a width of
size taperwidth on each side of the domain.
Currently, uses a Tukey window.
Inputs:
flux input signal on which to damp sides (array)
taperwidth width over which to apply damping at each boundary, as a fraction of domain size (scalar)
Outputs:
dampedFlux signal with edges damped (array)
"""
alpha = taperwidth * 2 # alpha sets the width of the damping for the entire signal, accounting for both left and right boundaries
tukeyWindow = scipy.signal.tukey(len(flux), alpha)
dampedFlux = flux * tukeyWindow
return dampedFlux
评论列表
文章目录