Skip to content

aaronfinke/stream_sampling_mcstas

Repository files navigation

McStas Stream Sampling to Nexus

Uses the StreamSampling.jl package to do weighted event sampling from McStas event data in NeXus format, and generate a NeXus TOFRaw event file.

Calling the StreamSampling Julia algorithm directly from Python (using juliacall) is about 30x faster than implementing a similar algorithm in Python.

Also included: a dockerfile to generate a container that has all the needed packages.

Requirements

  • Julia installation and JuliaCall
    • Required Julia packages: StreamSampling, ChunkSplitters, Random, HDF5
    • After installing Julia, you can install them on the command line like so: julia -e 'using Pkg; Pkg.add(["StreamSampling", "ChunkSplitters", "Random", "HDF5"])'
  • h5py, numpy, matplotlib
  • a json file describing metadata to save into the NeXus file
  • McStas event file in NeXus format

About

Use StreamSampling.jl to sample McStas NeXus event files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •