From 908c7ee09b808d8df262a2275875dde103645811 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Fri, 18 Oct 2024 12:03:56 -0400 Subject: [PATCH] postpone updating stretch hist if image_color_value not yet set only seems to happen in lcviz --- jdaviz/configs/default/plugins/plot_options/plot_options.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jdaviz/configs/default/plugins/plot_options/plot_options.py b/jdaviz/configs/default/plugins/plot_options/plot_options.py index 164457d7b1..410a8e0139 100644 --- a/jdaviz/configs/default/plugins/plot_options/plot_options.py +++ b/jdaviz/configs/default/plugins/plot_options/plot_options.py @@ -1096,6 +1096,10 @@ def _update_stretch_curve(self, msg=None): plane = layer_cmap(data) else: # Color (Monochromatic) + if self.image_color_value is None: + # do not crash if image_color_value is not yet assigned, + # _update_stretch_curve observes image_color_value so will get called again + return False # Get color color = COLOR_CONVERTER.to_rgba_array(self.image_color_value)[0] plane = data[:, np.newaxis] * color