Sip

class astropy.wcs.Sip(*a, b, ap, bp, crpix*)

Bases: object

The Sip class performs polynomial distortion correction using the SIP convention in both directions.

Parameters:
andarray

The A_i_j polynomial for pixel to focal plane transformation as double array[m+1][m+1]. Its size must be (m + 1, m + 1) where m = A_ORDER.

bndarray

The B_i_j polynomial for pixel to focal plane transformation as double array[m+1][m+1]. Its size must be (m + 1, m + 1) where m = B_ORDER.

apndarray

The AP_i_j polynomial for pixel to focal plane transformation as double array[m+1][m+1]. Its size must be (m + 1, m + 1) where m = AP_ORDER.

bpndarray

The BP_i_j polynomial for pixel to focal plane transformation as double array[m+1][m+1]. Its size must be (m + 1, m + 1) where m = BP_ORDER.

crpixndarray

The reference pixel as double array[2].

Notes

Shupe, D. L., M. Moshir, J. Li, D. Makovoz and R. Narron. 2005. “The SIP Convention for Representing Distortion in FITS Image Headers.” ADASS XIV.

Attributes Summary

a

double array[a_order+1][a_order+1] Focal plane transformation matrix.

a_order

int (read-only) Order of the polynomial (A_ORDER).

ap

double array[ap_order+1][ap_order+1] Focal plane to pixel transformation matrix.

ap_order

int (read-only) Order of the polynomial (AP_ORDER).

b

double array[b_order+1][b_order+1] Pixel to focal plane transformation matrix.

b_order

int (read-only) Order of the polynomial (B_ORDER).

bp

double array[bp_order+1][bp_order+1] Focal plane to pixel transformation matrix.

bp_order

int (read-only) Order of the polynomial (BP_ORDER).

crpix

double array[naxis] Coordinate reference pixels (CRPIXja) for each pixel axis.

Methods Summary

foc2pix

sip_foc2pix(foccrd, origin) -> double array[ncoord][nelem]

pix2foc

sip_pix2foc(pixcrd, origin) -> double array[ncoord][nelem]

Attributes Documentation

a

double array[a_order+1][a_order+1] Focal plane transformation matrix.

The SIP A_i_j matrix used for pixel to focal plane transformation.

Its values may be changed in place, but it may not be resized, without creating a new Sip object.

a_order

int (read-only) Order of the polynomial (A_ORDER).

ap

double array[ap_order+1][ap_order+1] Focal plane to pixel transformation matrix.

The SIP AP_i_j matrix used for focal plane to pixel transformation. Its values may be changed in place, but it may not be resized, without creating a new Sip object.

ap_order

int (read-only) Order of the polynomial (AP_ORDER).

b

double array[b_order+1][b_order+1] Pixel to focal plane transformation matrix.

The SIP B_i_j matrix used for pixel to focal plane transformation. Its values may be changed in place, but it may not be resized, without creating a new Sip object.

b_order

int (read-only) Order of the polynomial (B_ORDER).

bp

double array[bp_order+1][bp_order+1] Focal plane to pixel transformation matrix.

The SIP BP_i_j matrix used for focal plane to pixel transformation. Its values may be changed in place, but it may not be resized, without creating a new Sip object.

bp_order

int (read-only) Order of the polynomial (BP_ORDER).

crpix

double array[naxis] Coordinate reference pixels (CRPIXja) for each pixel axis.

Methods Documentation

foc2pix()

sip_foc2pix(foccrd, origin) -> double array[ncoord][nelem]

Convert focal plane coordinates to pixel coordinates using the SIP polynomial distortion convention.

Parameters:
foccrdndarray

Array of focal plane coordinates as double array[ncoord][nelem].

originpython:int

Specifies the origin of pixel values. The Fortran and FITS standards use an origin of 1. Numpy and C use array indexing with origin at 0.

Returns:
pixcrdndarray

Returns an array of pixel coordinates as double array[ncoord][nelem].

Raises:
MemoryError

Memory allocation failed.

ValueError

Invalid coordinate transformation parameters.

pix2foc()

sip_pix2foc(pixcrd, origin) -> double array[ncoord][nelem]

Convert pixel coordinates to focal plane coordinates using the SIP polynomial distortion convention.

Parameters:
pixcrdndarray

Array of pixel coordinates as double array[ncoord][nelem].

originpython:int

Specifies the origin of pixel values. The Fortran and FITS standards use an origin of 1. Numpy and C use array indexing with origin at 0.

Returns:
foccrdndarray

Returns an array of focal plane coordinates as double array[ncoord][nelem].

Raises:
MemoryError

Memory allocation failed.

ValueError

Invalid coordinate transformation parameters.