Skip to main content
`Ctrl`+`K`

# Tabular2D

class astropy.modeling.tabular.Tabular2D(points=None, lookup_table=None, method='linear', bounds_error=True, fill_value=nan, **kwargs)

  Bases: `_Tabular`

  Tabular model in 2D. Returns an interpolated lookup table value.

  Parameters:
    points `python:tuple` of `ndarray` of `python:float`, optional

      The points defining the regular grid in n dimensions. ndarray with shapes (m1, m2).

    lookup_table numpy:array_like

      The data on a regular grid in 2 dimensions. Shape (m1, m2).

    method `python:str`, optional

      The method of interpolation to perform. Supported are “linear” and “nearest”, and “splinef2d”. “splinef2d” is only supported for 2-dimensional data. Default is “linear”.

    bounds_error bool, optional

      If True, when interpolated values are requested outside of the domain of the input data, a ValueError is raised. If False, then `fill_value` is used.

    fill_value `python:float`, optional

      If provided, the value to use for points outside of the interpolation domain. If None, values outside the domain are extrapolated. Extrapolation is not supported by method “splinef2d”.

  Returns:
    value `ndarray`

      Interpolated values at input coordinates.

  Raises:
    `ImportError`

      Scipy is not installed.

  Notes

  Uses `scipy.interpolate.interpn`.

  Attributes Summary

  `lookup_table` |
  `n_inputs` |
  `n_outputs` |

  Methods Summary

  `__call__`(*inputs[, model_set_axis, ...]) | Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

  Attributes Documentation

  lookup_table = array([[0., 0.], [0., 0.]])
  n_inputs = 2
  n_outputs = 1

  Methods Documentation

  __call__(*inputs, model_set_axis=None, with_bounding_box=False, fill_value=nan, equivalencies=None, inputs_map=None, **new_inputs)

    Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.