From a02874221f43bb1e9ab184b7f396f5943cc03ae5 Mon Sep 17 00:00:00 2001 From: dencheva Date: Thu, 26 Mar 2009 21:38:27 +0000 Subject: Added minerr parameter toHSTWCS and D@IMERR kw to primary header. This allows the detector to image correction to be switched off on the command line git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/development/trunk/updatewcs@7820 fe389314-cf27-0410-b35b-8c050e845b92 --- wcsutil/__init__.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'wcsutil/__init__.py') diff --git a/wcsutil/__init__.py b/wcsutil/__init__.py index 7bf16f7..d21a2ec 100644 --- a/wcsutil/__init__.py +++ b/wcsutil/__init__.py @@ -52,7 +52,7 @@ class HSTWCS(WCS): """ self.inst_kw = ins_spec_kw - + self.minerr = minerr if instrument == None: filename, hdr0, ehdr, phdu = self.parseInput(f=fobj, ext=ext) self.filename = filename @@ -122,6 +122,7 @@ class HSTWCS(WCS): self.det2imfile = primhdr.get('D2IMFILE', None) self.det2imext = primhdr.get('D2IMEXT', None) self.axiscorr = primhdr.get('AXISCORR', None) + self.d2imerr = primhdr.get('D2IMERR', 0.0) try: self.pav3 = primhdr['PA_V3'] @@ -234,10 +235,8 @@ class HSTWCS(WCS): this correction is applied before the corrsponding PyWCS method is called. """ def all_pix2sky(self, *args, **kwargs): - - origin = self.get_origin(*args) - if self.det2imext != None: + if self.det2imext != None and self.d2imerr > self.minerr: return WCS.all_pix2sky(self, self.det2im(*args),origin ) else: return WCS.all_pix2sky(self, *args) @@ -250,7 +249,7 @@ class HSTWCS(WCS): def pix2foc(self, *args, **kwargs): origin = self.get_origin(*args) - if self.det2imext != None: + if self.det2imext != None and self.d2imerr > self.minerr: return WCS.pix2foc(self, self.det2im(*args), origin) else: return WCS.pix2foc(self, *args) @@ -264,7 +263,7 @@ class HSTWCS(WCS): def p4_pix2foc(self, *args, **kwargs): origin = self.get_origin(*args) - if self.det2imext != None: + if self.det2imext != None and self.d2imerr > self.minerr: return WCS.p4_pix2foc(self, self.det2im(*args), origin) else: return WCS.p4_pix2foc(self, *args) @@ -278,7 +277,7 @@ class HSTWCS(WCS): def sip_pix2foc(self, *args, **kwargs): origin = self.get_origin(*args) - if self.det2imext != None: + if self.det2imext != None and self.d2imerr > self.minerr: return WCS.sip_pix2foc(self, self.det2im(*args), origin) else: return WCS.sip_pix2foc(self, *args) -- cgit