;-------------------------------------------------------------- ; input, v = an array whose missing value are set to missing ; width = width argument to smooth ; missing = the missing value for v ; ; output, v = the smoothed version of v ;-------------------------------------------------------------- function smooth_nan, v, width, missing v[where(v eq missing,/NULL)] = !Values.F_NaN v = smooth(v,width,/NAN) v[where(finite(v,/Nan),/Null)] = missing return, v end