How to read .nxs file (of Scan Angle Neutron Scattering Data)

19 views (last 30 days)
Data of small angle neutron scattering (SANS) at ISIS(UK) or ILL(France) has collected in .nxs file format. where data should be collected as (q_x, q_y, Intensity) format.
I would like to know how to read this type of file. Can anyone help?

Answers (1)

Garrett
Garrett on 17 May 2023
A nxs file is a schema on top of an hdf5 file.
You can use the MATLAB HDF5 commands to read the data sets in the file.
Try the highlevel commands like h5read first.
The nice thing about hdf5 files is you can put all the relevant metadata right in the file. (sample temperature, instrument configuration,etc.) and only read what you want from the file when you want it. However it means you will have to browse the file to find the scattering data you are looking for.
For this browsing, I use something other than MATLAB. hdfview is a tool from the HDF group that works pretty well.

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!