summaryrefslogtreecommitdiff
path: root/wcsutil/hstwcs.py
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2011-03-17 17:29:33 -0400
committerhack <hack@stsci.edu>2011-03-17 17:29:33 -0400
commit3262a4afa935fdd89e40f30e0a254cf0b6eeaf8e (patch)
tree307a2b0ba1dcacaf191014acf07fefba4344eb70 /wcsutil/hstwcs.py
parent3afbaeb4b74e9b8ae6f11ae9ac89640969396be2 (diff)
downloadstwcs_hcf-3262a4afa935fdd89e40f30e0a254cf0b6eeaf8e.tar.gz
This update to the HSTWCS class in STWCS attempts to address a couple of issues: namely, makes recognition of non-HST data more general (slightly) and only applies distortion model in all_sky2pix when it is present. The first change should allow HSTWCS to be run on data created with IRAF's artdata package/task.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@12216 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'wcsutil/hstwcs.py')
-rw-r--r--wcsutil/hstwcs.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/wcsutil/hstwcs.py b/wcsutil/hstwcs.py
index e85fa21..907f215 100644
--- a/wcsutil/hstwcs.py
+++ b/wcsutil/hstwcs.py
@@ -53,8 +53,11 @@ class HSTWCS(WCS):
if fobj != None:
filename, hdr0, ehdr, phdu = getinput.parseSingleInput(f=fobj, ext=ext)
self.filename = filename
- self.instrument = hdr0.get('INSTRUME', 'DEFAULT')
-
+ instrument_name = hdr0.get('INSTRUME', 'DEFAULT')
+ if instrument_name in ['IRAF/ARTDATA','',' ','N/A']:
+ self.instrument = 'DEFAULT'
+ else:
+ self.instrument = instrument_name
WCS.__init__(self, ehdr, fobj=phdu, minerr=self.minerr, key=self.wcskey)
# If input was a pyfits HDUList object, it's the user's
# responsibility to close it, otherwise, it's closed here.
@@ -355,7 +358,11 @@ class HSTWCS(WCS):
# Use linear WCS as frame in which to perform fit
# rather than on the sky
- wcslin = utils.output_wcs([self])
+ undistort = True
+ if self.sip is None:
+ # Only apply distortion if distortion coeffs are present.
+ undistort = False
+ wcslin = utils.output_wcs([self],undistort=undistort)
# We can only transform 1 position at a time
for r,d,n in zip(ra,dec,xrange(len(ra))):
@@ -427,7 +434,6 @@ class HSTWCS(WCS):
ext_hdr.update('IDCV2REF', self.idcmodel.refpix['V2REF'])
ext_hdr.update('IDCV3REF', self.idcmodel.refpix['V3REF'])
-
def printwcs(self):
"""
Print the basic WCS keywords.