Package pydrizzle :: Class PyDrizzle
[hide private]
[frames] | no frames]

Class PyDrizzle

source code


Program to process and/or dither-combine image(s) using (t)drizzle.
To create an object named 'test' that corresponds to a drizzle product:
    --> test = pydrizzle.PyDrizzle(input)
where input is the FULL filename of an ACS observation or ASN table.
This computes all the parameters necessary for running drizzle on all
the input images.  Once this object is created, you can run drizzle using:
    --> test.run()

The 'clean()' method can be used to remove files which would interfere with
running Drizzle again using the 'run()' method after a product has already
been created.

Optional parameters:
    output      User-specified name for output products
    field       User-specified parameters for output image
                includes: psize, orient, ra, dec, shape
    units       Units for final product: 'counts' or 'cps'(DEFAULT)
    section     Extension/group to be drizzled: list or single FITS extension(s)
                 or group(s) syntax ('1' or 'sci,1') or None (DEFAULT: Use all chips).
    kernel      Specify which kernel to use in TDRIZZLE
                'square'(default),'point','gaussian','turbo','tophat'
    pixfrac     drizzle pixfrac value (Default: 1.0)
    idckey      User-specified keyword for determining IDCTAB filename
                'IDCTAB'(ACS default),'TRAUGER'(WFPC2),'CUBIC'(WFPC2)
    idcdir      User-specified directory for finding coeffs files:
                'drizzle$coeffs' (default)
    bits_single Specify DQ values to be considered good when
                    drizzling with 'single=yes'. (Default: 0)
    bits_final  Specify DQ values to be considered good when
                    drizzling with 'single=no'. (Default: 0)
Bits parameters will be interpreted as:
    None - No DQ information to be used, no mask created
    Int  - sum of DQ values to be considered good

Optional Parameters for '.run()':
    build       create multi-extension output: yes (Default) or no
    save        keeps the individual inputs from drizzle: yes or no (Default)
    single      drizzle to separate output for each input: yes or no (Default)
    blot        run blot on drizzled products: yes or no (Default)
    clean       remove coeffs and static mask files: yes or no (Default)

Optional Parameters for '.clean()':
    coeffs      Removes coeffs and static mask files: yes or no (Default)
    final       Removes final product: yes or no (Default)

Usage of optional parameters:
    --> test = pydrizzle.PyDrizzle('test_asn.fits',units='counts')
To keep the individual 'drizzle' output products:
    --> test.run(save=yes)

Output frame parameters can be modified 'on-the-fly' using 'resetPars'.
Given an already drizzled image 'refimg_drz.fits' as a reference,
reset drizzle parameters using:
    --> wcsref = wcsutil.WCSObject('refimg_drz.fits[sci,1]')
    --> f = pydrizzle.SkyField(wcs=wcsref)
Use either:
    --> test.resetPars(wcsref)
Or:
    --> test.resetPars(f)
Return to default parameters using no parameters at all:
    --> test.resetPars()
More help on SkyField objects and their parameters can be obtained using:
    --> f.help()
    

Instance Methods [hide private]
 
__init__(self, input, output=None, field=None, units=None, section=None, kernel=None, pixfrac=None, bits_final=0, bits_single=0, wt_scl='exptime', fillval=0., idckey='', in_units='counts', idcdir=DEFAULT_IDCDIR, memmap=0, dqsuffix=None, prodonly=yes, shiftfile=None) source code
 
clean(self, coeffs=no, final=no)
Removes intermediate products from disk.
source code
 
run(self, save=no, build=yes, blot=no, single=no, clean=no, interp='linear', sinscl=1.0, debug=no)
Perform drizzle operation on input to create output.
source code
 
resetPars(self, field=None, pixfrac=None, kernel=None, units=None)
Recompute the output parameters based on a new SkyField or WCSObject object.
source code
 
help(self)
Run the module level help function to provide syntax information.
source code
 
printPars(self, pars='xsh,ysh,rot,scale,outnx,outny,data', format=no)
Prints common parameters for review.
source code
 
getMember(self, memname)
Returns the class instance for the specified member name.
source code
Method Details [hide private]

run(self, save=no, build=yes, blot=no, single=no, clean=no, interp='linear', sinscl=1.0, debug=no)

source code 

Perform drizzle operation on input to create output. This method would rely on the buildPars() method for the output product to produce correct parameters based on the inputs. The output for buildPars() is a list of dictionaries, one for each input, that matches the primary parameters for an IRAF drizzle task.

This method would then loop over all the entries in the list and run 'drizzle' for each entry.