Skip to content

Commit

Permalink
Remove a pep8 warning in a modified file
Browse files Browse the repository at this point in the history
  • Loading branch information
r-owen committed Mar 16, 2018
1 parent 8606220 commit 05f888f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
10 changes: 6 additions & 4 deletions python/lsst/ip/diffim/imagePsfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,15 @@ def _validateWcs(self, templateExposure, scienceExposure):
scienceOrigin[0], scienceOrigin[1],
scienceLimit[0], scienceLimit[1])

templateBBox = afwGeom.Box2D(templateOrigin.getPosition(), templateLimit.getPosition())
scienceBBox = afwGeom.Box2D(scienceOrigin.getPosition(), scienceLimit.getPosition())
templateBBox = afwGeom.Box2D(templateOrigin.getPosition(afwGeom.degrees),
templateLimit.getPosition(afwGeom.degrees))
scienceBBox = afwGeom.Box2D(scienceOrigin.getPosition(afwGeom.degrees),
scienceLimit.getPosition(afwGeom.degrees))
if not (templateBBox.overlaps(scienceBBox)):
raise RuntimeError("Input images do not overlap at all")

if ((templateOrigin.getPosition() != scienceOrigin.getPosition()) or
(templateLimit.getPosition() != scienceLimit.getPosition()) or
if ((templateOrigin != scienceOrigin) or
(templateLimit != scienceLimit) or
(templateExposure.getDimensions() != scienceExposure.getDimensions())):
return False
return True
Expand Down
12 changes: 5 additions & 7 deletions python/lsst/ip/diffim/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,9 @@ def printSkyDiffs(sources, wcs):
"""Print differences in sky coordinates between source Position and its Centroid mapped through Wcs"""
for s in sources:
sCentroid = s.getCentroid()
sPosition = s.getCoord().getPosition()
dra = 3600*(sPosition.getX() - wcs.pixelToSky(sCentroid.getX(),
sCentroid.getY()).getPosition().getX())/0.2
ddec = 3600*(sPosition.getY() - wcs.pixelToSky(sCentroid.getX(),
sCentroid.getY()).getPosition().getY())/0.2
sPosition = s.getCoord().getPosition(afwGeom.degrees)
dra = 3600*(sPosition.getX() - wcs.pixelToSky(sCentroid).getPosition(afwGeom.degrees).getX())/0.2
ddec = 3600*(sPosition.getY() - wcs.pixelToSky(sCentroid).getPosition(afwGeom.degrees).getY())/0.2
if np.isfinite(dra) and np.isfinite(ddec):
print(dra, ddec)

Expand All @@ -686,9 +684,9 @@ def makeRegions(sources, outfilename, wcs=None):
"select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source\nfk5\n")
for s in sources:
if wcs:
(ra, dec) = wcs.pixelToSky(s.getCentroid().getX(), s.getCentroid().getY()).getPosition()
(ra, dec) = wcs.pixelToSky(s.getCentroid()).getPosition(afwGeom.degrees)
else:
(ra, dec) = s.getCoord().getPosition()
(ra, dec) = s.getCoord().getPosition(afwGeom.degrees)
if np.isfinite(ra) and np.isfinite(dec):
fh.write("circle(%f,%f,2\")\n"%(ra, dec))
fh.flush()
Expand Down
1 change: 1 addition & 0 deletions tests/test_modelPsfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def makeVisitInfo():
weather=Weather(1.1, 2.2, 34.5),
)


class TestMemory(lsst.utils.tests.MemoryTestCase):
pass

Expand Down

0 comments on commit 05f888f

Please sign in to comment.