Skip to content

Commit

Permalink
bug fix for guess_data_lims
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilipp committed Dec 13, 2018
1 parent d215470 commit 14435a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion straditize/straditizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,12 @@ def guess_data_lims(self, fraction=0.7):
cum_yr = np.where(mask, arr[::-1].cumsum(0)[::-1], 0)

right = np.vstack(np.where((cum_x > max_h) & (cum_y > max_v)))
ymax, xmax = right[:, right.shape[1] - 1 - right.max(0)[::-1].argmax()]
if right.size:
ymax, xmax = right[
:, right.shape[1] - 1 - right.max(0)[::-1].argmax()]
else:
xmax = len(cum_y) - 1 - (cum_y[::-1] > max_v).any(axis=0).argmax()
ymax = len(cum_x) - 1 - (cum_x[::-1] > max_h).any(axis=1).argmax()

left = np.vstack(np.where((cum_xr > max_h) & (cum_yr > max_v)))
if left.size:
Expand Down

0 comments on commit 14435a7

Please sign in to comment.