wcs_from_points

gwcs.wcstools.wcs_from_points(xy, world_coords, proj_point='center', projection=<Sky2Pix_Gnomonic()>, poly_degree=4, polynomial_type='polynomial')[source]

Given two matching sets of coordinates on detector and sky, compute the WCS.

Parameters:
xytuple of 2 ndarrays

Points in the input cooridnate frame - x, y inputs.

world_coordsSkyCoord

Points in the output coordinate frame. The order matches the order of xy.

proj_pointSkyCoord

A fiducial point in the output coordinate frame. If set to ‘center’ (default), the geometric center of input world coordinates will be used as the projection point. To specify an exact point for the projection, a Skycoord object with a coordinate pair can be passed in.

projectionProjection

A projection type. One of the projections in projcodes. Defaults to TAN projection (astropy.modeling.projections.Sky2Pix_TAN).

poly_degreeint

Degree of polynomial model to be fit to data. Defaults to 4.

polynomial_typestr

one of “polynomial”, “chebyshev”, “legendre”. Defaults to “polynomial”.

Returns:
wcsobjWCS

a WCS object for this observation.

Notes

This function implements the following algorithm: world_coords are transformed to a projection plane using the specified projection. A polynomial fits xy and the projected coordinates. The fitted polynomials and the projection transforms are combined into a tranform from detector to sky. The input coordinate frame is set to detector. The output coordinate frame is initialized based on the frame in the fiducial.