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

Module updateasn

source code

updateasn.py - Module to update an ACS-style association
    table.

W.J. Hack 25 Jul 2002
    Initial Version
Version 0.5 (11-May-2005) (WJH) - Updated to package reference WCS as extension
                of ASN table when a shiftfile has been provided.


Version: 0.6 (18-July-2005)

Functions [hide private]
 
updateAsnTable(tabname, rootname, xsh=None, ysh=None, form="absolute", rot=None, scale=None, frame="input", units="pixels", output=None, mode="replace")
Updates an existing ASN table with shifts in arcseconds of RA and Dec.
source code
 
_getExposure(img, output, frame, idckey) source code
 
updateShifts(tabname, shiftfile, mode='replace', clean=no)
Update an ASN table with shifts provided in shiftfile.
source code
 
help() source code
Variables [hide private]
  IDCKEYS = {'WFPC2': 'idctab', 'ACS': 'idctab', 'STIS': 'cubic'...
  yes = True
  no = False

Imports: os, string, pyfits, N, pydrizzle, buildasn, fileutil, wcsutil


Function Details [hide private]

updateAsnTable(tabname, rootname, xsh=None, ysh=None, form="absolute", rot=None, scale=None, frame="input", units="pixels", output=None, mode="replace")

source code 
Updates an existing ASN table with shifts in arcseconds of RA and Dec.
    Parameters:
        tabname     - name of ASN table to be updated
        rootname    - name of image whose pointing needs to be updated
        xsh         - X shift from nominal to be applied
        ysh         - Y shift from nominal to be applied
        rot         - additional rotation to be applied
        scale       - scale factor to be applied
        form        - specifies how shifts are computed:
                        absolute (default) or delta
        frame       - specifies whether xsh/ysh are given in terms of
                        input (default) or output frame
        units       - specifies units of xsh/ysh:
                        pixels (default) or arcseconds
        output      - filename (with or without path) of output image
                      from which output pixels shifts were computed.
        mode        - replace or add shifts to existing values
                        'replace' (default) or 'sum'
    The task will:
        - open the ASN file (tabname)
        - search for the row matching the rootname provided by
            the user (img),
        - convert any pixel shifts to arcseconds
        - update the XOFFSET, YOFFSET, ROTATION columns
            (or create them if they don't already exist)

    This task assumes that the shifts given as 'input' pixels are
    already distortion-corrected, but not scaled/rotated to output frame.

    The conversion of shifts given in terms of output pixel coordinates
    requires the use of the WCS from the output frame in order to correctly
    take into account the output frame's pixel scale and orientation.

    Both input and output image specifications assume '.fits' and that
    the WCS information appropriate for this are in either [0] or [sci,1].
    If necessary a different extension can be specified in the filename.
    Also, the output filename can include a path which will be used.

EXAMPLE:
        1. Update ASN table 'j8cw03020_asn.fits' for 'j8cw03021_crj.fits'
            which has pixel shifts of (10.3,4.72) in (undistorted) input
            frame.
        >>> updateasn.updateAsnTable('j8cw03020_asn.fits','j8cw03021',
            xsh=10.3,ysh=4.72,rot=0.14)
NOTE:
    This task still does not correctly work with 'NaN' entries in
    the table.  For those values, it will not change the values at all.

updateShifts(tabname, shiftfile, mode='replace', clean=no)

source code 

Update an ASN table with shifts provided in shiftfile. The 'units', 'frame', and 'reference' will all be derived from the shiftfile itself, with defaults set by 'readShiftFile'.

If 'clean' == yes, then remove the shiftfile and any reference WCS file after they have been used to update the ASN table.


Variables Details [hide private]

IDCKEYS

Value:
{'WFPC2': 'idctab', 'ACS': 'idctab', 'STIS': 'cubic', 'NICMOS': 'cubic\
', 'detector': 'idctab'}