Beispiel #1
0
 def test_rebin_energy_1(self):
     data = sqio.Data(fp=os.path.join(self.tmp_dir, 'high_loss.dm3'),
                      DEELS=False)
     dims = list(data.data.axes_manager.shape)
     dims[2] /= 2
     data.rebin_energy(2)
     assert dims == list(data.data.axes_manager.shape)
Beispiel #2
0
 def test_project_signal_on_axis_2(self):
     # Case 2, projection along y axis
     data = sqio.Data(fp=os.path.join(self.tmp_dir, 'high_loss.dm3'),
                      DEELS=False)
     dims = list(data.data.axes_manager.shape)
     dims[1] = 1
     data.project_signal_on_axis(1)
     assert dims == list(data.data.axes_manager.shape)
Beispiel #3
0
 def test_MLLSmodel_point(self):
     lib = sqio.Standards(fp=self.ref_dir)
     SI = sqio.Data(fp=os.path.join(self.dat_dir, 'deconv.dm3'))
     SI.set_data_range(400.0, 500.0)
     tofit = [
         'Ti',
     ]
     lib.set_spectrum_range(400.0, 500.0)
     model = sqq.MLLSmodel(SI, lib)
Beispiel #4
0
 def test_rebin_energy_2(self):
     data = sqio.Data(fp=os.path.join(self.tmp_dir, 'high_loss.dm3'),
                      DEELS=True,
                      LL=os.path.join(self.tmp_dir, 'low_loss.dm3'))
     dims = list(data.data.axes_manager.shape)
     dims[2] /= 2
     dims_LL = list(data.LL.axes_manager.shape)
     dims_LL[2] /= 2
     data.rebin_energy(2)
     assert dims == list(data.data.axes_manager.shape)
     assert dims_LL == list(data.LL.axes_manager.shape)
Beispiel #5
0
 def test_project_signal_on_axis_3(self):
     # Case three, projection including low-loss data
     data = sqio.Data(fp=os.path.join(self.tmp_dir, 'high_loss.dm3'),
                      DEELS=True,
                      LL=os.path.join(self.tmp_dir, 'low_loss.dm3'))
     dims = list(data.data.axes_manager.shape)
     dims[1] = 1
     dims_LL = list(data.LL.axes_manager.shape)
     dims_LL[1] = 1
     data.project_signal_on_axis(1)
     assert dims == list(data.data.axes_manager.shape)
     assert dims_LL == list(data.LL.axes_manager.shape)
Beispiel #6
0
 def test_MLLSmodel_creation(self):
     lib = sqio.Standards(fp=self.ref_dir)
     SI = sqio.Data(fp=os.path.join(self.dat_dir, 'deconv.dm3'))
     model = sqq.MLLSmodel(SI, lib)
Beispiel #7
0
    def test_model_creation(self):
        lib = sqio.Standards(fp=self.ref_dir)

        SI = sqio.Data(fp=os.path.join(self.dat_dir, 'deconv.dm3'))

        model = sqb.BayesModel(SI, lib, ['Ti'], (400.0, 480.0))
Beispiel #8
0
 def test_deconvolve_hook(self):
     data = sqio.Data(fp=os.path.join(self.tmp_dir, 'high_loss.dm3'),
                      DEELS=True,
                      LL=os.path.join(self.tmp_dir, 'low_loss.dm3'))
     data.deconvolve()
Beispiel #9
0
 def test_init_w_low_loss(self):
     data = sqio.Data(fp=os.path.join(self.tmp_dir, 'high_loss.dm3'),
                      DEELS=True,
                      LL=os.path.join(self.tmp_dir, 'low_loss.dm3'))
Beispiel #10
0
 def test_init_basic(self):
     data = sqio.Data(fp=os.path.join(self.tmp_dir, 'high_loss.dm3'),
                      DEELS=False)