reflectivity / file_format

2 stars 4 forks source link

Added some Nexus files from INTER@ISIS #8

Closed maxskoda closed 3 years ago

maxskoda commented 3 years ago

Hi, I've added two files for now: INTER_61440_IvsQ_binned.nxs, which is a reduced file save as Nexus by Mantid; INTER_61440_TOF_MantidSave.nxs, which is a hisogrammed file derived from an INTER event mode Nexus file, again saved as Nexus by Mantid.

andyfaff commented 3 years ago

Could you rename nexus_fromats to nexus_formats?

I had a look through the binned dataset file. Is there any resolution information in there?

maxskoda commented 3 years ago

Hi Andrew,

Sorry about the folder name - it is corrected now. Regarding resolution, there are two problems:

  1. We do not currently calculate the resolution, beyond using the instrumental resolution, which is assumed to be constant dq/q based solely on collimation (i.e. delta theta). Part of the reason is that Mantid does not really have a good means for q error propagation...
  2. In fact all the processing information is stored in the workspace history in terms of Mantid algorithms called, including all parameters. Unfortunately it is deeply buried in there. If you have a look at the Nexus tree, you will find in 'mantid_workspace_1.process.MantidAlgorithm_1.data' an entry referring to 'MomentumTransferStep', which is the binning used. Typically we do not use the processed Nexus files, except when a Mantid project is saved. Instead we output an ASCII file in the desired format (3 column, ILL Cosmos, MotoFit etc.). Years ago I looked a the most used formats and implemented those into our reduction.

As a note, not sure if you are using it, but there is a python module to read nexus files (not just HDF5), called 'NexPy' (https://nexpy.github.io/nexpy/index.html, it also provides a GUI).

So with >>from nexusformat.nexus import nxload >>f = nxload('NTER_61440_IvsQ_binned.nxs') >>print(f.mantid_workspace_1.process.MantidAlgorithm_1.data)

you will see the listing of the workflow algorithm.

I think this is certainly something we can ask to be changed in Mantid, ie. to have our own 'Save_NR_Processed_Nexus' algorithm. Perhaps we should discuss this..

Cheers,

Max