Skip to content

Commit

Permalink
Modify tests to use altered afw.geom.Angle API.
Browse files Browse the repository at this point in the history
The wrap methods were all changed to follow a functional form instead
of modifying Angles in place.
  • Loading branch information
kfindeisen committed Feb 28, 2017
1 parent 43519be commit a5d65ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 2 additions & 4 deletions python/lsst/obs/sdss/selectSdssImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,8 @@ def _computeRaRange(coordList, ctrRa=None):
raise RuntimeError("coordList contains no elements")
raList = [coord.toIcrs().getLongitude() for coord in coordList]
if ctrRa is None:
ctrRa = raList[0]
ctrRa.wrapCtr()
for ra in raList:
ra.wrapNear(ctrRa)
ctrRa = raList[0].wrapCtr()
raList = [ra.wrapNear(ctrRa) for ra in raList]
raRadList = np.array([ra.asRadians() for ra in raList])
minAngRad = np.min(raRadList)
maxAngRad = np.max(raRadList)
Expand Down
7 changes: 2 additions & 5 deletions tests/testSelectSdssImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,13 @@ def checkExpList(self, minRa, maxRa, runExpInfoDict):
@param[in] maxRa: maxinum RA (degrees)
@param[in] runExpInfoDict: a dict of run: list of ExposureInfo objects
"""
minRaAngle = minRa * afwGeom.degrees
maxRaAngle = maxRa * afwGeom.degrees
minRaAngle.wrapNear(maxRaAngle)
minRaAngle = (minRa * afwGeom.degrees).wrapNear(maxRaAngle)
ctrRaAngle = (minRaAngle + maxRaAngle) * 0.5
raDegList = []
for expInfoList in runExpInfoDict.values():
for expInfo in expInfoList:
raAngleList = [coord.getLongitude() for coord in expInfo.coordList]
for raAngle in raAngleList:
raAngle.wrapNear(ctrRaAngle)
raAngleList = [coord.getLongitude().wrapNear(ctrRaAngle) for coord in expInfo.coordList]
raDegList += [raAngle.asDegrees() for raAngle in raAngleList]
raDegList.sort()
self.assertGreaterEqual(minRa, raDegList[0])
Expand Down

0 comments on commit a5d65ae

Please sign in to comment.