From 354c99daa69a8cc4eff3b081ec2c0cdce9df102c Mon Sep 17 00:00:00 2001 From: bsimon Date: Mon, 4 May 2015 18:30:51 +0000 Subject: Updated files to run under python 2 and 3 git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@39775 fe389314-cf27-0410-b35b-8c050e845b92 --- lib/stwcs/wcsutil/instruments.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/stwcs/wcsutil/instruments.py') diff --git a/lib/stwcs/wcsutil/instruments.py b/lib/stwcs/wcsutil/instruments.py index 8641e51..45da046 100644 --- a/lib/stwcs/wcsutil/instruments.py +++ b/lib/stwcs/wcsutil/instruments.py @@ -1,6 +1,6 @@ -from __future__ import division # confidence high +from __future__ import absolute_import, division, print_function # confidence high -from mappings import ins_spec_kw +from .mappings import ins_spec_kw class InstrWCS(object): """ @@ -157,7 +157,7 @@ class ACSWCS(InstrWCS): try: self.detector = self.primhdr['DETECTOR'] except KeyError: - print 'ERROR: Detector kw not found.\n' + print('ERROR: Detector kw not found.\n') raise def set_parity(self): @@ -165,7 +165,7 @@ class ACSWCS(InstrWCS): 'HRC':[[-1.0,0.0],[0.0,1.0]], 'SBC':[[-1.0,0.0],[0.0,1.0]]} - if self.detector not in parity.keys(): + if self.detector not in parity: parity = InstrWCS.set_parity(self) else: self.parity = parity[self.detector] @@ -208,7 +208,7 @@ class WFPC2WCS(InstrWCS): try: self.detector = self.exthdr['DETECTOR'] except KeyError: - print 'ERROR: Detector kw not found.\n' + print('ERROR: Detector kw not found.\n') raise @@ -227,7 +227,7 @@ class WFC3WCS(InstrWCS): try: self.detector = self.primhdr['DETECTOR'] except KeyError: - print 'ERROR: Detector kw not found.\n' + print('ERROR: Detector kw not found.\n') raise def set_filter1(self): @@ -243,7 +243,7 @@ class WFC3WCS(InstrWCS): parity = {'UVIS':[[-1.0,0.0],[0.0,1.0]], 'IR':[[-1.0,0.0],[0.0,1.0]]} - if self.detector not in parity.keys(): + if self.detector not in parity: parity = InstrWCS.set_parity(self) else: self.parity = parity[self.detector] @@ -278,7 +278,7 @@ class NICMOSWCS(InstrWCS): try: self.detector = self.primhdr['CAMERA'] except KeyError: - print 'ERROR: Detector kw not found.\n' + print('ERROR: Detector kw not found.\n') raise class STISWCS(InstrWCS): @@ -309,7 +309,7 @@ class STISWCS(InstrWCS): try: self.detector = self.primhdr['DETECTOR'] except KeyError: - print 'ERROR: Detector kw not found.\n' + print('ERROR: Detector kw not found.\n') raise def set_date_obs(self): -- cgit