A Fourier-based method for the restoration of chopped and nodded images