pydrizzle (version 5.2.6 (5-October-2004))
index
__init__.py

 
Package Contents
       
arrdriz
buildasn
buildmask
buildproduct
dqpars
drutil
exposure
fileutil
imtype
irafvars
obsgeometry
outputimage
traits102 (package)
updateasn
wcsutil

 
Classes
       
Pattern
ACSObservation
DitherProduct
GenericObservation
NICMOSObservation
STISObservation
WFPCObservation
PyDrizzle
SkyField
__builtin__.dict(__builtin__.object)
ParDict

 
class ACSObservation(Pattern)
    This class defines an observation with information specific
to ACS WFC exposures, including knowledge of how to mosaic both
chips.
 
  Methods defined here:
__init__(self, filename, output, pars=None)

Data and other attributes defined here:
DQCLASS = 'ACSPars'
PARITY = {'HRC': [[-1.0, 0.0], [0.0, 1.0]], 'SBC': [[-1.0, 0.0], [0.0, 1.0]], 'WFC': [[1.0, 0.0], [0.0, -1.0]]}

Methods inherited from Pattern:
DeltaXYtoOffset(self, delta)
Converts provided delta(x,y) pixel offset into a
delta(RA,Dec) offset in arcseconds.
addMembers(self, filename)
Build rootname for each SCI extension, and
create the mask image from the DQ extension.
It would then append a new Exposure object to 'members'
list for each extension.
applyAsnShifts(self)
Apply ASN Shifts to each member and the observations product.
buildMetachip(self, update=True)
Build up the new metashape based on the
corrected size and position for each Exposure.
(Pattern method)
buildPars(self, ref=None)
This method would build a list of parameters to run 'drizzle'
one a single input image.
   The reference image info 'ref' will be passed as a SkyField object.
   The default output reference frame will be passed as 'def_wcs'
   for comparison to the user's selected object 'ref'.
buildProduct(self, filename, output)
Create Exposure object for meta-chip product after applying
distortion model to input members.
closeHandle(self)
Closes image_handle.
computeCubicCoeffs(self)
Method for converting cubic and Trauger coefficients tables
into a usable form.  It also replaces 'computeOffsets' for
those tables as well.
computeOffsets(self, parity=None, refchip=None)
This version of 'computeOffsets' calculates the zero-point
shifts to be included in the distortion coefficients table
used by 'drizzle'.
It REQUIRES a parity matrix to convert from
V2/V3 coordinates into detector image X/Y coordinates. This
matrix will be specific to each detector.
getBits(self, bits=None)
Method for extracting the bits value set through DQPars.
getExptime(self)
getHeaderHandle(self)
Sets up the PyFITS image handle and Primary header
as self.image_handle and self.header.
 
When Pattern being used for output product, filename will be
set to None and this returns None for header and image_handle.
getProductCorners(self)
Compute the product's corner positions based on input exposure's
corner positions.
getWCS(self)
########
#
# User interface methods
#
########
setNames(self, filename, output)
Define standard name attibutes:
        outname     - Default final output name
        outdata     - Name for drizzle science output
        outsingle   - Name for output for single image
transformMetachip(self, ref)
This method transforms this Exposure's WCS to be consistent
with the provided reference WCS 'ref'.  This method only
operates on the product MetaChip, with the original WCS
being preserved as 'wcslin'.
 
Primarily, this transformation involves scaling and rotating
the chip to match the reference frame values. Also, any specified
size for the output frame would replace the default rotated/scaled
size. All rotations would be about the center, and the reference
pixel position gets shifted to accomodate this rotation.

Data and other attributes inherited from Pattern:
COPY_SUFFIX = '.orig'
DETECTOR_NAME = 'detector'
IDCKEY = 'IDCTAB'
NUM_IMSET = 3
PA_KEY = 'PA_V3'
REFDATA = {'detector': [[1.0, 1.0], [1.0, 1.0]]}

 
class DitherProduct(Pattern)
    Builds an object for a set of dithered inputs, each of which
