Closed scottstanie closed 1 year ago
Changed the neighborhood map test to match the c++ functionality. Also changed the test so that 1 pixel out of the window is 0 (not a neighbor).
Another quick way to do this in numpy is using the packbits function:
packbits
In [122]: a = np.ones((7, 5), dtype=bool) In [123]: a[0, 0] = False In [124]: np.packbits(a, bitorder="little") Out[124]: array([254, 255, 255, 255, 7], dtype=uint8)
This matches what's now created it in simulate_bit_mask function.
simulate_bit_mask
(mapping) [staniewi@aurora fringe]$ hexdump neighborhood_map 0000000 fffe ffff 0007 0000 0000008
Changed the neighborhood map test to match the c++ functionality. Also changed the test so that 1 pixel out of the window is 0 (not a neighbor).
Another quick way to do this in numpy is using the
packbits
function:This matches what's now created it in
simulate_bit_mask
function.