@@ -19,9 +19,9 @@ class CtfEstimatorTestCase(TestCase):
1919 def setUp (self ):
2020 self .test_input_fn = "sample.mrc"
2121 self .test_output = {
22- "defocus_u" : 1.1142363760e03 ,
23- "defocus_v" : 1.0920983202e03 ,
24- "defocus_ang" : - 8.3521800000e-03 ,
22+ "defocus_u" : 1.137359876e03 ,
23+ "defocus_v" : 9.617226108e02 ,
24+ "defocus_ang" : 1.5706205116381249 ,
2525 "cs" : 2.0 ,
2626 "voltage" : 300.0 ,
2727 "pixel_size" : 1 ,
@@ -63,18 +63,28 @@ def testEstimateCTF(self):
6363 # the following parameters have higher tolerances
6464
6565 # defocusU
66- np .allclose (
67- result ["defocus_u" ], self .test_output ["defocus_u" ], atol = 5e-2
66+ self .assertTrue (
67+ np .allclose (
68+ result ["defocus_u" ],
69+ self .test_output ["defocus_u" ],
70+ atol = 5e-2 ,
71+ )
6872 )
6973 # defocusV
70- np .allclose (
71- result ["defocus_v" ], self .test_output ["defocus_v" ], atol = 5e-2
74+ self .assertTrue (
75+ np .allclose (
76+ result ["defocus_u" ],
77+ self .test_output ["defocus_u" ],
78+ atol = 5e-2 ,
79+ )
7280 )
7381 # defocusAngle
74- np .allclose (
75- result ["defocus_ang" ],
76- self .test_output ["defocus_ang" ],
77- atol = 5e-5 ,
82+ self .assertTrue (
83+ np .allclose (
84+ result ["defocus_ang" ],
85+ self .test_output ["defocus_ang" ],
86+ atol = 5e-2 ,
87+ )
7888 )
7989
8090 for param in ["cs" , "amplitude_contrast" , "voltage" , "pixel_size" ]:
0 commit comments