will be one of the Observation objects.
 
  Methods defined here:
__init__(self, prodlist, pars=None)
addMembers(self, prodlist, pars, output)
For each entry in prodlist, append the appropriate type
of Observation to the members list.
applyAsnShifts(self, output)
Apply any shifts read in from the ASN table /shiftfile to
the WCS of each input's product.
 
In the case there are no shifts to apply, copy the product
WCS into WCSLIN as the default case.
 
This method should (eventually?) support updating the shifts
without starting from the beginning with these datasets, similar
to the 'resetPars' functionality.
buildMetachip(self)
This method combines the results of the member's buildMetachip()
methods into a composite WCS.
(DitherProduct method)
buildPars(self, ref=None)
buildProduct(self, output)
closeHandle(self)
Close image handle for each member.
computeOffsets(self)
This method will rely on final product's 'rd2xy' method
to compute offsets between the different input chips.
getExptime(self)
Add up the exposure time for all the members in
the pattern, since 'drizzle' doesn't have the necessary
information to correctly set this itself.

Methods inherited from Pattern:
DeltaXYtoOffset(self, delta)
Converts provided delta(x,y) pixel offset into a
delta(RA,Dec) offset in arcseconds.
computeCubicCoeffs(self)
Method for converting cubic and Trauger coefficients tables
into a usable form.  It also replaces 'computeOffsets' for
those tables as well.
getBits(self, bits=None)
Method for extracting the bits value set through DQPars.
getHeaderHandle(self)
Sets up the PyFITS image handle and Primary header
as self.image_handle and self.header.
 
When Pattern being used for output product, filename will be
set to None and this returns None for header and image_handle.
getProductCorners(self)
Compute the product's corner positions based on input exposure's
corner positions.
getWCS(self)
########
#
# User interface methods
#
########
setNames(self, filename, output)
Define standard name attibutes:
        outname     - Default final output name
        outdata     - Name for drizzle science output
        outsingle   - Name for output for single image
transformMetachip(self, ref)
This method transforms this Exposure's WCS to be consistent
with the provided reference WCS 'ref'.  This method only
operates on the product MetaChip, with the original WCS
being preserved as 'wcslin'.
 
Primarily, this transformation involves scaling and rotating
the chip to match the reference frame values. Also, any specified
size for the output frame would replace the default rotated/scaled
size. All rotations would be about the center, and the reference
pixel position gets shifted to accomodate this rotation.

Data and other attributes inherited from Pattern:
COPY_SUFFIX = '.orig'
DETECTOR_NAME = 'detector'
DQCLASS = 'DQPars'
IDCKEY = 'IDCTAB'
NUM_IMSET = 3
PARITY = {'detector': [[1.0, 0.0], [0.0, 1.0]]}
PA_KEY = 'PA_V3'
REFDATA = {'detector': [[1.0, 1.0], [1.0, 1.0]]}

 
class GenericObservation(Pattern)
    This class defines an observation stored in a Simple FITS format;
i.e., only a Primary header and image without extensions.
 
  Methods defined here:
__init__(self, filename, output, pars=None)

Data and other attributes defined here:
DETECTOR_NAME = 'INSTRUME'
DQCLASS = None
REFPIX = {'x': 512.0, 'y': 512.0}

Methods inherited from Pattern:
DeltaXYtoOffset(self, delta)
Converts provided delta(x,y) pixel offset into a
delta(RA,Dec) offset in arcseconds.
addMembers(self, filename)
Build rootname for each SCI extension, and
create the mask image from the DQ extension.
It would then append a new Exposure object to 'members'
list for each extension.
applyAsnShifts(self)
Apply ASN Shifts to each member and the observations product.
buildMetachip(self, update=True)
Build up the new metashape based on the
corrected size and position for each Exposure.
(Pattern method)
buildPars(self, ref=None)
This method would build a list of parameters to run 'drizzle'
one a single input image.
   The reference image info 'ref' will be passed as a SkyField object.
   The default output reference frame will be passed as 'def_wcs'
   for comparison to the user's selected object 'ref'.
