isce-framework / fringe

Fine Resolution InSAR With Generalized Eigenvectors (FRInGE)
Apache License 2.0
80 stars 42 forks source link

Test evd nmap fix #71

Closed scottstanie closed 1 year ago

scottstanie commented 2 years 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:

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.

(mapping) [staniewi@aurora fringe]$ hexdump neighborhood_map
0000000 fffe ffff 0007 0000
0000008