linearfit

A module that provides algorithms for performing linear fits between sets of 2D points.

Authors:Mihai Cara, Warren Hack (contact: help@stsci.edu)
jwst.tweakreg.linearfit.iter_linear_fit(xy, uv, xyindx=None, uvindx=None, xyorig=None, uvorig=None, fitgeom='general', nclip=3, sigma=3.0, center=None)[source]

Compute iteratively using sigma-clipping linear transformation parameters that fit xy sources to uv sources.

jwst.tweakreg.linearfit.build_fit_matrix(rot, scale=1)[source]

Create an affine transformation matrix (2x2) from the provided rotation and scale transformations.

Parameters:
  • rot (tuple, float, optional) – Rotation angle in degrees. Two values (one for each axis) can be provided as a tuple.
  • scale (tuple, float, optional) – Scale of the liniar transformation. Two values (one for each axis) can be provided as a tuple.
Returns:

matrix – A 2x2 numpy.ndarray containing coefficients of a liniear transformation.

Return type:

numpy.ndarray