summaryrefslogtreecommitdiff
path: root/updatewcs/npol.py
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2011-03-07 13:44:45 -0500
committerdencheva <dencheva@stsci.edu>2011-03-07 13:44:45 -0500
commit51b7d025b8f7d12f7572a420d7cf31f5482f934d (patch)
treeb74b960142bff492a366247736ada968f464fe54 /updatewcs/npol.py
parentfbe64103caea375103982c2fb1c7184245bbd08f (diff)
downloadstwcs_hcf-51b7d025b8f7d12f7572a420d7cf31f5482f934d.tar.gz
No code changes, only name changes - all occurences of 'dgeo' changed to 'npol'
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@12119 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'updatewcs/npol.py')
-rw-r--r--updatewcs/npol.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/updatewcs/npol.py b/updatewcs/npol.py
index 44d495e..fb2c128 100644
--- a/updatewcs/npol.py
+++ b/updatewcs/npol.py
@@ -5,7 +5,7 @@ from pytools import fileutil
import utils
import numpy as np
-class DGEOCorr(object):
+class NPOLCorr(object):
"""
Defines a Lookup table prior distortion correction as per WCS paper IV.
It uses a reference file defined by the NPOLFILE (suffix 'NPL') keyword
@@ -52,7 +52,7 @@ class DGEOCorr(object):
For each science extension in a pyfits file object:
- create a WCSDVARR extension
- update science header
- - add/update DGEOEXT keyword
+ - add/update NPOLEXT keyword
"""
nplfile = fileutil.osfn(fobj[0].header['NPOLFILE'])
# Map WCSDVARR EXTVER numbers to extension numbers
@@ -132,7 +132,7 @@ class DGEOCorr(object):
values = {cperror: 0.0, cpdis: 'Lookup', dpext: wdvarr_ver, dpnaxes: 2,
dpaxis1: 1, dpaxis2: 2}
- comments = {cperror: 'Maximum error of dgeo correction for axis %s' % j,
+ comments = {cperror: 'Maximum error of NPOL correction for axis %s' % j,
cpdis: 'Prior distortion funcion type',
dpext: 'Version number of WCSDVARR extension containing lookup distortion table',
dpnaxes: 'Number of independent variables in distortion function',
@@ -147,8 +147,8 @@ class DGEOCorr(object):
def getData(cls,nplfile, ccdchip):
"""
- Get the data arrays from the reference DGEO files
- Make sure 'CCDCHIP' in the dgeo file matches "CCDCHIP' in the science file.
+ Get the data arrays from the reference NPOL files
+ Make sure 'CCDCHIP' in the npolfile matches "CCDCHIP' in the science file.
"""
npl = pyfits.open(nplfile)
for ext in npl:
@@ -168,7 +168,7 @@ class DGEOCorr(object):
def transformData(cls, dx, dy, coeffs):
"""
- Transform the DGEO data arrays for use with SIP
+ Transform the NPOL data arrays for use with SIP
"""
ndx, ndy = np.dot(coeffs, [dx.ravel(), dy.ravel()])
ndx.shape = dx.shape
@@ -212,10 +212,10 @@ class DGEOCorr(object):
def createNpolHdr(cls, sciheader, npolfile, wdvarr_ver, npl_extname, ccdchip, binned):
"""
- Creates a header for the WCSDVARR extension based on the DGEO reference file
+ Creates a header for the WCSDVARR extension based on the NPOL reference file
and sci extension header. The goal is to always work in image coordinates
(also for subarrays and binned images. The WCS for the WCSDVARR extension
- i ssuch that a full size dgeo table is created and then shifted or scaled
+ i ssuch that a full size npol table is created and then shifted or scaled
if the science image is a subarray or binned image.
"""
npl = pyfits.open(npolfile)
@@ -236,7 +236,7 @@ class DGEOCorr(object):
npl.close()
naxis = pyfits.getval(npolfile, ext=1, key='NAXIS')
- ccdchip = nplextname #dgeo_header['CCDCHIP']
+ ccdchip = nplextname #npol_header['CCDCHIP']
kw = { 'NAXIS': 'Size of the axis',
'CDELT': 'Coordinate increment along axis',
@@ -292,7 +292,7 @@ class DGEOCorr(object):
def get_ccdchip(cls, fobj, extname, extver):
"""
- Given a science file or dgeo file determine CCDCHIP
+ Given a science file or npol file determine CCDCHIP
"""
ccdchip = 1
if fobj[0].header['INSTRUME'] == 'ACS' and fobj[0].header['DETECTOR'] == 'WFC':