File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed
Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -134,16 +134,16 @@ def plot_source_from(
134134 auto_labels
135135 The labels given to the figure.
136136 """
137- # try:
138- self .mat_plot_2d .plot_mapper (
139- mapper = self .mapper ,
140- visuals_2d = self .visuals_2d ,
141- auto_labels = auto_labels ,
142- pixel_values = pixel_values ,
143- zoom_to_brightest = zoom_to_brightest ,
144- interpolate_to_uniform = interpolate_to_uniform ,
145- )
146- # except ValueError:
147- # logger.info(
148- # "Could not plot the source-plane via the Mapper because of a ValueError."
149- # )
137+ try :
138+ self .mat_plot_2d .plot_mapper (
139+ mapper = self .mapper ,
140+ visuals_2d = self .visuals_2d ,
141+ auto_labels = auto_labels ,
142+ pixel_values = pixel_values ,
143+ zoom_to_brightest = zoom_to_brightest ,
144+ interpolate_to_uniform = interpolate_to_uniform ,
145+ )
146+ except ValueError :
147+ logger .info (
148+ "Could not plot the source-plane via the Mapper because of a ValueError."
149+ )
Original file line number Diff line number Diff line change @@ -74,6 +74,11 @@ def draw_delaunay_pixels(
7474
7575 simplices = mapper .delaunay .simplices
7676
77+ # Remove padded -1 values required for JAX
78+ simplices = np .asarray (simplices )
79+ valid_mask = np .all (simplices >= 0 , axis = 1 )
80+ simplices = simplices [valid_mask ]
81+
7782 facecolors = facecolors_from (values = pixel_values , simplices = simplices )
7883
7984 norm = cmap .norm_from (array = pixel_values , use_log10 = use_log10 )
You can’t perform that action at this time.
0 commit comments