summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--updatewcs/__init__.py14
-rw-r--r--updatewcs/apply_corrections.py58
-rw-r--r--updatewcs/corrections.py4
-rw-r--r--updatewcs/dgeo.py311
-rw-r--r--updatewcs/npol.py20
5 files changed, 48 insertions, 359 deletions
diff --git a/updatewcs/__init__.py b/updatewcs/__init__.py
index 9c899db..c43b016 100644
--- a/updatewcs/__init__.py
+++ b/updatewcs/__init__.py
@@ -9,7 +9,7 @@ from stwcs import __version__ as stwcsversion
import pywcs
import utils, corrections, makewcs
-import dgeo, det2im
+import npol, det2im
from pytools import parseinput, fileutil
import apply_corrections
@@ -17,7 +17,7 @@ import apply_corrections
__docformat__ = 'restructuredtext'
-def updatewcs(input, vacorr=True, tddcorr=True, dgeocorr=True, d2imcorr=True,
+def updatewcs(input, vacorr=True, tddcorr=True, npolcorr=True, d2imcorr=True,
checkfiles=True, wcskey=" ", wcsname=" ", clobber=False):
"""
@@ -48,7 +48,7 @@ def updatewcs(input, vacorr=True, tddcorr=True, dgeocorr=True, d2imcorr=True,
If True, vecocity aberration correction will be applied
tddcorr: boolean
If True, time dependent distortion correction will be applied
- dgeocorr: boolean
+ npolcorr: boolean
If True, a Lookup table distortion will be applied
d2imcorr: boolean
If True, detector to image correction will be applied
@@ -75,7 +75,7 @@ def updatewcs(input, vacorr=True, tddcorr=True, dgeocorr=True, d2imcorr=True,
return
for f in files:
acorr = apply_corrections.setCorrections(f, vacorr=vacorr, \
- tddcorr=tddcorr,dgeocorr=dgeocorr, d2imcorr=d2imcorr)
+ tddcorr=tddcorr,npolcorr=npolcorr, d2imcorr=d2imcorr)
if 'MakeWCS' in acorr and newIDCTAB(f):
print "New IDCTAB file detected. This invalidates all WCS's."
@@ -141,7 +141,7 @@ def makecorr(fname, allowed_corr, wkey=" ", wname=" ", clobber=False):
wcsutil.archiveWCS(f, ext=i, wcskey="O", wcsname="OPUS", clobber=True)
ext_wcs.readModel(update=True,header=hdr)
for c in allowed_corr:
- if c != 'DGEOCorr' and c != 'DET2IMCorr':
+ if c != 'NPOLCorr' and c != 'DET2IMCorr':
corr_klass = corrections.__getattribute__(c)
kw2update = corr_klass.updateWCS(ext_wcs, ref_wcs)
for kw in kw2update:
@@ -158,8 +158,8 @@ def makecorr(fname, allowed_corr, wkey=" ", wname=" ", clobber=False):
else:
continue
- if 'DGEOCorr' in allowed_corr:
- kw2update = dgeo.DGEOCorr.updateWCS(f)
+ if 'NPOLCorr' in allowed_corr:
+ kw2update = npol.NPOLCorr.updateWCS(f)
for kw in kw2update:
f[1].header.update(kw, kw2update[kw])
# Finally record the version of the software which updated the WCS
diff --git a/updatewcs/apply_corrections.py b/updatewcs/apply_corrections.py
index b00b7ef..a7149d9 100644
--- a/updatewcs/apply_corrections.py
+++ b/updatewcs/apply_corrections.py
@@ -15,7 +15,7 @@ __docformat__ = 'restructuredtext'
# These are the default corrections applied also in the pipeline.
allowed_corrections={'WFPC2': ['DET2IMCorr', 'MakeWCS','CompSIP', 'VACorr'],
- 'ACS': ['DET2IMCorr', 'TDDCorr', 'MakeWCS', 'CompSIP','VACorr', 'DGEOCorr'],
+ 'ACS': ['DET2IMCorr', 'TDDCorr', 'MakeWCS', 'CompSIP','VACorr', 'NPOLCorr'],
'STIS': ['MakeWCS', 'CompSIP','VACorr'],
'NICMOS': ['MakeWCS', 'CompSIP','VACorr'],
'WFC3': ['MakeWCS', 'CompSIP','VACorr'],
@@ -26,10 +26,10 @@ cnames = {'DET2IMCorr': 'Detector to Image Correction',
'MakeWCS': 'Recalculate basic WCS keywords based on the distortion model',
'CompSIP': 'Given IDCTAB distortion model calculate the SIP coefficients',
'VACorr': 'Velocity Aberration Correction',
- 'DGEOCorr': 'Lookup Table Distortion'
+ 'NPOLCorr': 'Lookup Table Distortion'
}
-def setCorrections(fname, vacorr=True, tddcorr=True, dgeocorr=True, d2imcorr=True):
+def setCorrections(fname, vacorr=True, tddcorr=True, npolcorr=True, d2imcorr=True):
"""
Creates a list of corrections to be applied to a file
based on user input paramters and allowed corrections
@@ -52,9 +52,9 @@ def setCorrections(fname, vacorr=True, tddcorr=True, dgeocorr=True, d2imcorr=Tru
tddcorr = applyTDDCorr(fname, tddcorr)
if tddcorr == False: acorr.remove('TDDCorr')
- if 'DGEOCorr' in acorr:
- dgeocorr = applyDgeoCorr(fname, dgeocorr)
- if dgeocorr == False: acorr.remove('DGEOCorr')
+ if 'NPOLCorr' in acorr:
+ npolcorr = applyNpolCorr(fname, npolcorr)
+ if npolcorr == False: acorr.remove('NPOLCorr')
if 'DET2IMCorr' in acorr:
d2imcorr = applyD2ImCorr(fname, d2imcorr)
if d2imcorr == False: acorr.remove('DET2IMCorr')
@@ -107,7 +107,7 @@ def applyTDDCorr(fname, utddcorr):
return tddcorr
-def applyDgeoCorr(fname, udgeocorr):
+def applyNpolCorr(fname, unpolcorr):
"""
Determines whether non-polynomial distortion lookup tables should be added
as extensions to the science file based on the 'NPOLFILE' keyword in the
@@ -116,47 +116,47 @@ def applyDgeoCorr(fname, udgeocorr):
The file used to generate the extensions is
recorded in the NPOLEXT keyword in the first science extension.
If 'NPOLFILE' in the primary header is different from 'NPOLEXT' in the
- extension header and the file exists on disk and is a 'new type' dgeofile,
+ extension header and the file exists on disk and is a 'new type' npolfile,
then the lookup tables will be updated as 'WCSDVARR' extensions.
"""
- applyDGEOCorr = True
+ applyNPOLCorr = True
try:
# get NPOLFILE kw from primary header
- fdgeo0 = pyfits.getval(fname, 'NPOLFILE')
- if fdgeo0 == 'N/A':
+ fnpol0 = pyfits.getval(fname, 'NPOLFILE')
+ if fnpol0 == 'N/A':
return False
- fdgeo0 = fileutil.osfn(fdgeo0)
- if not fileutil.findFile(fdgeo0):
- print 'Kw "NPOLFILE" exists in primary header but file %s not found\n' % fdgeo0
+ fnpol0 = fileutil.osfn(fnpol0)
+ if not fileutil.findFile(fnpol0):
+ print 'Kw "NPOLFILE" exists in primary header but file %s not found\n' % fnpol0
print 'Non-polynomial distortion correction will not be applied\n'
- applyDGEOCorr = False
- return applyDGEOCorr
+ applyNPOLCorr = False
+ return applyNPOLCorr
try:
# get NPOLEXT kw from first extension header
- fdgeo1 = pyfits.getval(fname, 'NPOLEXT', ext=1)
- fdgeo1 = fileutil.osfn(fdgeo1)
- if fdgeo1 and fileutil.findFile(fdgeo1):
- if fdgeo0 != fdgeo1:
- applyDGEOCorr = True
+ fnpol1 = pyfits.getval(fname, 'NPOLEXT', ext=1)
+ fnpol1 = fileutil.osfn(fnpol1)
+ if fnpol1 and fileutil.findFile(fnpol1):
+ if fnpol0 != fnpol1:
+ applyNPOLCorr = True
else:
- applyDGEOCorr = False
+ applyNPOLCorr = False
else:
# npl file defined in first extension may not be found
# but if a valid kw exists in the primary header, non-polynomial
#distortion correction should be applied.
- applyDGEOCorr = True
+ applyNPOLCorr = True
except KeyError:
# the case of "NPOLFILE" kw present in primary header but "NPOLEXT" missing
# in first extension header
- applyDGEOCorr = True
+ applyNPOLCorr = True
except KeyError:
print '"NPOLFILE" keyword not found in primary header'
- applyDGEOCorr = False
- return applyDGEOCorr
+ applyNPOLCorr = False
+ return applyNPOLCorr
- if isOldStyleDGEO(fname, fdgeo0):
- applyDGEOCorr = False
- return (applyDGEOCorr and udgeocorr)
+ if isOldStyleDGEO(fname, fnpol0):
+ applyNPOLCorr = False
+ return (applyNPOLCorr and unpolcorr)
def isOldStyleDGEO(fname, dgname):
# checks if the file defined in a NPOLFILE kw is a full size
diff --git a/updatewcs/corrections.py b/updatewcs/corrections.py
index 2e06656..6f2aa0b 100644
--- a/updatewcs/corrections.py
+++ b/updatewcs/corrections.py
@@ -5,10 +5,10 @@ import numpy as np
from numpy import linalg
from pytools import fileutil
from utils import diff_angles
-import makewcs, dgeo
+import makewcs, npol
MakeWCS = makewcs.MakeWCS
-DGEOCorr = dgeo.DGEOCorr
+NPOLCorr = npol.NPOLCorr
class TDDCorr(object):
"""
diff --git a/updatewcs/dgeo.py b/updatewcs/dgeo.py
deleted file mode 100644
index 44d495e..0000000
--- a/updatewcs/dgeo.py
+++ /dev/null
@@ -1,311 +0,0 @@
-from __future__ import division # confidence high
-
-import pyfits
-from pytools import fileutil
-import utils
-import numpy as np
-
-class DGEOCorr(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
- in the primary header.
-
- Notes
- -----
- - Using extensions in the reference file create a WCSDVARR extensions
- and add them to the science file.
- - Add record-valued keywords to the science extension header to describe
- the lookup tables.
- - Add a keyword 'NPOLEXT' to the science extension header to store
- the name of the reference file used to create the WCSDVARR extensions.
-
- If WCSDVARR extensions exist and `NPOLFILE` is different from `NPOLEXT`,
- a subsequent update will overwrite the existing extensions.
- If WCSDVARR extensions were not found in the science file, they will be added.
-
- It is assumed that the NPL reference files were created to work with IDC tables
- but will be applied with SIP coefficients. A transformation is applied to correct
- for the fact that the lookup tables will be applied before the first order coefficients
- which are in the CD matrix when the SIP convention is used.
- """
-
- def updateWCS(cls, fobj):
- """
- Parameters
- ----------
- fobj: pyfits object
- Science file, for which a distortion correction in a NPOLFILE is available
-
- """
- assert isinstance(fobj, pyfits.HDUList)
- cls.applyNPOLCorr(fobj)
- nplfile = fobj[0].header['NPOLFILE']
-
- new_kw = {'NPOLEXT': nplfile}
- return new_kw
-
- updateWCS = classmethod(updateWCS)
-
- def applyNPOLCorr(cls, fobj):
- """
- For each science extension in a pyfits file object:
- - create a WCSDVARR extension
- - update science header
- - add/update DGEOEXT keyword
- """
- nplfile = fileutil.osfn(fobj[0].header['NPOLFILE'])
- # Map WCSDVARR EXTVER numbers to extension numbers
- wcsdvarr_ind = cls.getWCSIndex(fobj)
- for ext in fobj:
- try:
- extname = ext.header['EXTNAME'].lower()
- except KeyError:
- continue
- if extname == 'sci':
- extversion = ext.header['EXTVER']
- ccdchip = cls.get_ccdchip(fobj, extname='SCI', extver=extversion)
- binned = utils.getBinning(fobj, extversion)
- header = ext.header
- # get the data arrays from the reference file and transform them for use with SIP
- dx,dy = cls.getData(nplfile, ccdchip)
- idccoeffs = cls.getIDCCoeffs(header)
-
- if idccoeffs != None:
- dx, dy = cls.transformData(dx,dy, idccoeffs)
-
- # Determine EXTVER for the WCSDVARR extension from the NPL file (EXTNAME, EXTVER) kw.
- # This is used to populate DPj.EXTVER kw
- wcsdvarr_x_version = 2 * extversion -1
- wcsdvarr_y_version = 2 * extversion
-
- for ename in zip(['DX', 'DY'], [wcsdvarr_x_version,wcsdvarr_y_version],[dx, dy]):
- cls.addSciExtKw(header, wdvarr_ver=ename[1], npol_extname=ename[0])
- hdu = cls.createNpolHDU(header, npolfile=nplfile, \
- wdvarr_ver=ename[1], npl_extname=ename[0], data=ename[2],ccdchip=ccdchip, binned=binned)
- if wcsdvarr_ind:
- fobj[wcsdvarr_ind[ename[1]]] = hdu
- else:
- fobj.append(hdu)
-
-
- applyNPOLCorr = classmethod(applyNPOLCorr)
-
- def getWCSIndex(cls, fobj):
-
- """
- If fobj has WCSDVARR extensions:
- returns a mapping of their EXTVER kw to file object extension numbers
- if fobj does not have WCSDVARR extensions:
- an empty dictionary is returned
- """
- wcsd = {}
- for e in range(len(fobj)):
- try:
- ename = fobj[e].header['EXTNAME']
- except KeyError:
- continue
- if ename == 'WCSDVARR':
- wcsd[fobj[e].header['EXTVER']] = e
-
- return wcsd
-
- getWCSIndex = classmethod(getWCSIndex)
-
- def addSciExtKw(cls, hdr, wdvarr_ver=None, npol_extname=None):
- """
- Adds kw to sci extension to define WCSDVARR lookup table extensions
-
- """
- if npol_extname =='DX':
- j=1
- else:
- j=2
-
- cperror = 'CPERROR%s' %j
- cpdis = 'CPDIS%s' %j
- dpext = 'DP%s.' %j + 'EXTVER'
- dpnaxes = 'DP%s.' %j +'NAXES'
- dpaxis1 = 'DP%s.' %j+'AXIS.1'
- dpaxis2 = 'DP%s.' %j+'AXIS.2'
- keys = [cperror, cpdis, dpext, dpnaxes, dpaxis1, dpaxis2]
- 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,
- cpdis: 'Prior distortion funcion type',
- dpext: 'Version number of WCSDVARR extension containing lookup distortion table',
- dpnaxes: 'Number of independent variables in distortion function',
- dpaxis1: 'Axis number of the jth independent variable in a distortion function',
- dpaxis2: 'Axis number of the jth independent variable in a distortion function'
- }
-
- for key in keys:
- hdr.update(key=key, value=values[key], comment=comments[key], before='HISTORY')
-
- addSciExtKw = classmethod(addSciExtKw)
-
- 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.
- """
- npl = pyfits.open(nplfile)
- for ext in npl:
- nplextname = ext.header.get('EXTNAME',"")
- nplccdchip = ext.header.get('CCDCHIP',1)
- if nplextname == 'DX' and nplccdchip == ccdchip:
- xdata = ext.data.copy()
- continue
- elif nplextname == 'DY' and nplccdchip == ccdchip:
- ydata = ext.data.copy()
- continue
- else:
- continue
- npl.close()
- return xdata, ydata
- getData = classmethod(getData)
-
- def transformData(cls, dx, dy, coeffs):
- """
- Transform the DGEO data arrays for use with SIP
- """
- ndx, ndy = np.dot(coeffs, [dx.ravel(), dy.ravel()])
- ndx.shape = dx.shape
- ndy.shape=dy.shape
- return ndx, ndy
-
- transformData = classmethod(transformData)
-
- def getIDCCoeffs(cls, header):
- """
- Return a matrix of the scaled first order IDC coefficients.
- """
- try:
- ocx10 = header['OCX10']
- ocx11 = header['OCX11']
- ocy10 = header['OCY10']
- ocy11 = header['OCY11']
- coeffs = np.array([[ocx11, ocx10], [ocy11,ocy10]], dtype=np.float32)
- except KeyError:
- print 'First order IDCTAB coefficients are not available.\n'
- print 'Cannot convert SIP to IDC coefficients.\n'
- return None
- try:
- idcscale = header['IDCSCALE']
- except KeyError:
- idcscale = 1
-
- return np.linalg.inv(coeffs/idcscale)
-
- getIDCCoeffs = classmethod(getIDCCoeffs)
-
- def createNpolHDU(cls, sciheader, npolfile=None, wdvarr_ver=1, npl_extname=None,data = None, ccdchip=1, binned=1):
- """
- Creates an HDU to be added to the file object.
- """
- hdr = cls.createNpolHdr(sciheader, npolfile=npolfile, wdvarr_ver=wdvarr_ver, npl_extname=npl_extname, ccdchip=ccdchip, binned=binned)
- hdu=pyfits.ImageHDU(header=hdr, data=data)
- return hdu
-
- createNpolHDU = classmethod(createNpolHDU)
-
- def createNpolHdr(cls, sciheader, npolfile, wdvarr_ver, npl_extname, ccdchip, binned):
- """
- Creates a header for the WCSDVARR extension based on the DGEO 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
- if the science image is a subarray or binned image.
- """
- npl = pyfits.open(npolfile)
- for ext in npl:
- #for i in range(len(dgf)):
- try:
- nplextname = ext.header['EXTNAME']
- nplextver = ext.header['EXTVER']
- except KeyError:
- continue
- #dgccdchip = ext.header.get('CCDCHIP', 0)
- nplccdchip = cls.get_ccdchip(npl, extname=nplextname, extver=nplextver)
- if nplextname == npl_extname and nplccdchip == ccdchip:
- npol_header = ext.header
- break
- else:
- continue
- npl.close()
-
- naxis = pyfits.getval(npolfile, ext=1, key='NAXIS')
- ccdchip = nplextname #dgeo_header['CCDCHIP']
-
- kw = { 'NAXIS': 'Size of the axis',
- 'CDELT': 'Coordinate increment along axis',
- 'CRPIX': 'Coordinate system reference pixel',
- 'CRVAL': 'Coordinate system value at reference pixel',
- }
-
- kw_comm1 = {}
- kw_val1 = {}
- for key in kw.keys():
- for i in range(1, naxis+1):
- si = str(i)
- kw_comm1[key+si] = kw[key]
-
- for i in range(1, naxis+1):
- si = str(i)
- kw_val1['NAXIS'+si] = npol_header.get('NAXIS'+si)
- kw_val1['CDELT'+si] = npol_header.get('CDELT'+si, 1.0)
- kw_val1['CRPIX'+si] = npol_header.get('CRPIX'+si, 0.0)
- kw_val1['CRVAL'+si] = npol_header.get('CRVAL'+si, 0.0)
-
- kw_comm0 = {'XTENSION': 'Image extension',
- 'BITPIX': 'IEEE floating point',
- 'NAXIS': 'Number of axes',
- 'EXTNAME': 'WCS distortion array',
- 'EXTVER': 'Distortion array version number',
- 'PCOUNT': 'Special data area of size 0',
- 'GCOUNT': 'One data group',
- }
-
- kw_val0 = { 'XTENSION': 'IMAGE',
- 'BITPIX': -32,
- 'NAXIS': naxis,
- 'EXTNAME': 'WCSDVARR',
- 'EXTVER': wdvarr_ver,
- 'PCOUNT': 0,
- 'GCOUNT': 1,
- 'CCDCHIP': ccdchip,
- }
-
- cdl = pyfits.CardList()
- for key in kw_comm0.keys():
- cdl.append(pyfits.Card(key=key, value=kw_val0[key], comment=kw_comm0[key]))
- for key in kw_comm1.keys():
- cdl.append(pyfits.Card(key=key, value=kw_val1[key], comment=kw_comm1[key]))
-
-
- hdr = pyfits.Header(cards=cdl)
-
- return hdr
-
- createNpolHdr = classmethod(createNpolHdr)
-
- def get_ccdchip(cls, fobj, extname, extver):
- """
- Given a science file or dgeo file determine CCDCHIP
- """
- ccdchip = 1
- if fobj[0].header['INSTRUME'] == 'ACS' and fobj[0].header['DETECTOR'] == 'WFC':
- ccdchip = fobj[extname, extver].header['CCDCHIP']
- elif fobj[0].header['INSTRUME'] == 'WFC3' and fobj[0].header['DETECTOR'] == 'UVIS':
- ccdchip = fobj[extname, extver].header['CCDCHIP']
- elif fobj[0].header['INSTRUME'] == 'WFPC2':
- ccdchip = fobj[extname, extver].header['DETECTOR']
- elif fobj[0].header['INSTRUME'] == 'STIS':
- ccdchip = fobj[extname, extver].header['DETECTOR']
- elif fobj[0].header['INSTRUME'] == 'NICMOS':
- ccdchip = fobj[extname, extver].header['CAMERA']
- return ccdchip
-
- get_ccdchip = classmethod(get_ccdchip)
- \ No newline at end of file
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':