scipp / essnmx

Data reduction for NMX at the European Spallation Source
https://scipp.github.io/essnmx/
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Geometric information parsing (McStas loader mainly) #10

Closed YooSunYoung closed 10 months ago

YooSunYoung commented 10 months ago

NMX data loader should be able to retrieve...

In the McStas simulation file, there is a h5 group instrument/instrument_xml/ that contains geometry information of the instruments. McStas loader should be able to parse the xml information to retrieve the information above.

TODO:

YooSunYoung commented 10 months ago

This is the script to load it with mantid and see the instrument view. It takes at least 5 minutes on my machine to load 7 gigabytes of data... maybe we need to have smaller sample.

import scippneutron as snc
from mantid.simpleapi import Load
data = Load("../../../data/nmx/pulse5_z.h5")
dg = snc.from_mantid(data)
snc.instrument_view(dg...)

The smaller sample I made for testing only has event data at the moment. Does anyone know the best(easiest) way to retrieve part of event data in a nexus file but keep the rest the same...?

SimonHeybrock commented 10 months ago

It takes at least 5 minutes on my machine to load 7 gigabytes of data... maybe we need to have smaller sample.

Is this an old file with the tiny "broken" chunk size that McStas was using until quite recently? Or is it only a problem with Mantid?

SimonHeybrock commented 10 months ago

Does anyone know the best(easiest) way to retrieve part of event data in a nexus file but keep the rest the same...?

With Mantid, for a McStas file? Not possible, as far as I know.

YooSunYoung commented 10 months ago

Is this an old file with the tiny "broken" chunk size that McStas was using until quite recently? Or is it only a problem with Mantid?

I'm not familiar to that broken chunk issue. Will it also take a while to load with scipp in this case...? It takes only 3 seconds with scipp.

Does anyone know the best(easiest) way to retrieve part of event data in a nexus file but keep the rest the same...?

With Mantid, for a McStas file? Not possible, as far as I know.

What a shame... Last time I tried to copy everything with smaller number of event data, it complained while loading so I thought there were some fields that should have consistent length or dimensions. I'll try again if needed... for now I'll not try to use the mantid with NMX files.