buildProduct(self, filename, output)
Create Exposure object for meta-chip product after applying
distortion model to input members.
closeHandle(self)
Closes image_handle.
computeCubicCoeffs(self)
Method for converting cubic and Trauger coefficients tables
into a usable form.  It also replaces 'computeOffsets' for
those tables as well.
computeOffsets(self, parity=None, refchip=None)
This version of 'computeOffsets' calculates the zero-point
shifts to be included in the distortion coefficients table
used by 'drizzle'.
It REQUIRES a parity matrix to convert from
V2/V3 coordinates into detector image X/Y coordinates. This
matrix will be specific to each detector.
getBits(self, bits=None)
Method for extracting the bits value set through DQPars.
getExptime(self)
getHeaderHandle(self)
Sets up the PyFITS image handle and Primary header
as self.image_handle and self.header.
 
When Pattern being used for output product, filename will be
set to None and this returns None for header and image_handle.
getProductCorners(self)
Compute the product's corner positions based on input exposure's
corner positions.
getWCS(self)
########
#
# User interface methods
#
########
setNames(self, filename, output)
Define standard name attibutes:
        outname     - Default final output name
        outdata     - Name for drizzle science output
        outsingle   - Name for output for single image
transformMetachip(self, ref)
This method transforms this Exposure's WCS to be consistent
with the provided reference WCS 'ref'.  This method only
operates on the product MetaChip, with the original WCS
being preserved as 'wcslin'.
 
Primarily, this transformation involves scaling and rotating
the chip to match the reference frame values. Also, any specified
size for the output frame would replace the default rotated/scaled
size. All rotations would be about the center, and the reference
pixel position gets shifted to accomodate this rotation.

Data and other attributes inherited from Pattern:
COPY_SUFFIX = '.orig'
IDCKEY = 'IDCTAB'
NUM_IMSET = 3
PARITY = {'detector': [[1.0, 0.0], [0.0, 1.0]]}
PA_KEY = 'PA_V3'
REFDATA = {'detector': [[1.0, 1.0], [1.0, 1.0]]}

 
class NICMOSObservation(Pattern)
    This class defines an observation with information specific
to NICMOS exposures.
 
  Methods defined here:
__init__(self, filename, output, pars=None)

Data and other attributes defined here:
DETECTOR_NAME = 'camera'
DQCLASS = 'NICMOSPars'
IDCKEY = 'cubic'
NUM_IMSET = 5
PARITY = {'1': array([[-1., 0.], [ 0., 1.]]), '2': array([[-1., 0.], [ 0., 1.]]), '3': array([[-1., 0.], [ 0., 1.]])}
REFDATA = {'1': {'psize': 0.043200000000000002, 'theta': 0.0, 'v2': -296.9228, 'v3': 290.18270000000001, 'xoff': 0.0, 'yoff': 0.0}, '2': {'psize': 0.075999999999999998, 'theta': 0.0, 'v2': -319.94639999999998, 'v3': 311.85789999999997, 'xoff': 0.0, 'yoff': 0.0}, '3': {'psize': 0.020375799999999999, 'theta': 0.0, 'v2': -249.81700000000001, 'v3': 235.2371, 'xoff': 0.0, 'yoff': 0.0}}
REFPIX = {'x': 128.0, 'y': 128.0}

Methods inherited from Pattern:
DeltaXYtoOffset(self, delta)
Converts provided delta(x,y) pixel offset into a
delta(RA,Dec) offset in arcseconds.
addMembers(self, filename)
Build rootname for each SCI extension, and
create the mask image from the DQ extension.
It would then append a new Exposure object to 'members'
list for each extension.
applyAsnShifts(self)
Apply ASN Shifts to each member and the observations product.
buildMetachip(self, update=True)
Build up the new metashape based on the
corrected size and position for each Exposure.
(Pattern method)
buildPars(self, ref=None)
This method would build a list of parameters to run 'drizzle'
one a single input image.
   The reference image info 'ref' will be passed as a SkyField object.
   The default output reference frame will be passed as 'def_wcs'
   for comparison to the user's selected object 'ref'.
buildProduct(self, filename, output)
Create Exposure object for meta-chip product after applying
distortion model to input members.
closeHandle(self)
Closes image_handle.
computeCubicCoeffs(self)
Method for converting cubic and Trauger coefficients tables
into a usable form.  It also replaces 'computeOffsets' for
those tables as well.
computeOffsets(self, parity=None, refchip=None)
This version of 'computeOffsets' calculates the zero-point
shifts to be included in the distortion coefficients table
used by 'drizzle'.
It REQUIRES a parity matrix to convert from
V2/V3 coordinates into detector image X/Y coordinates. This
matrix will be specific to each detector.
getBits(self, bits=None)
Method for extracting the bits value set through DQPars.
getExptime(self)
getHeaderHandle(self)
Sets up the PyFITS image handle and Primary header
as self.image_handle and self.header.
 
When Pattern being used for output product, filename will be
set to None and this returns None for header and image_handle.
getProductCorners(self)
Compute the product's corner positions based on input exposure's
corner positions.
getWCS(self)
########
#
# User interface methods
#
########
setNames(self, filename, output)
Define standard name attibutes:
        outname     - Default final output name
        outdata     - Name for drizzle science output
        outsingle   - Name for output for single image
transformMetachip(self, ref)
This method transforms this Exposure's WCS to be consistent
with the provided reference WCS 'ref'.  This method only
operates on the product MetaChip, with the original WCS
being preserved as 'wcslin'.
 
Primarily, this transformation involves scaling and rotating
the chip to match the reference frame values. Also, any specified
size for the output frame would replace the default rotated/scaled
size. All rotations would be about the center, and the reference
pixel position gets shifted to accomodate this rotation.

Data and other attributes inherited from Pattern:
COPY_SUFFIX = '.orig'
PA_KEY = 'PA_V3'

 
class ParDict(__builtin__.dict)
    
Method resolution order:
ParDict
__builtin__.dict
__builtin__.object

Methods defined here:
__init__(self)
__str__(self)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'ParDict' objects>
list of weak references to the object (if defined)

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
x.__contains__(y) <==> y in x
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
has_key(...)
D.has_key(k) -> True if D has a key k, else False
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(...)
D.update(E) -> None.  Update D from E: for k in E.keys(): D[k] = E[k]
values(...)
D.values() -> list of D's values

Data and other attributes inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
fromkeys = <built-in method fromkeys of type object>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
class Pattern
    Set default values for these to be overridden by
instrument specific class variables as necessary.
 
  Methods defined here:
DeltaXYtoOffset(self, delta)
Converts provided delta(x,y) pixel offset into a
delta(RA,Dec) offset in arcseconds.
__init__(self, filename, output=None, pars=None)
addMembers(self, filename)
Build rootname for each SCI extension, and
create the mask image from the DQ extension.
It would then append a new Exposure object to 'members'
list for each extension.
applyAsnShifts(self)
Apply ASN Shifts to each member and the observations product.
buildMetachip(self, update=True)
Build up the new metashape based on the
corrected size and position for each Exposure.
(Pattern method)
buildPars(self, ref=None)
This method would build a list of parameters to run 'drizzle'
one a single input image.
   The reference image info 'ref' will be passed as a SkyField object.
   The default output reference frame will be passed as 'def_wcs'
   for comparison to the user's selected object 'ref'.
