Package pywcs :: Module sip :: Class SIP
[frames] | no frames]

Class SIP

source code

object --+        
         |        
   WCSBase --+    
             |    
     pywcs.WCS --+
                 |
                SIP

An extended version of WCS that supports Simple (or Spitzer) Imaging Polynomial (SIP) distortion coefficients. In addition to all of the functionality of regular WCS objects, SIP objects also provide pix2foc and foc2pix to correct/apply the SIP distortion.

Instance Methods
 
__init__(self, header, relax=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
foc2pix(self, x, y=None)
Convert focal plane coordinates to pixel coordinates.
source code
 
pix2foc(u, v=None)
Convert pixel coordinates to focal plane coordinates.
source code
 
__copy__()
Creates a deep copy of the WCS object. (Inherited from pywcs.WCSBase)
source code
a new object with type S, a subtype of T
__new__(T, S, ...) (Inherited from pywcs.WCSBase) source code
int
celfix()
Translates AIPS-convention celestial projection types, -NCP and -GLS. (Inherited from pywcs.WCSBase)
source code
 
copy()
Creates a deep copy of the WCS object. (Inherited from pywcs.WCSBase)
source code
int
cylfix()
Fixes WCS keyvalues for malformed cylindrical projections. (Inherited from pywcs.WCSBase)
source code
int
datfix()
Translates the old DATE-OBS date format to year-2000 standard form (yyyy-mm-ddThh:mm:ss) and derives MJD-OBS from it if not already set. (Inherited from pywcs.WCSBase)
source code
dict
fix(translate_units='', naxis=0)
Applies all of the corrections handled separately by datfix, unitfix, celfix, spcfix and cylfix. (Inherited from pywcs.WCSBase)
source code
bool
has_cdi_ja()
Returns True if CDi_ja is present. (Inherited from pywcs.WCSBase)
source code
bool
has_crotaia()
Returns True if CROTAia is present. (Inherited from pywcs.WCSBase)
source code
bool
has_pci_ja()
Returns True if PCi_ja is present. (Inherited from pywcs.WCSBase)
source code
dict
mix(mixpix, mixcel, vspan, vstep, viter, world, pixcrd)
Given either the celestial longitude or latitude plus an element of the pixel coordinate, solves for the remaining elements by iterating on the unknown celestial coordinate element using s2p. (Inherited from pywcs.WCSBase)
source code
dict
p2s(pixcrd)
Converts pixel to world coordinates. (Inherited from pywcs.WCSBase)
source code
world
pixel2world(x, y=None)
Transforms world coordinates to pixel coordinates. (Inherited from pywcs.pywcs.WCS)
source code
 
print_contents()
Print the contents of the WCS object to stdout. (Inherited from pywcs.WCSBase)
source code
dict
s2p(world)
Transforms world coordinates to pixel coordinates. (Inherited from pywcs.WCSBase)
source code
 
set()
Sets up a WCS object for use according to information supplied within it. (Inherited from pywcs.WCSBase)
source code
int
spcfix()
Translates AIPS-convention spectral coordinate types. (Inherited from pywcs.WCSBase)
source code
 
sptr(ctype, i=-1)
Translates the spectral axis in a WCS object. (Inherited from pywcs.WCSBase)
source code
int
unitfix(translate_units='')
Translates non-standard CUNITia keyvalues. (Inherited from pywcs.WCSBase)
source code
pixel
world2pixel(ra, dec=None)
Transforms world coordinates to pixel coordinates. (Inherited from pywcs.pywcs.WCS)
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties
string alt
Character code for alternate coordinate descriptions. (Inherited from pywcs.WCSBase)
array[2][2] of double cd
CDi_ja linear transformation matrix. (Inherited from pywcs.WCSBase)
array[naxis] of double cdelt
Coordinate increments (CDELTia) for each coord axis. (Inherited from pywcs.WCSBase)
list of strings cname
A list of the coordinate axis names, CNAMEia. (Inherited from pywcs.WCSBase)
array[naxis] of int colax
An array recording the column numbers for each axis in a pixel list. (Inherited from pywcs.WCSBase)
  colnum
Where the coordinate representation is associated with an image-array column in a FITS binary table, this variable may be used to record the relevant column number. (Inherited from pywcs.WCSBase)
array[naxis] of double crder
The random error in each coordinate axis, CRDERia. (Inherited from pywcs.WCSBase)
array[2][2] of double crota
CROTAia keyvalues for each coordinate axis. (Inherited from pywcs.WCSBase)
array[naxis] of double crpix
Coordinate reference pixels (CRPIXja) for each pixel axis. (Inherited from pywcs.WCSBase)
array[naxis] of double crval
Coordinate reference values (CRVALia) for each coordinate axis. (Inherited from pywcs.WCSBase)
array[naxis] of double csyer
The systematic error in the coordinate value axes, CSYERia. (Inherited from pywcs.WCSBase)
list of strings ctype
List of CTYPEia keyvalues. (Inherited from pywcs.WCSBase)
int cubeface
Index into the pixcrd (pixel coordinate) array for the CUBEFACE axis. (Inherited from pywcs.WCSBase)
list of strings cunit
List of CUNITia keyvalues which define the units of measurement of the CRVALia, CDELTia and CDi_ja keywords. (Inherited from pywcs.WCSBase)
string dateavg
Representative mid-point of the date of observation in ISO format, yyyy-mm-ddThh:mm:ss. (Inherited from pywcs.WCSBase)
string dateobs
Start of the date of observation in ISO format, yyyy-mm-ddThh:mm:ss. (Inherited from pywcs.WCSBase)
float equinox
The equinox associated with dynamical equatorial or ecliptic coordinate systems, EQUINOXa (or EPOCH in older headers). (Inherited from pywcs.WCSBase)
int lat
The index into the world coordinate array containing latitude values. (Inherited from pywcs.WCSBase)
float latpole
The native latitude of the celestial pole, LATPOLEa (deg). (Inherited from pywcs.WCSBase)
int lng
The index into the world coordinate array containing longitude values. (Inherited from pywcs.WCSBase)
float lonpole
The native longitude of the celestial pole, LONPOLEa (deg). (Inherited from pywcs.WCSBase)
float mjdavg
Modified Julian Date (MJD = JD - 2400000.5), MJD-AVG, corresponding to DATE-AVG. (Inherited from pywcs.WCSBase)
float mjdobs
Modified Julian Date (MJD = JD - 2400000.5), MJD-OBS, corresponding to DATE-OBS. (Inherited from pywcs.WCSBase)
string name
The name given to the coordinate representation WCSNAMEa. (Inherited from pywcs.WCSBase)
int naxis
The number of axes (pixel and coordinate), given by the NAXIS or WCSAXESa keyvalues. (Inherited from pywcs.WCSBase)
array[3] of double obsgeo
Location of the observer in a standard terrestrial reference frame, OBSGEO-X, OBSGEO-Y, OBSGEO-Z (in metres). (Inherited from pywcs.WCSBase)
array[2][2] of double pc
The PCi_ja (pixel coordinate) transformation matrix. (Inherited from pywcs.WCSBase)
list of tuples ps
PSi_ma keywords for each i and m. (Inherited from pywcs.WCSBase)
list of tuples pv
PVi_ma keywords for each i and m. (Inherited from pywcs.WCSBase)
string radesys
The equatorial or ecliptic coordinate system type, RADESYSa. (Inherited from pywcs.WCSBase)
float restfrq
Rest frequency (Hz) from RESTFRQa. (Inherited from pywcs.WCSBase)
float restwav
Rest wavelength (m) from RESTWAVa. (Inherited from pywcs.WCSBase)
int spec
The index containing the spectral axis values. (Inherited from pywcs.WCSBase)
string specsys
Spectral reference frame (standard of rest), SPECSYSa (Inherited from pywcs.WCSBase)
string ssysobs
The actual spectral reference frame in which there is no differential variation in the spectral coordinate across the field-of-view, SSYSOBSa. (Inherited from pywcs.WCSBase)
string ssyssrc
The spectral reference frame (standard of rest) in which the redshift was measured, SSYSSRCa. (Inherited from pywcs.WCSBase)
float velangl
The angle in degrees that should be used to decompose an observed velocity into radial and transverse components. (Inherited from pywcs.WCSBase)
float velosys
The relative radial velocity (m/s) between the observer and the selected standard of rest in the direction of the celestial reference coordinate, VELOSYSa. (Inherited from pywcs.WCSBase)
float zsource
The redshift, ZSOURCEa, of the source. (Inherited from pywcs.WCSBase)

Inherited from object: __class__

Method Details

__init__(self, header, relax=False)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • header (PyFITS header object or string) - A PyFITS header object or a string containing the raw FITS header data.
  • relax (bool) - Degree of permissiveness:
    • False: Recognize only FITS keywords defined by the published WCS standard.
    • True: Admit all recognized informal extensions of the WCS standard.
Raises:
  • MemoryError - Memory allocation failed.
  • ValueError - Invalid key.
  • ValueError - Header does not contain SIP information.
  • KeyError - Key not found in FITS header.
Overrides: object.__init__
(inherited documentation)

foc2pix(self, x, y=None)

source code 

Convert focal plane coordinates to pixel coordinates.

Pixel coordinates are zero-based.

Parameters:
  • x (array of double) - Array of y focal plane coordinates, or if y is not provided, a 2-dimensional array of both x- and y-coordinates.
  • y (array of double or None) - Array of y focal plane coordinates. If provided, x must be 1-dimensional and the same length as y.
Returns:
If both x and {y} were provided, a 2-tuple of arrays, where the first element is u pixel coordinates and the second element is v pixel coordinates. Otherwise, a single 2D array containing both u and v.
Raises:
  • AssertionError - len(x) == len(y)

pix2foc(u, v=None)

source code 

Convert pixel coordinates to focal plane coordinates.

Pixel coordinates are zero-based.

Parameters:
  • u (array of double) - Array of u pixel coordinates, or if v is not provided, a 2-dimensional array of both u- and v-coordinates.
  • v (array of double or None) - Array of v pixel coordinates. If provided, u must be 1-dimensional and the same length as v.
Returns:
If both u and {v} were provided, a 2-tuple of arrays, where the first element is x focal plane coordinates and the second element is y focal plane coordinates. Otherwise, a single 2D array containing both x and y.
Raises:
  • AssertionError - len(u) == len(v)