コード例 #1
0
 def test_rotation(self):
     phase = np.zeros((50, 50))
     phase0 = pst._find_phase(phase, rotation=90)
     assert (phase0 == np.pi / 2).all()
     phase1 = pst._find_phase(phase, rotation=45)
     assert (phase1 == np.pi / 4).all()
     phase2 = pst._find_phase(phase, rotation=180)
     assert (phase2 == np.pi).all()
     phase3 = pst._find_phase(phase, rotation=360)
     assert (phase3 == 0).all()
     phase4 = pst._find_phase(phase, rotation=-90)
     assert (phase4 == 3 * np.pi / 2).all()
コード例 #2
0
 def test_max_phase(self):
     phase = (np.ones((50, 50)) * np.pi * 0.5) + np.pi
     phase0 = pst._find_phase(phase, max_phase=np.pi)
     assert (phase0 == np.pi / 2).all()
コード例 #3
0
 def test_simple(self):
     phase = np.zeros((50, 50))
     phase0 = pst._find_phase(phase)
     assert (phase0 == 0.0).all()