summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2010-09-22 16:11:31 -0400
committerdencheva <dencheva@stsci.edu>2010-09-22 16:11:31 -0400
commitff2e7b4eeebbd1c34e87f90bc9cb16bcf3623d47 (patch)
tree8fe50fd294a808ca45ab42c161cbd8fc23ab71ef
parent57e00fc8ac9b9143dd47acf97346db16ae53c26f (diff)
downloadstwcs_hcf-ff2e7b4eeebbd1c34e87f90bc9cb16bcf3623d47.tar.gz
Addresses #609 - deletes all alternate WCS's (except the original OPUS obne) if a new idc table is detected.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@10376 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r--updatewcs/apply_corrections.py5
-rw-r--r--updatewcs/makewcs.py3
2 files changed, 5 insertions, 3 deletions
diff --git a/updatewcs/apply_corrections.py b/updatewcs/apply_corrections.py
index 4eee126..9d3573e 100644
--- a/updatewcs/apply_corrections.py
+++ b/updatewcs/apply_corrections.py
@@ -5,6 +5,7 @@ import pyfits
import time
from pytools import fileutil
import os.path
+from stwcs.wcsutil import altwcs
#Note: The order of corrections is important
@@ -53,11 +54,11 @@ def setCorrections(fname, vacorr=True, tddcorr=True, dgeocorr=True, d2imcorr=Tru
if 'MakeWCS' in acorr and newIDCTAB(fname):
print "New IDCTAB file detected. This invalidates all WCS's."
print "Deleting all previous WCS's"
- keys = utils.wcskeys(pyfits.getheader(fname, ext=1))
+ keys = altwcs.wcskeys(pyfits.getheader(fname, ext=1))
if 'O' in keys:
keys.remove('O')
for key in keys:
- utils.deleteWCS(fname, key)
+ altwcs.deleteWCS(fname, key)
if 'VACorr' in acorr and vacorr==False: acorr.remove('VACorr')
if 'TDDCorr' in acorr:
diff --git a/updatewcs/makewcs.py b/updatewcs/makewcs.py
index 49bca0b..08da0b8 100644
--- a/updatewcs/makewcs.py
+++ b/updatewcs/makewcs.py
@@ -3,7 +3,7 @@ from __future__ import division # confidence high
from stwcs import DEGTORAD, RADTODEG
import numpy as np
from math import sin, sqrt, pow, cos, asin, atan2,pi
-import utils
+from stwcs import utils
from pytools import fileutil
class MakeWCS(object):
@@ -52,6 +52,7 @@ class MakeWCS(object):
'CRVAL2': ext_wcs.wcs.crval[1],
'CRPIX1': ext_wcs.wcs.crpix[0],
'CRPIX2': ext_wcs.wcs.crpix[1],
+ 'IDCTAB': ext_wcs.idctab,
}
return kw2update