Made a interp_nans method to fill nan and infs

The method finds all nans and infs (optionally a dummy value) and fills
them by interpolation.