mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
210 stars 122 forks source link

Include additional information in reduced NeXus format #35098

Closed rbauststfc closed 10 months ago

rbauststfc commented 1 year ago

Requested by Max at ISIS.

At the moment not all of the metadata included in the original raw/NeXus file is added to the processed/post-reduction NeXus file. Max is keen for us to investigate how to change the reduced NeXus file to include this additional information. This is expected to help with retrieving data automatically for writing .ort files (see #31073).

It's been noticed that all you have to do to lose data is load and then save out a file. This could have overlap with (or could even be the same behaviour as) #35507.

rbauststfc commented 1 year ago

These are the things I found when looking into this:

Some technical notes:

  NXClass user = entry.openNXGroup("user_1");
  NXChar user_name = user.openNXChar("name");
  user_name.load();
  std::string user_name_str = std::string(user_name(), user_name.size());
  run.addProperty("user_name", user_name_str);
rbauststfc commented 10 months ago

Closing as the investigation is now complete and issue #36399 has been opened for the follow-up to this.