mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-12-01 09:07:46 +01:00
dealt with masking in modulus
This commit is contained in:
1 parent
a1389ec4e2
commit
5c588da8ee
2 files changed
+14
-5
No files matched your search
@@ -9,8 +9,13 @@ from scipy.fftpack import fftshift, ifftshift
|
||||
def test_modulus():
|
||||
# Create a complex array with modulus 12 and phase pi/4
|
||||
np_result = 6**.5*(np.ones((10,10))+1j*np.ones((10,10)))
|
||||
|
||||
# Test without masks
|
||||
assert(np.allclose(cmath.torch_to_complex(projectors.modulus(t.ones((10,10,2)), 12*t.ones((10,10)))), np_result))
|
||||
# Test with mask
|
||||
mask = t.ones((10,10,2), dtype = t.uint8)
|
||||
mask[5]*=0
|
||||
np_result[5] = 1+1j
|
||||
assert(np.allclose(cmath.torch_to_complex(projectors.modulus(t.ones((10,10,2)), 12*t.ones((10,10)), mask = mask)), np_result))
|
||||
|
||||
|
||||
def test_support():
|
||||
|
||||
Reference in new issue
Block a user