def setUp(self): s = signals.Spectrum(np.ones((5, 4, 3, 6))) for axis, name in zip( s.axes_manager._get_axes_in_natural_order(), ['x', 'y', 'z', 'E']): axis.name = name self.s = s
def setUp(self): pl = components.PowerLaw() pl.A.value = 1e10 pl.r.value = 3 self.signal = signals.Spectrum( pl.function(np.arange(100, 200))) self.signal.axes_manager[0].offset = 100 self.signal.metadata.Signal.binned = False
def setup(self): offset = 3 scale = 0.1 x = np.arange(-offset, offset, scale) s = signals.Spectrum(np.sin(x)) s.axes_manager[0].offset = x[0] s.axes_manager[0].scale = scale self.s = s
def setUp(self): gaussian = components.Gaussian() gaussian.A.value = 10 gaussian.centre.value = 10 gaussian.sigma.value = 1 self.signal = signals.Spectrum( gaussian.function(np.arange(0, 20, 0.01))) self.signal.axes_manager[0].scale = 0.01 self.signal.metadata.Signal.binned = False
def setup(self): # Some test require consistent random data for reference to be correct np.random.seed(0) s = signals.Spectrum(np.random.rand(5, 4, 3, 6)) for axis, name in zip( s.axes_manager._get_axes_in_natural_order(), ['x', 'y', 'z', 'E']): axis.name = name self.s = s
def setUp(self): s = signals.Spectrum(np.random.random((2, 3, 4, 5))) sa = s.axes_manager[-1] na = s.axes_manager[0] sa.offset = 100 sa.scale = 0.1 s.learning_results.factors = np.arange(5 * 5).reshape((5, 5)) s.learning_results.loadings = np.arange(24 * 5).reshape((24, 5)) s.learning_results.bss_factors = np.arange(5 * 2).reshape((5, 2)) s.learning_results.bss_loadings = np.arange(24 * 2).reshape((24, 2)) self.s = s self.na = na self.sa = sa