I am trying to use the astropy module to smooth my data. As a 1D example I have tried the following code:
import numpy as np
from astropy import convolution as conv
var1=np.arange(10)
kernel=np.asarray([-1,1,0])
conv.convolve(var1,kernel)
This returns in my case: array([ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan])
I assumed that it should return array([0,1,1,1,1,1,1,1,1,1])
. I have tried using for var1 datatypes uint8, int8 and float32. I have also tried using convolve_fft
, with the same result.
I am familiar with the convolution filter of scipy but I want to use astropy for when NaN values are actually present in my data, so as to smooth them over.