pencil.calc.fill_gaps_in_grid ============================= .. py:module:: pencil.calc.fill_gaps_in_grid Functions --------- .. autoapisummary:: pencil.calc.fill_gaps_in_grid.fill_gaps_in_grid Module Contents --------------- .. py:function:: fill_gaps_in_grid(array, key='nan', steps=['interpolate', 'extrapolate'], order=1, DEBUG=False) Interpolates nans by nearest neighbor method to fill gaps in arrays. Beware this method does not invoke bondaries correctly! This method does not work with array beeing a vector field! Hence, use componentwise and stitch together manually! :param - array: array with nans inside :param - key: indicates array entries that will be interpolated :param - method: as specified in scipy.interpolate.griddata, i.e. use 'linear' for 3D data :returns: array without nans inside. .. rubric:: Example [[0, 1, 0], [[0, 1, 0,], [1, nan, 1], -interpol-> [1, 2, 1], [0, 1, 0]] [0, 1, 0]]