Skip to main content
`Ctrl`+`K`

# QuantityTableCoordinate

class ndcube.extra_coords.QuantityTableCoordinate(*tables, names=None, physical_types=None)

  Bases: `BaseTableCoordinate`

  A lookup table up built on `Quantity`.

  Quantities must be 1-D but more than one can be provided to represent different dimensions of an N-D coordinate.

  Parameters:

    - tables (one or more `Quantity`) – The coordinates. Must be 1 dimensionsal. If coordinate system is >1D, multiple 1-D Quantities can be provided representing the different dimensions

    - names (`str` or `list` of `str`) – Custom names for the components of the QuantityTableCoord. If provided, a name must be given for each input Quantity.

    - physical_types (str` or `list` of `str`) – Physical types for the components of the QuantityTableCoord. If provided, a physical type must be given for each input Quantity. Physical types of the components of the SkyCoord. If provided, a physical type must be given for each component.

  Attributes Summary

  `frame` | Generate the Frame for this LookupTable.
  `model` | Generate the Astropy Model for this LookupTable.
  `n_inputs` | Number of pixel dimensions in this table.
  `ndim` | Number of array dimensions to which this TableCoordinate corresponds.
  `shape` | Shape of the array grid to which this TableCoordinate corresponds.

  Methods Summary

  `interpolate`(*new_array_grids, **kwargs) | Interpolate QuantityTableCoordinate to new array index grids.
  `is_scalar`() | Return a boolean if this coordinate is a scalar.

  Attributes Documentation

  frame

    Generate the Frame for this LookupTable.

  model

    Generate the Astropy Model for this LookupTable.

  n_inputs
  ndim

    Number of array dimensions to which this TableCoordinate corresponds.

    Note this may be different from the number of the dimensions in the underlying table(s) if different tables represent different dimensions.

  shape

    Shape of the array grid to which this TableCoordinate corresponds.

    Note this may be different from the shape of the underlying table(s) if different tables represent a different dimensions.

  Methods Documentation

  interpolate(*new_array_grids, **kwargs)

    Interpolate QuantityTableCoordinate to new array index grids.

    Parameters:

      - new_array_grids (array-like) – The array index values at which the the new values of the coords are desired. An array grid must be provided as a separate arg for each array dimension and corresponding elements in all arrays represent a single location in the pixel grid. Therefore, array grids must all have the same shape.

      - kwargs – All remaining kwargs are passed to underlying interpolation function.

    Returns:

      new_coord – New TableCoordinate object holding the interpolated coords.

    Return type:

      `QuantityTableCoordinate`

  is_scalar()

    Return a boolean if this coordinate is a scalar.

    This is used by `MultipleTableCoordinate` and `ndcube.ExtraCoords` to know if the dimension has been “dropped”.