Package pydrizzle :: Module drutil
[hide private]
[frames] | no frames]

Module drutil

source code

Utility functions for PyDrizzle that rely on PyRAF's interface to IRAF tasks.

Functions [hide private]
 
factorial(n)
Compute a factorial for integer n.
source code
 
combin(j, n)
Return the combinatorial factor for j in n.
source code
 
findNumExt(filename) source code
 
getLTVOffsets(rootname, header=None) source code
 
getChipId(header) source code
 
getIDCFile(image, keyword=None, directory=None) source code
 
__buildIDCTAB(header, directory, kw=None) source code
 
__getIDCTAB(header) source code
 
getIDCFileType(idcfile)
Open ASCII IDCFILE to determine the type: cubic,trauger,...
source code
 
readCubicTable(idcfile) source code
 
_MgF2(lam) source code
 
readTraugerTable(idcfile, wavelength) source code
 
rotateCubic(fxy, theta) source code
 
rotatePos(pos, theta, offset=None, scale=None) source code
 
getRange(members, ref_wcs, verbose=None) source code
 
computeRange(corners)
Determine the range spanned by an array of pixel positions.
source code
 
convertWCS(inwcs, drizwcs)
Copy WCSObject WCS into Drizzle compatible array.
source code
 
updateWCS(drizwcs, inwcs)
Copy output WCS array from Drizzle into WCSObject.
source code
 
wcsfit(img_geom, ref)
Perform a linear fit between 2 WCS for shift, rotation and scale.
source code
 
fitlin(imgarr, refarr)
Compute the least-squares fit between two arrays.
source code
 
getRotatedSize(corners, angle)
Determine the size of a rotated (meta)image.
source code
Variables [hide private]
  DEGTORAD = fileutil.DEGTORAD
  no = False
  yes = True
  IDCTAB = 1
  DRIZZLE = 2
  TRAUGER = 3
  DEFAULT_IDCDIR = os.getcwd()

Imports: string, os, types, ceil, floor, N, linalg, fileutil, buildRotMatrix


Function Details [hide private]

wcsfit(img_geom, ref)

source code 

Perform a linear fit between 2 WCS for shift, rotation and scale.
Based on 'WCSLIN' from 'drutil.f'(Drizzle V2.9) and modified to
allow for differences in reference positions assumed by PyDrizzle's
distortion model and the coeffs used by 'drizzle'.

Parameters:
    img      - ObsGeometry instance for input image
    ref_wcs  - Undistorted WCSObject instance for output frame

fitlin(imgarr, refarr)

source code 

Compute the least-squares fit between two arrays. A Python translation of 'FITLIN' from 'drutil.f' (Drizzle V2.9).