ess.snspowder.powgen.data.powgen_tutorial_sample_file#
- ess.snspowder.powgen.data.powgen_tutorial_sample_file(*, small=False)[source]#
Return the path to the POWGEN sample file.
- Parameters:
small (
bool
, default:False
) –If True, return a smaller file for unit tests. The small version of the file was created using the following code, which keeps only 7 columns out of 154 (154 / 7 = 22):
import scipp as sc fname = 'PG3_4844_event.h5' dg = sc.io.load_hdf5(fname) sizes = {"bank": 23, "column": 154, "row": 7} def foldme(x, dim): return x.fold(dim=dim, sizes=sizes)['column', ::22].flatten( dims=list(sizes.keys()), to=dim) small = sc.DataGroup({ 'data': foldme(dg['data'], 'spectrum'), 'detector_info': sc.Dataset( coords={key: foldme(c, 'detector') for key, c in dg['detector_info'].coords.items()}) }) sc.io.save_hdf5(small, 'TEST_PG3_4844_event.h5')
- Return type: