Skip to main content
`Ctrl`+`K`

# SkyCoordTableCoordinate

class ndcube.extra_coords.SkyCoordTableCoordinate(*tables, mesh=False, names=None, physical_types=None)

  Bases: `BaseTableCoordinate`

  A lookup table created from a `SkyCoord`.

  Parameters:

    - table (`SkyCoord`) – SkyCoord of coordinates. Only one can be provided.

    - mesh (`bool`) – If True, world components of input SkyCoord are interpreted to represent different array dimensions. Input SkyCoord must be 1-D.

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

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

  Notes

  If mesh is True, underlying SkyCoord must always be “square” due to nature of `SkyCoord`, i.e. the lat and lon components are always the same length.

  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

  `combine_slices`(slice1, slice2) |
  `interpolate`(*new_array_grids[, mesh_output]) | Interpolate SkyCoordTableCoordinate 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 that if mesh is False, this is equivalent to the number of dimensions in the underlying SkyCoord. However, if mesh is True it is equivalent to the number of components, e.g. lon, lat, etc.

  shape

    Shape of the array grid to which this TableCoordinate corresponds.

    Note this may be different from the shape of the underlying SkyCoord if mesh is True. In this case the components (e.g. lon, lat) represent different dimensions and the length of each dimension is dictated by the attached _slice.

  Methods Documentation

  static combine_slices(slice1, slice2)
  interpolate(
    *new_array_grids,
    mesh_output=None,
    **kwargs,
  )

    Interpolate SkyCoordTableCoordinate to new array index grids.

    Parameters:

      - new_array_grids (array-like) – The array index values at which 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.

      - mesh_output (`bool`) – If new_array_grids are 1-D, this keyword sets whether the resulting SkyCoordTableCoordinate’s mesh setting is True or False. If new_array_grids are >1-D, mesh is always set to False. Default is to maintain mesh setting from pre-interpolated object.

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

    Returns:

      new_coord – New TableCoordinate object holding the interpolated coords.

    Return type:

      `SkyCoordTableCoordinate`

  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”.