summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--updatewcs/apply_corrections.py12
-rw-r--r--updatewcs/corrections.py7
2 files changed, 13 insertions, 6 deletions
diff --git a/updatewcs/apply_corrections.py b/updatewcs/apply_corrections.py
index 4758c5a..832fa32 100644
--- a/updatewcs/apply_corrections.py
+++ b/updatewcs/apply_corrections.py
@@ -47,8 +47,16 @@ def applyTDDCorr(fname, utddcorr):
detector = pyfits.getval(fname, 'DETECTOR')
except KeyError:
detector = None
-
- if instrument == 'ACS' and detector == 'WFC' and utddcorr == True:
+ try:
+ tddcorr = pyfits.getval(fname, 'TDDCORR')
+ if tddcorr == 'PERFORM':
+ tddcorr = True
+ else:
+ tddcorr = False
+ except KeyError:
+ tddcorr = None
+
+ if instrument == 'ACS' and detector == 'WFC' and tddcorr== True and utddcorr == True:
tddcorr = True
try:
idctab = pyfits.getval(fname, 'IDCTAB')
diff --git a/updatewcs/corrections.py b/updatewcs/corrections.py
index 15fd106..645e98d 100644
--- a/updatewcs/corrections.py
+++ b/updatewcs/corrections.py
@@ -98,12 +98,11 @@ class VACorr(object):
ext_wcs.wcs.crval[0] = ref_wcs.wcs.crval[0] + ext_wcs.vafactor*diff_angles(ext_wcs.wcs.crval[0], ref_wcs.wcs.crval[0])
ext_wcs.wcs.crval[1] = ref_wcs.wcs.crval[1] + ext_wcs.vafactor*diff_angles(ext_wcs.wcs.crval[1], ref_wcs.wcs.crval[1])
ext_wcs.wcs.set()
-
- kw2update={'CD1_1': ext_wcs.wcs.cd[0,0], 'CD1_2':ext_wcs.wcs.cd[0,1],
- 'CD2_1':ext_wcs.wcs.cd[1,0], 'CD2_2':ext_wcs.wcs.cd[1,1],
- 'CRVAL1':ext_wcs.wcs.crval[0], 'CRVAL2':ext_wcs.wcs.crval[1]}
else:
pass
+ kw2update={'CD1_1': ext_wcs.wcs.cd[0,0], 'CD1_2':ext_wcs.wcs.cd[0,1],
+ 'CD2_1':ext_wcs.wcs.cd[1,0], 'CD2_2':ext_wcs.wcs.cd[1,1],
+ 'CRVAL1':ext_wcs.wcs.crval[0], 'CRVAL2':ext_wcs.wcs.crval[1]}
return kw2update
updateWCS = classmethod(updateWCS)