gwcs.wcstools.wcs_from_points¶
- gwcs.wcstools.wcs_from_points(xy, world_coords, proj_point='center', projection=None, poly_degree=4, polynomial_type='polynomial')¶
Given two matching sets of coordinates on detector and sky, compute the WCS.
Notes
This function implements the following algorithm:
world_coordsare transformed to a projection plane using the specified projection. A polynomial fitsxyand the projected coordinates. The fitted polynomials and the projection transforms are combined into a transform from detector to sky. The input coordinate frame is set todetector. The output coordinate frame is initialized based on the frame in the fiducial.- Parameters:
xy (tuple) – Points in the input coordinate frame - x, y inputs.
world_coords (
SkyCoord) – Points in the output coordinate frame. The order matches the order ofxy.proj_point (
SkyCoord) – 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.projection (
Projection) – A projection type. One of the projections inprojcodes. The direction is from sky to detector. Defaults to TAN projection (astropy.modeling.projections.Sky2Pix_TAN).poly_degree (int) – Degree of polynomial model to be fit to data. Defaults to 4.
polynomial_type (str) – one of “polynomial”, “chebyshev”, “legendre”. Defaults to “polynomial”.
- Returns:
wcsobj – a WCS object for this observation.
- Return type: