Package pydrizzle :: Module obsgeometry :: Class ObsGeometry
[hide private]
[frames] | no frames]

Class ObsGeometry

source code

Base class for Observation's geometric information.

This class must know how to recognize the different types of distortion coefficients tables and instantiate the correct class for it.

Instance Methods [hide private]
 
__init__(self, rootname, idcfile, idckey=None, chip=1, direction="forward", header=None, pa_key=None, new=None, date=None, rot=None, ref_pscale=1.0, binned=1, mt_wcs=None)
We need to setup the proper object for the GeometryModel based on the format of the provided idctab.
source code
 
apply(self, pixpos, delta=None, pscale=None, verbose=no, order=None)
This method applies the model to a pixel position to calculate the new position.
source code
 
applyVAFactor(self, vafactor, ra_targ, dec_targ)
Correct the distortion coefficients for the effects of velocity aberration, IF the VAFACTOR value is present.
source code
 
wtraxy(self, pixpos, wcs, verbose=False)
Converts input pixel position 'pixpos' into an X,Y position in WCS.
source code
 
invert(self, pixpos, error=None, maxiter=None)
This method is the reverse of "apply" - it finds a position which, when distorted, maps to "pixpos".
source code
 
undistortWCS(self, shape=None)
This method applies the distortion to a 1x1 box at the reference position and updates the WCS based on the results.
source code
 
XYtoSky(self, pos, verbose=no, linear=no)
This method applies the distortion model to a pixel position and calculates the sky position in RA/Dec.
source code
 
SkytoXY(self, skypos, verbose=no, hour=no)
This method applies the model to an RA/Dec and calculates the pixel position.
source code
 
calcNewCorners(self)
This method will compute a new shape based on the positions of the corners AFTER applying the geometry model.
source code
Method Details [hide private]

__init__(self, rootname, idcfile, idckey=None, chip=1, direction="forward", header=None, pa_key=None, new=None, date=None, rot=None, ref_pscale=1.0, binned=1, mt_wcs=None)
(Constructor)

source code 

We need to setup the proper object for the GeometryModel
 based on the format of the provided idctab.

We need to trap attempts to address values of 'chip' that
are not part of the observation; such as in sub-arrays.

apply(self, pixpos, delta=None, pscale=None, verbose=no, order=None)

source code 

This method applies the model to a pixel position
 to calculate the new position.
 Depending on the value of direction, this could mean
 going from distorted/raw to a corrected positions or
 the other way around.

 If a specific pixel scale is provided, this will be
 used to determine the final output position.

applyVAFactor(self, vafactor, ra_targ, dec_targ)

source code 

Correct the distortion coefficients for the effects of velocity aberration, IF the VAFACTOR value is present. This method relies on RA_TARG and DEC_TARG to provide the information on where the telescope was pointing, the point which serves as the center of the radial velocity aberration.

wtraxy(self, pixpos, wcs, verbose=False)

source code 

Converts input pixel position 'pixpos' into an X,Y position in WCS. Made this function compatible with list input, as well as single tuple input..apply

invert(self, pixpos, error=None, maxiter=None)

source code 

This method is the reverse of "apply" - it finds a position which, when distorted, maps to "pixpos". The method is iterative and is modelled on that in "tranback" in the dither package.

pixpos is an x,y pixel position tuple.

pixpos is assumed to be in the appropriate sub-array coordinates.

Richard Hook, ST-ECF/STScI, January 2003

undistortWCS(self, shape=None)

source code 

This method applies the distortion to a 1x1 box at the reference position and updates the WCS based on the results.

This method is based directly on the 'drizzle' subroutine 'UPWCS' written by R. Hook.

SkytoXY(self, skypos, verbose=no, hour=no)

source code 

 This method applies the model to an RA/Dec
  and calculates the pixel position.
  RA and Dec need to be in decimal form!

This needs to be expanded to include full distortion model
as well, i.e. inverse distortion solution.

calcNewCorners(self)

source code 

This method will compute a new shape based on the positions of
the corners AFTER applying the geometry model.

These new position for each corner should be calculated by calling
self.geometry.apply() on each corner position.
This should also take into account the output scale as well.

Values for the corners must go from 0, not 1, since it is a Python array.
    WJH, 17-Mar-2005