def test_stack_data(mock_fxe_run): test_run = RunDirectory(mock_fxe_run) tid, data = test_run.train_from_id(10000, devices=[('*/DET/*', 'image.data')]) comb = stack_data(data, 'image.data') assert comb.shape == (128, 1, 16, 256, 256)
def test_stack_data(): test_run = RunDirectory(RUNPATH) tid, data = test_run.train_from_id(1472810853) comb = stack_data(data, 'image.data') print(comb.shape) assert comb.shape == (60, 10, 512, 128) np.testing.assert_equal(comb[:, 0, ...], data['SPB_DET_AGIPD1M-1/DET/0CH0:xtdf']['image.data'])
def test_stack_data_2(): test_run = RunDirectory(RUNPATH) tid, data = test_run.train_from_id(1472810853) skip = ['SPB_DET_AGIPD1M-1/DET/0CH0:xtdf', 'SPB_DET_AGIPD1M-1/DET/9CH0:xtdf'] comb = stack_data(data, 'image.data', axis=0, xcept=skip) print(comb.shape) assert comb.shape == (8, 60, 512, 128) np.testing.assert_equal(comb[0, ...], data['SPB_DET_AGIPD1M-1/DET/1CH0:xtdf']['image.data'])