Coverage for tests/test_dodecaSkyMap.py : 87%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# # LSST Data Management System # Copyright 2008, 2009, 2010 LSST Corporation. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <http://www.lsstcorp.org/LegalNotices/>. # """
# dodecahedron properties
SkyMapClass=DodecaSkyMap, name="dodeca", numNeighbors=6, numTracts=12, neighborAngularSeparation=180*afwGeom.degrees - _DihedralAngle, )
"""Test that DodecaSkyMap's extra state is included in its hash."""
"""Test findTract and tractInfo.findPatch """
# make a list of all 5 nearest neighbors
# sky tracts 0, 1 and 2 form a triangle of nearest neighbors # explore the boundary between tract 0 and tract 1 # and also the boundary between tract 0 and tract 2
# if exploreBoundary1, explore boundary between tract 0 and tract 1, # else explore the boundary between tract 0 and tract 2
else:
# farFrac is the fraction of the tract center vector point whose boundary # is not being explored; it must be less than 1/3; # remFrac is the remaining fraction, which is divided between tract 0 # and the tract whose boundary is being explored
else:
nearestCtrCoord = nearestTractInfo.getCtrCoord() nearestVector = nearestCtrCoord.getVector()
print("tractId0=%s; tractId1=%s; tractId2=%s; nearestTractId=%s" % (tractId0, tractId1, tractId2, nearestTractId)) print("vector0=%s; vector1=%s; vector2=%s; nearestVector=%s" % (vector0, vector1, vector2, nearestVector)) print("frac0=%s; frac1=%s; frac2=%s" % (frac0, frac1, frac2)) print("testVector=", testVector)
print("dist0=%s; dist1=%s; dist2=%s; nearDist=%s" % ( testCoord.separation(ctrCoord0).asDegrees(), testCoord.separation(ctrCoord1).asDegrees(), testCoord.separation(ctrCoord2).asDegrees(), testCoord.separation(nearestCtrCoord).asDegrees(), )) self.fail("Expected nearest tractId=%s; got tractId=%s" % (expectedTractId, nearestTractId))
nearestTractInfo.getWcs().skyToPixel(testCoord))
"""Return the coords of the four corners of a bounding box """ bbox = afwGeom.Box2D(bbox) # mak cornerPosList = ( bbox.getMin(), afwGeom.Point2D(bbox.getMaxX(), bbox.getMinY()), bbox.getMax(), afwGeom.Point2D(bbox.getMinX(), bbox.getMaxY()), ) return wcs.pixelToSky(cornerPosList)
lsst.utils.tests.init() unittest.main() |