summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2013-10-30 15:49:06 -0400
committerhack <hack@stsci.edu>2013-10-30 15:49:06 -0400
commitbd55a281889fd75227626180fa0ed56c8fcfb494 (patch)
tree68a0f94a29e06336874178d8ef24d5228c6eaa73
parent7bf60a5729ebf39854e8c38674ce31848aa39749 (diff)
downloadstwcs_hcf-bd55a281889fd75227626180fa0ed56c8fcfb494.tar.gz
Very minor/simple update to HSTWCS.all_sky2pix() method to not update output values based on an increasingly bad inversion. This only affects positions at an extreme distance outside the frame where the distortion model breaks down and becomes unstable.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@27118 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r--lib/stwcs/wcsutil/hstwcs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/stwcs/wcsutil/hstwcs.py b/lib/stwcs/wcsutil/hstwcs.py
index f52c27a..4bee8bb 100644
--- a/lib/stwcs/wcsutil/hstwcs.py
+++ b/lib/stwcs/wcsutil/hstwcs.py
@@ -322,7 +322,7 @@ class HSTWCS(WCS):
sip2hdr: boolean
If True - include SIP coefficients
"""
-
+
h = self.to_header(wkey=wcskey, relax=relax)
if not wcskey:
wcskey = self.wcs.alt
@@ -343,7 +343,7 @@ class HSTWCS(WCS):
del h['RESTFRQ']
del h['RESTWAV']
except KeyError: pass
-
+
if sip2hdr and self.sip:
for card in self._sip2hdr('a'):
h.update(card.key,value=card.value,comment=card.comment)
@@ -486,6 +486,8 @@ class HSTWCS(WCS):
# Check to see whether we have reached the limit or
# the new error is greater than error from previous iteration
if ev < err or (np.abs(ev) > np.abs(ev_old)):
+ x[0] = xold
+ y[0] = yold
break
# remember error measurement from previous iteration
ev_old = ev
@@ -521,5 +523,3 @@ class HSTWCS(WCS):
print 'NAXIS : %d %d' % (self.naxis1, self.naxis2)
print 'Plate Scale : %r' % self.pscale
print 'ORIENTAT : %r' % self.orientat
-
-