I have a time series dataset which I have windowed into n segments. My data now has dimensions (n, t, x, y). I wish to apply a cosine taper with dimension (t,) to each segment, but I obviously cannot multiply an array of dimension (t,) to an array of dimension (t, x, y).
Can someone provide me with a way to do this?
You can multiply them using NumPy broadcasting.
In this case just reshape your cosine window and multiply something like
# data set with shape (n, t, x, y), window has shape (t,)
tapered_data = data * window.reshape(1, t, 1, 1)