First make sure the instrument name in the filename matches the "name" attribute of the "instrument" tag in the IDF file.
import mantid2mcvine as m2m
Create a model:
im = m2m.InstrumentModel(
instrument_name, beamline, mantid_idf, mcvine_idf, template_nxs,
detsys_shape, tube_info,
nbanks = nbanks,
ntubesperpack = ntubesperpack,
npixelspertube = npixelspertube,
nmonitors = nmonitors,
tofbinsize = tofbinsize,
)
Convert model. this will
- add mantid IDF to ~/.mantid
- create mcvine xml
- create template nxs used for sim.nxs generation
im.convert()
Convert simulated neutrons to simulated nxs file:
events = im.neutrons2events('scattered-neutrons', nodes=20)
simnxs = im.events2nxs(events, 'sim.nxs')
For more details, see demo