parameters: (array)
return_statement: return interpolate.griddata((x1, y1), newarr.ravel(), (xx, yy), method="linear", fill_value=np.average(array))
docstring: rise_time and tacc may not be defined where there is no slip (no SR function).
      in this case, we interpolate from neighbors
      source: https://stackoverflow.com/questions/37662180/interpolate-missing-values-2d-python
docstring_summary: rise_time and tacc may not be defined where there is no slip (no SR function).
      in this case, we interpolate from neighbors
      source: https://stackoverflow.com/questions/37662180/interpolate-missing-values-2d-python
docstring_tokens: rise_time and tacc may not be defined where there is no slip ( no SR function ) . in this case we interpolate from neighbors source : https : // stackoverflow . com / questions / 37662180 / interpolate - missing - values - 2d - python
function: def interpolate_nan_from_neighbors(array):
      """rise_time and tacc may not be defined where there is no slip (no SR function).
      in this case, we interpolate from neighbors
      source: https://stackoverflow.com/questions/37662180/interpolate-missing-values-2d-python
      """
      x = np.arange(0, array.shape[1])
      y = np.arange(0, array.shape[0])
      # mask invalid values
      array = np.ma.masked_invalid(array)
      xx, yy = np.meshgrid(x, y)
      # get only the valid values
      x1 = xx[~array.mask]
      y1 = yy[~array.mask]
      newarr = array[~array.mask]
      return interpolate.griddata((x1, y1), newarr.ravel(), (xx, yy), method="linear", fill_value=np.average(array))
function_tokens: def interpolate_nan_from_neighbors ( array ) : x = np . arange ( 0 , array . shape [ 1 ] ) y = np . arange ( 0 , array . shape [ 0 ] ) # mask invalid values array = np . ma . masked_invalid ( array ) xx , yy = np . meshgrid ( x , y ) # get only the valid values x1 = xx [ ~ array . mask ] y1 = yy [ ~ array . mask ] newarr = array [ ~ array . mask ] return interpolate . griddata ( ( x1 , y1 ) , newarr . ravel ( ) , ( xx , yy ) , method = "linear" , fill_value = np . average ( array ) )