buildProduct(self, filename, output)
Create Exposure object for meta-chip product after applying
distortion model to input members.
closeHandle(self)
Closes image_handle.
computeCubicCoeffs(self)
Method for converting cubic and Trauger coefficients tables
into a usable form.  It also replaces 'computeOffsets' for
those tables as well.
computeOffsets(self, parity=None, refchip=None)
This version of 'computeOffsets' calculates the zero-point
shifts to be included in the distortion coefficients table
used by 'drizzle'.
It REQUIRES a parity matrix to convert from
V2/V3 coordinates into detector image X/Y coordinates. This
matrix will be specific to each detector.
getBits(self, bits=None)
Method for extracting the bits value set through DQPars.
getExptime(self)
getHeaderHandle(self)
Sets up the PyFITS image handle and Primary header
as self.image_handle and self.header.
 
When Pattern being used for output product, filename will be
set to None and this returns None for header and image_handle.
getProductCorners(self)
Compute the product's corner positions based on input exposure's
corner positions.
getWCS(self)
########
#
# User interface methods
#
########
setNames(self, filename, output)
Define standard name attibutes:
        outname     - Default final output name
        outdata     - Name for drizzle science output
        outsingle   - Name for output for single image
transformMetachip(self, ref)
This method transforms this Exposure's WCS to be consistent
with the provided reference WCS 'ref'.  This method only
operates on the product MetaChip, with the original WCS
being preserved as 'wcslin'.
 
Primarily, this transformation involves scaling and rotating
the chip to match the reference frame values. Also, any specified
size for the output frame would replace the default rotated/scaled
size. All rotations would be about the center, and the reference
pixel position gets shifted to accomodate this rotation.

Data and other attributes defined here:
COPY_SUFFIX = '.orig'
DETECTOR_NAME = 'detector'
DQCLASS = 'DQPars'
IDCKEY = 'IDCTAB'
NUM_IMSET = 3
PARITY = {'detector': [[1.0, 0.0], [0.0, 1.0]]}
PA_KEY = 'PA_V3'
REFDATA = {'detector': [[1.0, 1.0], [1.0, 1.0]]}

 
class PyDrizzle
    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: FITS extension or group
                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)
 
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 = pydrizzle.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()
 
  Methods defined here:
__init__(self, input, output=None, field=None, units=None, section=None, kernel=None, pixfrac=None, bits=None, wt_scl='exptime', fillval=0.0, idckey=None, idcdir='/data/chulak1/dev/stsdas/pkg/analysis/dither/drizzle/coeffs/', memmap=1, dqsuffix=None, prodonly=True)
clean(self, coeffs=False, final=False)
Removes intermediate products from disk.
help(self)
Run the module level help function to provide syntax information.
printPars(self, pars='xsh,ysh,rot,scale,outnx,outny,data', format=False)
Prints common parameters for review.
resetPars(self, field=None, pixfrac=None, kernel=None, units=None)
Recompute the output parameters based on a new
    SkyField or WCSObject object.
run(self, save=False, build=True, blot=False, single=False, clean=False, interp='linear', sinscl=1.0)
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.

 
class STISObservation(Pattern)
    This class defines an observation with information specific
to STIS exposures.
 
  Methods defined here:
__init__(self, filename, output, pars=None)
getExptime(self)

Data and other attributes defined here:
DQCLASS = 'STISPars'
IDCKEY = 'cubic'
PARITY = {'CCD': array([[-1., 0.], [ 0., 1.]]), 'FUV-MAMA': array([[-1., 0.], [ 0., 1.]]), 'NUV-MAMA': array([[-1., 0.], [ 0., 1.]])}
REFDATA = {'CCD': {'psize': 0.050000000000000003, 'theta': 0.0, 'v2': -213.999, 'v3': -224.89699999999999, 'xoff': 0.0, 'yoff': 0.0}, 'FUV-MAMA': {'psize': 0.024, 'theta': 0.0, 'v2': -213.999, 'v3': -224.89699999999999, 'xoff': 0.0, 'yoff': 0.0}, 'NUV-MAMA': {'psize': 0.024, 'theta': 0.0, 'v2': -213.999, 'v3': -224.89699999999999, 'xoff': 0.0, 'yoff': 0.0}}
REFPIX = {'x': 512.0, 'y': 512.0}

