aerosandbox.numpy.interpolate ============================= .. py:module:: aerosandbox.numpy.interpolate Functions --------- .. autoapisummary:: aerosandbox.numpy.interpolate.interp aerosandbox.numpy.interpolate.is_data_structured aerosandbox.numpy.interpolate.interpn Module Contents --------------- .. py:function:: interp(x, xp, fp, left=None, right=None, period=None) One-dimensional linear interpolation, analogous to numpy.interp(). Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x. See syntax here: https://numpy.org/doc/stable/reference/generated/numpy.interp.html Specific notes: xp is assumed to be sorted. .. py:function:: is_data_structured(x_data_coordinates, y_data_structured) Determines if the shapes of a given dataset are consistent with "structured" (i.e. gridded) data. For this to evaluate True, the inputs should be: x_data_coordinates: A tuple or list of 1D ndarrays that represent coordinates along each axis of a N-dimensional hypercube. y_data_structured: The values of some scalar defined on that N-dimensional hypercube, expressed as an N-dimesional array. In other words, y_data_structured is evaluated at `np.meshgrid(*x_data_coordinates, indexing="ij")`. Returns: Boolean of whether the above description is true. .. py:function:: interpn(points, values, xi, method = 'linear', bounds_error=True, fill_value=_onp.nan) Performs multidimensional interpolation on regular grids. Analogue to scipy.interpolate.interpn(). See syntax here: https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interpn.html :param points: The points defining the regular grid in n dimensions. Tuple of coordinates of each axis. Shapes (m1, :param ): :type ): mn, :param ...: :type ...: mn, :param : :type : mn, :param values: The data on the regular grid in n dimensions. Shape (m1, ..., mn) :param xi: The coordinates to sample the gridded data at. (..., ndim) :param method: The method of interpolation to perform. one of: * "bspline" (Note: differentiable and suitable for optimization - made of piecewise-cubics. For other applications, other interpolators may be faster. Not monotonicity-preserving - may overshoot.) * "linear" (Note: differentiable, but not suitable for use in optimization w/o subgradient treatment due to C1-discontinuity) * "nearest" (Note: NOT differentiable, don't use in optimization. Fast.) :param bounds_error: If True, when interpolated values are requested outside of the domain of the input data, :param a ValueError is raised. If False: :param then fill_value is used.: :param fill_value: If provided, the value to use for points outside of the interpolation domain. If None, :param values outside the domain are extrapolated.: Returns: Interpolated values at input coordinates.