diff --git a/SConstruct b/SConstruct index 9a2ea98..27d56f0 100644 --- a/SConstruct +++ b/SConstruct @@ -1,3 +1,3 @@ # -*- python -*- from lsst.sconsUtils import scripts -scripts.BasicSConstruct("display_firefly") +scripts.BasicSConstruct("display_firefly", disableCc=True, noCfgFile=True) diff --git a/python/lsst/display/firefly/firefly.py b/python/lsst/display/firefly/firefly.py index 29ba404..602069e 100644 --- a/python/lsst/display/firefly/firefly.py +++ b/python/lsst/display/firefly/firefly.py @@ -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 @@ -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 == "": @@ -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}' @@ -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(): diff --git a/ups/display_firefly.build b/ups/display_firefly.build deleted file mode 100644 index 735ac27..0000000 --- a/ups/display_firefly.build +++ /dev/null @@ -1,2 +0,0 @@ -@LSST BUILD@ && -build_lsst @PRODUCT@ @VERSION@ @REPOVERSION@ diff --git a/ups/display_firefly.cfg b/ups/display_firefly.cfg deleted file mode 100644 index 28087e7..0000000 --- a/ups/display_firefly.cfg +++ /dev/null @@ -1,15 +0,0 @@ -# -*- python -*- - -import lsst.sconsUtils - -dependencies = dict( - required = [], - buildRequired = [], -) - -config = lsst.sconsUtils.Configuration( - __file__, - libs=[], - hasDoxygenInclude=False, - hasSwigFiles=False, -)