Methods inherited from Pattern:
DeltaXYtoOffset(self, delta)
Converts provided delta(x,y) pixel offset into a
delta(RA,Dec) offset in arcseconds.
addMembers(self, filename)
Build rootname for each SCI extension, and
create the mask image from the DQ extension.
It would then append a new Exposure object to 'members'
list for each extension.
applyAsnShifts(self)
Apply ASN Shifts to each member and the observations product.
buildMetachip(self, update=True)
Build up the new metashape based on the
corrected size and position for each Exposure.
(Pattern method)
buildPars(self, ref=None)
This method would build a list of parameters to run 'drizzle'
one a single input image.
   The reference image info 'ref' will be passed as a SkyField object.
   The default output reference frame will be passed as 'def_wcs'
   for comparison to the user's selected object 'ref'.
buildProduct(self, filename, output)
Create Exposure object for meta-chip product after applying
distortion model to input members.
closeHandle(self)
Closes image_handle.
computeCubicCoeffs(self)
Method for converting cubic and Trauger coefficients tables
into a usable form.  It also replaces 'computeOffsets' for
those tables as well.
computeOffsets(self, parity=None, refchip=None)
This version of 'computeOffsets' calculates the zero-point
shifts to be included in the distortion coefficients table
used by 'drizzle'.
It REQUIRES a parity matrix to convert from
V2/V3 coordinates into detector image X/Y coordinates. This
matrix will be specific to each detector.
getBits(self, bits=None)
Method for extracting the bits value set through DQPars.
getHeaderHandle(self)
Sets up the PyFITS image handle and Primary header
as self.image_handle and self.header.
 
When Pattern being used for output product, filename will be
set to None and this returns None for header and image_handle.
getProductCorners(self)
Compute the product's corner positions based on input exposure's
corner positions.
getWCS(self)
########
#
# User interface methods
#
########
setNames(self, filename, output)
Define standard name attibutes:
        outname     - Default final output name
        outdata     - Name for drizzle science output
        outsingle   - Name for output for single image
transformMetachip(self, ref)
This method transforms this Exposure's WCS to be consistent
with the provided reference WCS 'ref'.  This method only
operates on the product MetaChip, with the original WCS
being preserved as 'wcslin'.
 
Primarily, this transformation involves scaling and rotating
the chip to match the reference frame values. Also, any specified
size for the output frame would replace the default rotated/scaled
size. All rotations would be about the center, and the reference
pixel position gets shifted to accomodate this rotation.

Data and other attributes inherited from Pattern:
COPY_SUFFIX = '.orig'
DETECTOR_NAME = 'detector'
NUM_IMSET = 3
PA_KEY = 'PA_V3'

 
class SkyField
    An class for specifying the parameters and building a WCS object
    for a user-specified drizzle product.
The user may optionally modify the values for:
    psize       - size of image's pixels in arc-seconds
    orient      - value of ORIENTAT for the field
    shape       - tuple containing the sizes of the field's x/y axes
    ra,dec      - position of the center of the field
                  decimal (124.5678) or
                  sexagesimal string _in quotes_ ('hh:mm:ss.ss')
    crpix       - tuple for pixel position of reference point in
                    output image
Usage:
    To specify a new field with a fixed output size of 1024x1024:
    --> field = pydrizzle.SkyField(shape=(1024,1024))
 
    The 'set()' method modifies one of the parameters listed above
    without affecting the remainder of the parameters.
    --> field.set(psize=0.1,orient=0.0)
    --> field.set(ra=123.45678,dec=0.1000,crpix=(521,576))
 
    View the WCS or user-specified values for this object:
    --> print field
 
  Methods defined here:
