summaryrefslogtreecommitdiff
path: root/wcsutil/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'wcsutil/__init__.py')
-rw-r--r--wcsutil/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/wcsutil/__init__.py b/wcsutil/__init__.py
index fb38c30..2da3ac0 100644
--- a/wcsutil/__init__.py
+++ b/wcsutil/__init__.py
@@ -53,7 +53,11 @@ class HSTWCS(WCS):
self.filename = filename
self.setHDR0kw(hdr0, ehdr)
WCS.__init__(self, ehdr, fobj=phdu)
-
+ # If input was a pyfits HDUList object, it's the user's
+ # responsibility to close it, otherwise, it's closed here.
+ if not isinstance(fobj, pyfits.HDUList):
+ phdu.close()
+
self.setInstrSpecKw(hdr0, ehdr)
self.setPscale()
self.setOrient()
@@ -68,6 +72,7 @@ class HSTWCS(WCS):
self.detector = detector
self.setInstrSpecKw()
+
def parseInput(self, f=None, ext=None):
if isinstance(f, str):
# create an HSTWCS object from a filename