diff options
author | hack <hack@stsci.edu> | 2014-09-22 16:00:57 -0400 |
---|---|---|
committer | hack <hack@stsci.edu> | 2014-09-22 16:00:57 -0400 |
commit | bd432a46967bb359c3a6dc5b0430436c24ff0696 (patch) | |
tree | cd6cf484a07683fc59a7bc87507da8d9b2d4ba5e /lib/stwcs/wcsutil/hstwcs.py | |
parent | 6637d499e773ada6d0f9707227b5622ff07b2d32 (diff) | |
download | stwcs_hcf-bd432a46967bb359c3a6dc5b0430436c24ff0696.tar.gz |
Minor updates to HSTWCS to allow it to provide a uniform interface to some non-HST data as well as HST data. These changes only support data already supported by astropy.wcs and do not affect any aspect of HST support. No support for undistorting non-HST data should ever be implied or assumed.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@34531 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib/stwcs/wcsutil/hstwcs.py')
-rw-r--r-- | lib/stwcs/wcsutil/hstwcs.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/stwcs/wcsutil/hstwcs.py b/lib/stwcs/wcsutil/hstwcs.py index 8cc56ee..7618412 100644 --- a/lib/stwcs/wcsutil/hstwcs.py +++ b/lib/stwcs/wcsutil/hstwcs.py @@ -138,12 +138,15 @@ class HSTWCS(WCS): ext=ext) self.filename = filename instrument_name = hdr0.get('INSTRUME', 'DEFAULT') - if instrument_name in ['IRAF/ARTDATA','',' ','N/A']: + if instrument_name == 'DEFAULT' or instrument_name not in inst_mappings.keys(): + #['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 self.instrument == 'DEFAULT': + self.pc2cd() # If input was a `astropy.io.fits.HDUList` object, it's the user's # responsibility to close it, otherwise, it's closed here. if not isinstance(fobj, fits.HDUList): @@ -458,7 +461,9 @@ class HSTWCS(WCS): return cards def pc2cd(self): - self.wcs.cd = self.wcs.pc.copy() + if not self.wcs.has_pc(): + self.wcs.pc = self.wcs.get_pc() + self.wcs.cd = self.wcs.pc * self.wcs.cdelt[1] def all_world2pix(self, *args, **kwargs): """ |