diff options
author | lim <lim@stsci.edu> | 2012-06-06 22:56:56 -0400 |
---|---|---|
committer | lim <lim@stsci.edu> | 2012-06-06 22:56:56 -0400 |
commit | 3cd92e88ed9640cf2f7da0c394042e40a443326e (patch) | |
tree | 41f6cfec9e55bf545b29b4a127cd4fc4a2237a45 /lib/test/test_skyline.py | |
parent | dcac482d19c8f69652aa32c2fbd6d646afdf9b3c (diff) | |
download | stsci.sphere-3cd92e88ed9640cf2f7da0c394042e40a443326e.tar.gz |
lim cleaned up SkyLine and added a test
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/branches/sphere@17217 fe389314-cf27-0410-b35b-8c050e845b92
Former-commit-id: 5673edaa81bee2b373f91d5e22336cd696a0584e
Diffstat (limited to 'lib/test/test_skyline.py')
-rw-r--r-- | lib/test/test_skyline.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/test/test_skyline.py b/lib/test/test_skyline.py new file mode 100644 index 0000000..d450e49 --- /dev/null +++ b/lib/test/test_skyline.py @@ -0,0 +1,34 @@ +"""SkyLine tests. + +:Author: Pey Lian Lim + +:Organization: Space Telescope Science Institute + +""" +from __future__ import absolute_import + +import pyfits +from numpy.testing import assert_almost_equal, assert_array_less + +from .. import skyline + +from .test_util import ROOT_DIR +from .test_shared import resolve_imagename + +def test_union_simple(): + # Two similar exposures with slight offset and some rotation. + im1 = resolve_imagename(ROOT_DIR, '2chipA.fits') + im2 = resolve_imagename(ROOT_DIR, '2chipB.fits') + + skyline1 = skyline.SkyLine(im1) + skyline2 = skyline.SkyLine(im2) + + union_1_2 = skyline1.union(skyline2) + union_2_1 = skyline2.union(skyline1) + + assert_almost_equal(union_1_2.area(), union_2_1.area()) + + for m in union_1_2.members: + assert m in union_2_1.members + + assert len(union_1_2.members) == 4 |