get_xy_pos

tessilator.aperture.get_xy_pos(targets, head)[source]

Locate the X-Y position for targets in a given Sector/CCD/Camera mode

The function reads in the RA and DEC positions of each target, and the metadata (header) of the input fits frame containing the WCS information. A WCS transformation is attempted first, which uses the world_to_array_index module to assign pixel values that match the indexing order of numpy arrays. If the WCS transformation fails, then the Xpos and Ypos columns from the input table are used. If Xpos and Ypos are not available, the function returns an error.

Parameters:
targetsastropy.table.Table

The table of input data with celestial coordinates.

headastropy.io.fits

The fits header containing the WCS coordinate details.

Returns:
positionstuple

A tuple of X-Y pixel positions for each target.