Sky coordinates

Sky coordinates are represented by a string, an epoch, and up to three coordinate values.

C/C++

Include the header “ska-sdp-func/utility/sdp_sky_coord.h” to use these functions.

sdp_SkyCoord *sdp_sky_coord_create(const char *type, double coord0, double coord1, double coord2)

Creates a data structure to encapsulate sky coordinates.

Sky coordinates are fully described by a coordinate type string, an epoch, and up to three coordinate values (one for each spatial dimension).

Context for the coordinate values is given by the coordinate type (values for which are still to be defined).

The default epoch value is 2000.0, but can be set using sdp_sky_coord_set_epoch().

Parameters:
  • type – String describing coordinate type.

  • coord0 – Value of the first coordinate.

  • coord1 – Value of the second coordinate.

  • coord2 – Value of the third coordinate.

Returns:

sdp_SkyCoord* Handle to sky coordinate structure.

void sdp_sky_coord_free(sdp_SkyCoord *sky_coord)

Releases memory held by the sdp_SkyCoord handle.

Parameters:

sky_coord – Handle to sky coordinate.

double sdp_sky_coord_epoch(const sdp_SkyCoord *sky_coord)

Returns the value of the coordinate epoch.

Parameters:

sky_coord – Handle to sky coordinate.

Returns:

Value of the coordinate epoch.

void sdp_sky_coord_set_epoch(sdp_SkyCoord *sky_coord, double epoch)

Sets the coordinate epoch value.

Parameters:
  • sky_coord – Handle to sky coordinate.

  • epoch – Value of coordinate epoch.

const char *sdp_sky_coord_type(const sdp_SkyCoord *sky_coord)

Returns the coordinate type string.

Parameters:

sky_coord – Handle to sky coordinate.

Returns:

Pointer to string describing coordinate type.

double sdp_sky_coord_value(const sdp_SkyCoord *sky_coord, int32_t dim)

Returns the value of the specified coordinate.

Parameters:
  • sky_coord – Handle to sky coordinate.

  • dim – Coordinate dimension index (starting 0; max 2).

Returns:

Value of specified coordinate.

Python

class ska_sdp_func.utility.SkyCoord(*args)

Class to wrap sky coordinates for passing to processing functions.

__init__(*args)

Create a new sky coordinate object.

The arguments are the coordinate type as a string, and up to three coordinate values coord0, coord1, coord2.

Alternatively, an existing SkyCoord or an astropy SkyCoord object can be passed instead.

The default epoch value is 2000.0, but can be set using set_epoch().

epoch() float

Returns the value of the coordinate epoch

value(dim: int) float

Returns the value of the selected coordinate.

Parameters:

dim – Coordinate dimension index (starting 0; max 2).

Returns:

Value of specified coordinate, or 0 if ‘dim’ is out of bounds.

set_epoch(epoch: float) None

Sets the coordinate epoch value.

Parameters:

epoch – Value of coordinate epoch.

type() str

Returns the coordinate type string