__init__(self, shape=None, psize=None, wcs=None)
__str__(self)
Prints the WCS information set for this object.
help(self)
Creates and prints usage information for this class.
mergeWCS(self, wcs, overwrite=True)
Sets up the WCS for this object based on another WCS.
This method will NOT update object attributes other
than WCS, as all other attributes reflect user-settings.
set(self, psize=None, orient=None, ra=None, dec=None, shape=None, crpix=None)
Modifies the attributes of the SkyField and
    updates it's WCS when appropriate.

 
class WFPCObservation(Pattern)
    This class defines an observation with information specific
to WFPC2 exposures, including knowledge of how to mosaic the
chips.
 
  Methods defined here:
__init__(self, filename, output, pars=None)
addMembers(self, filename)
setOrient(self)
Determine desired orientation of product.

Data and other attributes defined here:
DQCLASS = 'WFPC2Pars'
IDCKEY = 'cubic'
NUM_IMSET = 1
PARITY = {'1': array([[-1., 0.], [ 0., 1.]]), '2': array([[-1., 0.], [ 0., 1.]]), '3': array([[-1., 0.], [ 0., 1.]]), '4': array([[-1., 0.], [ 0., 1.]]), 'WFPC': array([[-1., 0.], [ 0., 1.]])}
REFDATA = {'1': {'psize': 0.045539999999999997, 'theta': 224.84800000000001, 'v2': 2.3740000000000001, 'v3': -30.268000000000001, 'xoff': 354.35599999999999, 'yoff': 343.64600000000002}, '2': {'psize': 0.099599999999999994, 'theta': 314.35199999999998, 'v2': -51.368000000000002, 'v3': -5.6980000000000004, 'xoff': 345.74810000000002, 'yoff': 375.28818000000001}, '3': {'psize': 0.099599999999999994, 'theta': 44.670000000000002, 'v2': 0.064000000000000001, 'v3': 48.692, 'xoff': 366.56876, 'yoff': 354.79435000000001}, '4': {'psize': 0.099599999999999994, 'theta': 135.221, 'v2': 55.043999999999997, 'v3': -6.0979999999999999, 'xoff': 355.85016000000002, 'yoff': 351.29183}}
REFPIX = {'x': 400.0, 'y': 400.0}

Methods inherited from Pattern:
DeltaXYtoOffset(self, delta)
Converts provided delta(x,y) pixel offset into a
delta(RA,Dec) offset in arcseconds.
applyAsnShifts(self)
Apply ASN Shifts to each member and the observations product.
buildMetachip(self, update=True)
Build up the new metashape based on the
corrected size and position for each Exposure.
(Pattern method)
buildPars(self, ref=None)
This method would build a list of parameters to run 'drizzle'
one a single input image.
   The reference image info 'ref' will be passed as a SkyField object.
   The default output reference frame will be passed as 'def_wcs'
   for comparison to the user's selected object 'ref'.
buildProduct(self, filename, output)
Create Exposure object for meta-chip product after applying
distortion model to input members.
closeHandle(self)
Closes image_handle.
computeCubicCoeffs(self)
Method for converting cubic and Trauger coefficients tables
into a usable form.  It also replaces 'computeOffsets' for
those tables as well.
computeOffsets(self, parity=None, refchip=None)
This version of 'computeOffsets' calculates the zero-point
shifts to be included in the distortion coefficients table
used by 'drizzle'.
It REQUIRES a parity matrix to convert from
V2/V3 coordinates into detector image X/Y coordinates. This
matrix will be specific to each detector.
getBits(self, bits=None)
Method for extracting the bits value set through DQPars.
getExptime(self)
getHeaderHandle(self)
Sets up the PyFITS image handle and Primary header
as self.image_handle and self.header.
 
When Pattern being used for output product, filename will be
set to None and this returns None for header and image_handle.
getProductCorners(self)
Compute the product's corner positions based on input exposure's
corner positions.
getWCS(self)
########
#
# User interface methods
#
########
setNames(self, filename, output)
Define standard name attibutes:
        outname     - Default final output name
        outdata     - Name for drizzle science output
        outsingle   - Name for output for single image
