diff options
| author | dencheva <dencheva@stsci.edu> | 2009-03-26 17:38:27 -0400 | 
|---|---|---|
| committer | dencheva <dencheva@stsci.edu> | 2009-03-26 17:38:27 -0400 | 
| commit | a02874221f43bb1e9ab184b7f396f5943cc03ae5 (patch) | |
| tree | 30e56b5db4a85c03110b2cf494ebd01527a3da18 /wcsutil | |
| parent | f4f7b6033617c1943e2348820f9698960259e44b (diff) | |
| download | stwcs_hcf-a02874221f43bb1e9ab184b7f396f5943cc03ae5.tar.gz | |
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
Diffstat (limited to 'wcsutil')
| -rw-r--r-- | wcsutil/__init__.py | 13 | 
1 files changed, 6 insertions, 7 deletions
| 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) | 
