Пример #1
0
 def test_get_simple_cubic_signal(self):
     s0 = dd.get_simple_cubic_signal()
     s0.plot()
     s1 = dd.get_simple_cubic_signal(image_noise=False)
     s1.plot()
     s2 = dd.get_simple_cubic_signal(image_noise=True)
     s2.plot()
Пример #2
0
 def test_detector_normalisation(self):
     det_image = get_detector_image_signal()
     img = get_simple_cubic_signal(image_noise=True)
     img = (img) * 300000 + 4000
     image_normalised = quant.detector_normalisation(img, det_image, 60)
     assert image_normalised.data.max() < 1
     assert image_normalised.data.shape == img.data.shape
Пример #3
0
 def test_dtypes(self):
     dtype_list = [
         'float64', 'float32', 'uint64', 'uint32', 'uint16', 'uint8',
         'int64', 'int32', 'int16', 'int8']
     s = dd.get_simple_cubic_signal()
     s *= 10**9
     for dtype in dtype_list:
         print(dtype)
         s.change_dtype(dtype)
         afr.get_feature_separation(s, separation_range=(10, 15))
     s.change_dtype('float16')
     with pytest.raises(ValueError):
         afr.get_feature_separation(s, separation_range=(10, 15))
Пример #4
0
 def test_inverted_signal(self):
     s = dd.get_simple_cubic_signal()
     amm.run_image_filtering(s, invert_signal=True)
Пример #5
0
 def test_standard(self):
     s = dd.get_simple_cubic_signal()
     amm.run_image_filtering(s)
Пример #6
0
 def test_separation_range_bad(self, separation_range):
     s = dd.get_simple_cubic_signal()
     with pytest.raises(ValueError):
         afr.get_feature_separation(s, separation_range)
Пример #7
0
 def test_too_low_separation_low(self, separation_low):
     separation_range = (separation_low, 3)
     s = dd.get_simple_cubic_signal()
     with pytest.raises(ValueError):
         afr.get_feature_separation(s, separation_range)
Пример #8
0
 def test_pca_subtract_background_normalize_intensity(self):
     s = dd.get_simple_cubic_signal()
     s_fs = afr.get_feature_separation(
         s, pca=True, subtract_background=True,
         normalize_intensity=True)
     assert hasattr(s_fs, 'data')
Пример #9
0
 def test_separation_step(self):
     sr0, sr1, s_step = 10, 16, 2
     s = dd.get_simple_cubic_signal()
     s_fs = afr.get_feature_separation(
         s, separation_range=(sr0, sr1), separation_step=s_step)
     assert s_fs.axes_manager.navigation_size == ((sr1 - sr0) / s_step)
Пример #10
0
 def test_separation_range(self):
     sr0, sr1 = 10, 15
     s = dd.get_simple_cubic_signal()
     s_fs = afr.get_feature_separation(s, separation_range=(sr0, sr1))
     assert s_fs.axes_manager.navigation_size == (sr1 - sr0)
     assert s_fs.axes_manager.navigation_extent == (sr0, sr1 - 1)
Пример #11
0
 def test_simple(self):
     s = dd.get_simple_cubic_signal()
     s_fs = afr.get_feature_separation(s)
     s_fs.plot()
Пример #12
0
 def test_too_low_separation(self, separation):
     s = dd.get_simple_cubic_signal()
     with pytest.raises(ValueError):
         afr.get_atom_positions(s, separation)