Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- python -*-
from lsst.sconsUtils import scripts
scripts.BasicSConstruct("display_firefly")
scripts.BasicSConstruct("display_firefly", disableCc=True, noCfgFile=True)
17 changes: 7 additions & 10 deletions python/lsst/display/firefly/firefly.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import logging
from io import BytesIO
from socket import gaierror
import tempfile

import lsst.afw.display.interface as interface
import lsst.afw.display.virtualDevice as virtualDevice
Expand Down Expand Up @@ -154,7 +153,7 @@ def _clearImage(self):
self._client.dispatch(action_type='ImagePlotCntlr.deletePlotView',
payload=dict(plotId=str(self.display.frame)))

def _mtv(self, image, mask=None, wcs=None, title=""):
def _mtv(self, image, mask=None, wcs=None, title="", metadata=None):
"""Display an Image and/or Mask on a Firefly display
"""
if title == "":
Expand All @@ -164,11 +163,10 @@ def _mtv(self, image, mask=None, wcs=None, title=""):
print('displaying image')
self._erase()

with tempfile.NamedTemporaryFile() as fd:
afwDisplay.writeFitsImage(fd.name, image, wcs, title)
fd.flush()
with BytesIO() as fd:
afwDisplay.writeFitsImage(fd, image, wcs, title, metadata=metadata)
fd.seek(0, 0)
self._fireflyFitsID = _fireflyClient.upload_data(fd, 'FITS')
self._fireflyFitsID = _fireflyClient.upload_fits_data(fd)

try:
viewer_id = f'image-{_fireflyClient.render_tree_id}-{self.frame}'
Expand Down Expand Up @@ -198,11 +196,10 @@ def _mtv(self, image, mask=None, wcs=None, title=""):
if mask:
if self.verbose:
print('displaying mask')
with tempfile.NamedTemporaryFile() as fdm:
afwDisplay.writeFitsImage(fdm.name, mask, wcs, title)
fdm.flush()
with BytesIO() as fdm:
afwDisplay.writeFitsImage(fdm, mask, wcs, title, metadata=metadata)
fdm.seek(0, 0)
self._fireflyMaskOnServer = _fireflyClient.upload_data(fdm, 'FITS')
self._fireflyMaskOnServer = _fireflyClient.upload_fits_data(fdm)

maskPlaneDict = mask.getMaskPlaneDict()
for k, v in maskPlaneDict.items():
Expand Down
2 changes: 0 additions & 2 deletions ups/display_firefly.build

This file was deleted.

15 changes: 0 additions & 15 deletions ups/display_firefly.cfg

This file was deleted.