Skip to content

Commit

Permalink
Use order='K' in ravel() to avoid copy
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Apr 9, 2024
1 parent 322d024 commit 9dadc8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jdaviz/configs/default/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ def _update_stretch_histogram(self, msg={}):
y_max = y_limits.max()

arr = comp.data[y_min:y_max, x_min:x_max]
sub_data = arr.ravel()
sub_data = arr.ravel(order="K")

else:
# spectrum-2d-viewer, for example. We'll assume the viewer
Expand All @@ -993,12 +993,12 @@ def _update_stretch_histogram(self, msg={}):
(y_data >= viewer.state.y_min) &
(y_data <= viewer.state.y_max))

sub_data = comp.data[inds].ravel()
sub_data = comp.data[inds].ravel(order="K")

else:
# include all data, regardless of zoom limits
arr = comp.data
sub_data = arr.ravel()
sub_data = arr.ravel(order="K")

self.stretch_histogram.viewer.state.random_subset = RANDOM_SUBSET_SIZE
self.stretch_histogram._update_data('histogram', x=sub_data)
Expand Down

0 comments on commit 9dadc8d

Please sign in to comment.