Skip to content

Commit

Permalink
Merge pull request #3230 from kecnry/fix-lcviz-stretch-hist
Browse files Browse the repository at this point in the history
postpone updating stretch hist if image_color_value not yet set
  • Loading branch information
bmorris3 authored Oct 21, 2024
2 parents 1c85b5d + 908c7ee commit f5b3a1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jdaviz/configs/default/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,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
Expand Down

0 comments on commit f5b3a1d

Please sign in to comment.