diff options
author | lim <lim@stsci.edu> | 2012-06-21 16:00:28 -0400 |
---|---|---|
committer | lim <lim@stsci.edu> | 2012-06-21 16:00:28 -0400 |
commit | d5f1fce2e7df93f76ed860b8ffe1f2a97599bd25 (patch) | |
tree | cb8664f2e6d5dd4b25ab7ab7585a378e347ca489 | |
parent | 1121435a46e8796e83649003ea232eb6e2f4152c (diff) | |
download | stsci.sphere-d5f1fce2e7df93f76ed860b8ffe1f2a97599bd25.tar.gz |
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/branches/sphere@17466 fe389314-cf27-0410-b35b-8c050e845b92
Former-commit-id: 012f62a226de22cac56716a3b137ff70b6b771e4
-rw-r--r-- | lib/skyline.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/skyline.py b/lib/skyline.py index 10c1c65..113192e 100644 --- a/lib/skyline.py +++ b/lib/skyline.py @@ -227,10 +227,15 @@ class SkyLine(object): def to_wcs(self): """ Combine WCS objects from all `members` and return a - new WCS object. + new WCS object. If no `members`, return `None`. """ - return output_wcs([m.wcs for m in self.members]) + wcs = None + + if len(self.members) > 0: + wcs = output_wcs([m.wcs for m in self.members]) + + return wcs def _find_members(self, given_members): """ @@ -415,3 +420,18 @@ class SkyLine(object): remaining.remove(next_skyline) return mosaic, out_order, excluded + + @classmethod + def _find_frosty(cls, show=False): + s1 = SphericalPolygon.from_cone(0, 35, 8) + s2 = SphericalPolygon.from_cone(0, 20, 13) + s3 = SphericalPolygon.from_cone(0, 0, 20) + ss = SphericalPolygon.multi_union([s1,s2,s3]) + frosty = cls(None) + frosty.polygon = ss + if show: + from mpl_toolkits.basemap import Basemap + map = Basemap() + frosty.draw(map) + print('Frosty the Snowman says Brrr so cold...') + return frosty |