Skip to content

Commit

Permalink
Change ds9 calls to use non-zero frame number
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Dec 6, 2021
1 parent f2a78aa commit 2e7a2cb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_ds9.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
except Exception:
ds9 = None

FRAME_NUM = 731 # largish, random number, unlikely to be in use by a user

if ds9:
try:
ds9.mtv(afwImage.ImageF(1, 1))
ds9.mtv(afwImage.ImageF(1, 1), frame=FRAME_NUM)
except Exception as e:
print(f"Unable to use ds9: {e}")
ds9 = None
Expand All @@ -57,7 +59,7 @@ def tearDown(self):
def testMtv(self):
"""Test basic image display"""
exp = afwImage.ImageF(10, 20)
ds9.mtv(exp, title="parent")
ds9.mtv(exp, title="parent", frame=FRAME_NUM)

@unittest.skipUnless(ds9, "You must setup display.ds9 to run this test")
def testMaskPlanes(self):
Expand All @@ -71,10 +73,10 @@ def testTwoDisplays(self):

exp = afwImage.ExposureF(300, 350)

for frame in (0, 1):
for frame in (FRAME_NUM, FRAME_NUM+1):
ds9.setMaskTransparency(50, frame=frame)

if frame == 1:
if frame == FRAME_NUM+1:
ds9.setMaskPlaneColor("CROSSTALK", "ignore", frame=frame)
ds9.mtv(exp, title="parent", frame=frame)

Expand All @@ -99,7 +101,7 @@ def testDrawing(self):
ds9.erase()

exp = afwImage.ExposureF(300, 350)
ds9.mtv(exp, title="parent") # tells display0 about the image's xy0
ds9.mtv(exp, title="parent", frame=FRAME_NUM) # tells display0 about the image's xy0

with ds9.Buffering():
ds9.dot('o', 200, 220)
Expand All @@ -114,7 +116,7 @@ def testText(self):
ds9.erase()

exp = afwImage.ExposureF(300, 350)
ds9.mtv(exp, title="parent") # tells display0 about the image's xy0
ds9.mtv(exp, title="parent", frame=FRAME_NUM) # tells display0 about the image's xy0

with ds9.Buffering():
ds9.dot('hello', 200, 200)
Expand Down

0 comments on commit 2e7a2cb

Please sign in to comment.