# wcs_from_points¶

gwcs.wcstools.wcs_from_points(xy, world_coordinates, fiducial, projection=<Sky2Pix_Gnomonic()>, 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_coordinatestuple of 2 ndarrays

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

fiducial_pointSkyCoord

A fiducial point in the output coordinate frame.

projectionProjection

A projection type. One of the projections in projcode.

degreeint

Degree of Polynpomial model to be fit to data.

polynomial_typestr

one of “polynomial”, “chebyshev”, “legendre”

Returns
wcsobjWCS

a WCS object for this observation.

Notes

This function implements the following algorithm: world_coordinates 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.