summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsienkiew <sienkiew@stsci.edu>2013-01-29 17:36:48 -0500
committersienkiew <sienkiew@stsci.edu>2013-01-29 17:36:48 -0500
commit2d06201a0520014216d6e4e640a18e50c97f8999 (patch)
tree97faae2318dc14fee14b23117d8221a1cbdfa8e2
parent187f1455ef6ac1785d495e02197d6100c2babd11 (diff)
downloadstwcs_hcf-2d06201a0520014216d6e4e640a18e50c97f8999.tar.gz
fixing variable problems from import order
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@21885 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r--lib/stwcs/updatewcs/__init__.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/stwcs/updatewcs/__init__.py b/lib/stwcs/updatewcs/__init__.py
index 622ac35..7dbffbf 100644
--- a/lib/stwcs/updatewcs/__init__.py
+++ b/lib/stwcs/updatewcs/__init__.py
@@ -5,12 +5,8 @@ import pyfits
import numpy as np
from stwcs import wcsutil
from stwcs.wcsutil import HSTWCS
-from stwcs import __version__ as stwcsversion
+import stwcs
import pywcs
-try:
- from pywcs import __version__ as pywcsversion
-except:
- pywcsversion = 'UNKNOWN'
import utils, corrections, makewcs
import npol, det2im
@@ -170,24 +166,24 @@ def makecorr(fname, allowed_corr):
f[1].header.update(kw, kw2update[kw])
# Finally record the version of the software which updated the WCS
if f[0].header.has_key('HISTORY'):
- f[0].header.update(key='UPWCSVER', value=stwcsversion,
+ f[0].header.update(key='UPWCSVER', value=stwcs.__version__,
comment="Version of STWCS used to updated the WCS", before='HISTORY')
- f[0].header.update(key='PYWCSVER', value=pywcsversion,
+ f[0].header.update(key='PYWCSVER', value=pywcs.__version__,
comment="Version of PYWCS used to updated the WCS", before='HISTORY')
elif f[0].header.has_key('ASN_MTYP'):
- f[0].header.update(key='UPWCSVER', value=stwcsversion,
+ f[0].header.update(key='UPWCSVER', value=stwcs.__version__,
comment="Version of STWCS used to updated the WCS", after='ASN_MTYP')
- f[0].header.update(key='PYWCSVER', value=pywcsversion,
+ f[0].header.update(key='PYWCSVER', value=pywcs.__version__,
comment="Version of PYWCS used to updated the WCS", after='ASN_MTYP')
else:
# Find index of last non-blank card, and insert this new keyword after that card
for i in range(len(f[0].header) - 1, 0, -1):
if f[0].header[i].strip() != '':
break
- f[0].header.set('UPWCSVER', stwcsversion,
+ f[0].header.set('UPWCSVER', stwcs.__version__,
"Version of STWCS used to updated the WCS",
after=i)
- f[0].header.set('PYWCSVER', pywcsversion,
+ f[0].header.set('PYWCSVER', pywcs.__version__,
"Version of PYWCS used to updated the WCS",
after=i)
# add additional keywords to be used by headerlets