transformMetachip(self, ref)
This method transforms this Exposure's WCS to be consistent
with the provided reference WCS 'ref'.  This method only
operates on the product MetaChip, with the original WCS
being preserved as 'wcslin'.
 
Primarily, this transformation involves scaling and rotating
the chip to match the reference frame values. Also, any specified
size for the output frame would replace the default rotated/scaled
size. All rotations would be about the center, and the reference
pixel position gets shifted to accomodate this rotation.

Data and other attributes inherited from Pattern:
COPY_SUFFIX = '.orig'
DETECTOR_NAME = 'detector'
PA_KEY = 'PA_V3'

 
Functions
       
acos(...)
acos(x)
 
Return the arc cosine (measured in radians) of x.
asin(...)
asin(x)
 
Return the arc sine (measured in radians) of x.
atan(...)
atan(x)
 
Return the arc tangent (measured in radians) of x.
atan2(...)
atan2(y, x)
 
Return the arc tangent (measured in radians) of y/x.
Unlike atan(y/x), the signs of both x and y are considered.
ceil(...)
ceil(x)
 
Return the ceiling of x as a float.
This is the smallest integral value >= x.
cos(...)
cos(x)
 
Return the cosine of x (measured in radians).
cosh(...)
cosh(x)
 
Return the hyperbolic cosine of x.
degrees(...)
degrees(x) -> converts angle x from radians to degrees
exp(...)
exp(x)
 
Return e raised to the power of x.
fabs(...)
fabs(x)
 
Return the absolute value of the float x.
floor(...)
floor(x)
 
Return the floor of x as a float.
This is the largest integral value <= x.
fmod(...)
fmod(x,y)
 
Return fmod(x, y), according to platform C.  x % y may differ.
frexp(...)
frexp(x)
 
Return the mantissa and exponent of x, as pair (m, e).
m is a float and e is an int, such that x = m * 2.**e.
If x is 0, m and e are both 0.  Else 0.5 <= abs(m) < 1.0.
help()
# End of 'runDrizzle'
hypot(...)
hypot(x,y)
 
Return the Euclidean distance, sqrt(x*x + y*y).
ldexp(...)
ldexp(x, i) -> x * (2**i)
log(...)
log(x[, base]) -> the logarithm of x to the given base.
If the base not specified, returns the natural logarithm (base e) of x.
log10(...)
log10(x) -> the base 10 logarithm of x.
modf(...)
modf(x)
 
Return the fractional and integer parts of x.  Both results carry the sign
of x.  The integer part is returned as a real.
pow(...)
pow(x,y)
 
Return x**y (x to the power of y).
radians(...)
radians(x) -> converts angle x from degrees to radians
selectInstrument(filename, output, pars={'idckey': None, 'psize': None, 'rot': None})
Method which encapsulates the logic for determining
which class to instantiate for each file.
sin(...)
sin(x)
 
Return the sine of x (measured in radians).
sinh(...)
sinh(x)
 
Return the hyperbolic sine of x.
sqrt(...)
sqrt(x)
 
Return the square root of x.
tan(...)
tan(x)
 
Return the tangent of x (measured in radians).
tanh(...)
tanh(x)
 
Return the hyperbolic tangent of x.

 
Data
        DEFAULT_IDCDIR = '/data/chulak1/dev/stsdas/pkg/analysis/dither/drizzle/coeffs/'
DEFAULT_PARITY = [[1.0, 0.0], [0.0, 1.0]]
DEXPTIME = 'EXPTIME'
DQPARS = 'dqpars'
INSTRUMENT = ['ACS', 'WFPC2', 'STIS', 'NICMOS']
__version__ = '5.2.6 (5-October-2004)'
e = 2.7182818284590451
no = False
pi = 3.1415926535897931
yes = True