Skip to content

Commit 7c7572c

Browse files
committed
Oblique cross section: avoid RuntimeWarning
1 parent 6fd75bb commit 7c7572c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

plotpy/panels/csection/csitem.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,10 @@ def compute_oblique_section(item, obj, debug=False):
243243
TEMP_ITEM.param.update_item(TEMP_ITEM)
244244
plot.replot()
245245

246-
ydata = np.ma.fix_invalid(dst_image, copy=debug).mean(axis=1)
246+
fixed_image = np.ma.fix_invalid(dst_image, copy=debug)
247+
if fixed_image.size == 0:
248+
return np.array([]), np.array([])
249+
ydata = fixed_image.mean(axis=1)
247250
xdata = item.get_x_values(0, ydata.size)[: ydata.size]
248251
try:
249252
xdata -= xdata[0]

0 commit comments

Comments
 (0)