Apart from the fact that files can be purged using nxsreader this tools gives you some insight into NeXus files.
$ nxsreader -h usage: nxsreader.py [-h] [--attr [ATTRPATTERN]] [--field [FIELDPATTERN]] [--group [GROUPPATTERN]] [--ndim [NDIMPATTERN]] [--purge] [--util [UTILPATTERN]] fileName nxsreader, the CLI to the nxsReader class positional arguments: fileName the name of the file to be processed optional arguments: -h, --help show this help message and exit --attr [ATTRPATTERN] search pattern for attribute paths --field [FIELDPATTERN] search pattern for field and link paths --group [GROUPPATTERN] search pattern for group paths --ndim [NDIMPATTERN] search pattern for field shapes --purge remove data belonging identical motor positions --util [UTILPATTERN] select a utility, debug feature Examples: nxsreader.py tst_00204.nxs displays groups, fields, links and attributes. nxsreader nxsTest_00004.nxs --group display groups, no search restriction nxsreader nxsTest_00004.nxs --group insertion searches the file for groups with a path containing "insertion" nxsreader nxsTest_00004.nxs --field displays all fields nxsreader nxsTest_00004.nxs --field /scan:NXentry/instrument:NXinstrument/collection:NXcollection/exp_c03 displays a specific field nxsreader nxsTest_00004.nxs --ndim 2 displays 2-dimensional fields, e.g. (21, 2048) nxsreader nxsTest_00004.nxs --attr displays all attributes nxsreader nxsTest_00004.nxs --purge uses the motor positions to purge the data fields
Example, show all:
$ nxsreader nexusTest_00391.nxs 1 Group: name: /, parent: None path: / 2 Attr: HDF5_version, parent: /, value: 1.8.13 path: /@HDF5_version 2 Attr: NX_class, parent: /, value: NXroot path: /@NX_class 2 Attr: NeXus_version, parent: /, value: 4.3.0 path: /@NeXus_version 2 Attr: file_name, parent: /, value: /home/kracht/Misc/IVP/temp/nexusTest_00391.nxs path: /@file_name 2 Attr: file_time, parent: /, value: 2016-05-18T11:07:44.666647+0200 path: /@file_time 2 Attr: file_update_time, parent: /, value: 2016-05-18T11:07:52.814789+0200 path: /@file_update_time 2 Group: name: nexus_configuration_logs, parent: / path: /nexus_configuration_logs:NXcollection 3 Attr: NX_class, parent: nexus_configuration_logs, value: NXcollection path: /nexus_configuration_logs:NXcollection@NX_class 3 Field: name: Nexus__entry__1_XML, shape: (1,), dtype: string path: /nexus_configuration_logs:NXcollection/Nexus__entry__1_XML value: <?xml version="1.0" ?><definit... up> </group> <nl></definition> 3 Field: name: python_version, shape: (1,), dtype: string path: /nexus_configuration_logs:NXcollection/python_version value: 2.7.9 (default, Mar 1 2015, 12:57:24) <nl>[GCC 4.9.2] ...
Use the shape to search a field:
$ nxsreader nexusTest_00391.nxs --ndim 3 5 Field: name: data, shape: (27, 195, 487), dtype: int32 path: /scan:NXentry/instrument:NXinstrument/pilatus:NXdetector/data value[0][...]: [[33 34 32 ..., 19 22 19]<nl> ... <nl> [30 31 27 ..., 21 14 14]] value[1][...]: [[33 34 32 ..., 19 22 19]<nl> ... <nl> [30 31 27 ..., 21 14 14]] value[2][...]: [[33 34 32 ..., 19 22 19]<nl> ... <nl> [30 31 27 ..., 21 14 14]] ...
Use a full path for the search:
$ nxsreader nexusTest_00391.nxs --field /scan:NXentry/instrument:NXinstrument/pilatus:NXdetector/data 5 Field: name: data, shape: (27, 195, 487), dtype: int32 path: /scan:NXentry/instrument:NXinstrument/pilatus:NXdetector/data value[0][...]: [[33 34 32 ..., 19 22 19]<nl> ... <nl> [30 31 27 ..., 21 14 14]] value[1][...]: [[33 34 32 ..., 19 22 19]<nl> ... <nl> [30 31 27 ..., 21 14 14]] value[2][...]: [[33 34 32 ..., 19 22 19]<nl> ... <nl> [30 31 27 ..., 21 14 14]] ...