Esempio n. 1
0
 def setUp(self):
     # Create three signals with dimensions:
     # s1 : <Signal, title: , dimensions: (4, 3, 2|2, 3)>
     # s2 : <Signal, title: , dimensions: (2, 3|4, 3, 2)>
     # s12 : <Signal, title: , dimensions: (2, 3|4, 3, 2)>
     # Where s12 data is transposed in respect to s2
     dc1 = np.random.random((2, 3, 4, 3, 2))
     dc2 = np.rollaxis(np.rollaxis(dc1, -1), -1)
     s1 = signals.Signal(dc1.copy())
     s2 = signals.Signal(dc2)
     s12 = signals.Signal(dc1.copy())
     for i, axis in enumerate(s1.axes_manager._axes):
         if i < 3:
             axis.navigate = True
         else:
             axis.navigate = False
     for i, axis in enumerate(s2.axes_manager._axes):
         if i < 2:
             axis.navigate = True
         else:
             axis.navigate = False
     for i, axis in enumerate(s12.axes_manager._axes):
         if i < 3:
             axis.navigate = False
         else:
             axis.navigate = True
     self.s1 = s1
     self.s2 = s2
     self.s12 = s12
Esempio n. 2
0
 def setUp(self):
     gaussian = components.Gaussian()
     gaussian.A.value = 10
     gaussian.centre.value = 10
     gaussian.sigma.value = 1
     self.signal = signals.Signal(gaussian.function(np.arange(0, 20, 0.01)))
     self.signal.axes_manager[0].scale = 0.01
Esempio n. 3
0
 def setUp(self):
     s = signals.Signal(np.zeros(1))
     self.factors = np.ones([2, 3])
     self.loadings = np.ones([2, 3])
     s.learning_results.factors = self.factors.copy()
     s.learning_results.loadings = self.loadings.copy()
     self.s = s
Esempio n. 4
0
 def setUp(self):
     s = signals.Signal(np.empty(1))
     s.learning_results.explained_variance_ratio = np.empty(10)
     self.s = s
Esempio n. 5
0
 def setUp(self):
     s = signals.Signal(np.empty(1))
     self.s = s
Esempio n. 6
0
 def denoised_data_to_signal(self):
     signal = signals.Signal(self.Y)
     if self.signal_type == "spectrum":
         return signal.as_spectrum(2)
     if self.signal_type == "image":
         return signal.as_image((0, 1))