summaryrefslogtreecommitdiff
path: root/lib/skyline.py
diff options
context:
space:
mode:
authorlim <lim@stsci.edu>2012-06-01 16:34:09 -0400
committerlim <lim@stsci.edu>2012-06-01 16:34:09 -0400
commit9296a0d211f681c727dadb0cc42d015ac376fda9 (patch)
treec0b93a5e08cdf0afbdd249978437e2c50ec9bc1b /lib/skyline.py
parentf7a6460e40d1ebaceb01c8275b79df03c3a6d210 (diff)
downloadstsci.sphere-9296a0d211f681c727dadb0cc42d015ac376fda9.tar.gz
lim put more codes on SkyLine -- done for the day 6/1
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/branches/sphere@17199 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: f5bf23a34b13c0d435dde59db75e58eb4805e8df
Diffstat (limited to 'lib/skyline.py')
-rw-r--r--lib/skyline.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/skyline.py b/lib/skyline.py
index 5754128..b77fe49 100644
--- a/lib/skyline.py
+++ b/lib/skyline.py
@@ -108,7 +108,7 @@ class SkyLineMember(object):
class SkyLine(SphericalPolygon):
- def __init__(self, fname):
+ def __init__(self, fname, extname='SCI'):
"""Initialize SkyLine object instance.
Parameters
@@ -119,6 +119,10 @@ class SkyLine(SphericalPolygon):
fname: str
FITS image.
+ extname: str
+ EXTNAME to use. SCI is recommended for normal
+ HST images. PRIMARY if image is single ext.
+
"""
# Inherit from SphericalPolygon
SphericalPolygon.__init__(self, [], None)
@@ -127,11 +131,11 @@ class SkyLine(SphericalPolygon):
poly_list = []
with pyfits.open(fname) as pf:
for i,ext in enumerate(pf):
- if 'SCI' in ext.name.upper():
+ if extname in ext.name.upper():
poly_list.append(SkyLineMember(fname, i))
assert len(poly_list) > 0, \
- 'SkyLine cannot find SCI ext in {}.'.format(fname)
+ 'SkyLine cannot find {} ext in {}.'.format(extname, fname)
# Put mosaic of all the chips in SkyLine
self._update(self.multi_union([m.polygon for m in poly_list]),