mantidproject / mantid

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

Muon v2 data reader missing comment #34908

Closed AnthonyLim23 closed 1 year ago

AnthonyLim23 commented 1 year ago

From Steve.

While updating our v2 data definition document I happened to notice that the run comment isn't displayed when loading a v2 file - see pictures below. The text needed seems to be present just fine in the v2 file at 'raw_data_1/notes'.

Loading a 'v1' file ... note that text follows 'Comment': image

Loading a 'v2' file ... note lack of text following 'Comment': image

AnthonyLim23 commented 1 year ago

I have had a look at the code:

  1. The comment in the version 1 is set here https://github.com/mantidproject/mantid/blob/main/Framework/DataHandling/src/LoadMuonNexus1.cpp#L215
  2. The notes field is available to all instruments at ISIS. However, a. It will probably be blank b. Old files may not have it so I think we should do something here (similar to the title): https://github.com/mantidproject/mantid/blob/main/Framework/DataHandling/src/LoadISISNexus2.cpp#L758
AnthonyLim23 commented 1 year ago
files = ['EMU115363.nxs_v2', 'POLREF00004699.nxs', 'IRIS56944.nxs']

for file in files:
    ws = LoadISISNexus(file)
    if "POL" in file:
        # returns a group
        ws = ws[0]
    print("file: ", file)
    print("comment: ", ws.getComment())
    print()