Skip to content

Commit decff5e

Browse files
Deprecate show_fits and replace by show_fits_image
1 parent adb997f commit decff5e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

firefly_client/fc_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def ensure3(val, name):
6666

6767
ACTION_DICT = {
6868
# actions from Firefly JS
69-
'ShowFits': 'ImagePlotCntlr.PlotImage',
69+
'ShowImage': 'ImagePlotCntlr.PlotImage',
7070
'AddExtension': 'ExternalAccessCntlr/extensionAdd',
7171
'FetchTable': 'table.fetch',
7272
'ShowTable': 'table.search',

firefly_client/firefly_client.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,11 @@ def reinit_viewer(self):
730730
"""
731731
return self.dispatch(ACTION_DICT['ReinitViewer'], {})
732732

733-
def show_fits(self, file_on_server=None, plot_id=None, viewer_id=None, **additional_params):
733+
def show_fits_image(self, file_on_server=None, plot_id=None, viewer_id=None, **additional_params):
734734
"""
735-
Show a FITS image.
735+
Show a FITS image. If the FITS file has multiple extensions/HDUs (for
736+
images, tables, etc.), all the image extensions are displayed by default
737+
within the image plot.
736738
737739
Parameters
738740
----------
@@ -785,9 +787,16 @@ def show_fits(self, file_on_server=None, plot_id=None, viewer_id=None, **additio
785787
file_on_server and payload['wpRequest'].update({'file': file_on_server})
786788
additional_params and payload['wpRequest'].update(additional_params)
787789

788-
r = self.dispatch(ACTION_DICT['ShowFits'], payload)
790+
r = self.dispatch(ACTION_DICT['ShowImage'], payload)
789791
warning and r.update({'warning': warning})
790792
return r
793+
794+
def show_fits(self, *args, **kwargs):
795+
"""
796+
DEPRECATED: Use show_fits_image() instead.
797+
"""
798+
warn("show_fits() is deprecated. Use show_fits_image() instead.")
799+
return self.show_fits_image(*args, **kwargs)
791800

792801
def show_fits_3color(self, three_color_params, plot_id=None, viewer_id=None):
793802
"""
@@ -827,7 +836,7 @@ def show_fits_3color(self, three_color_params, plot_id=None, viewer_id=None):
827836
viewer_id = FireflyClient.PINNED_IMAGE_VIEWER_ID
828837
payload.update({'viewerId': viewer_id})
829838

830-
r = self.dispatch(ACTION_DICT['ShowFits'], payload)
839+
r = self.dispatch(ACTION_DICT['ShowImage'], payload)
831840
warning and r.update({'warning': warning})
832841
return r
833842

0 commit comments

Comments
 (0)