Skip to content

Commit

Permalink
fix band start offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Mar 5, 2022
1 parent 2b52223 commit 8a0b42d
Show file tree
Hide file tree
Showing 3 changed files with 482 additions and 115 deletions.
4 changes: 2 additions & 2 deletions cactice/bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def get_band(
raise ValueError(f"Band starting distance must be greater than 0 and less than min(grid length, grid width)")

band = {}
for ii in range(max(i - start, 0), min(i + 2, grid.shape[0])):
for jj in range(max(j - 1, 0), min(j + 2, grid.shape[1])):
for ii in range(max(i - start, 0), min(i + start + 1, grid.shape[0])):
for jj in range(max(j - start, 0), min(j + start + 1, grid.shape[1])):
coords = (ii, jj) if absolute_coords else (ii - i, jj - j)
band[coords] = grid[ii, jj]

Expand Down
Loading

0 comments on commit 8a0b42d

Please sign in to comment.