Skip to content

ess-dmsc/generate-nexus-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This may deliver incomplete JSON and is not a maintained repo - up-to-date JSON for instruments can be found at https://gitlab.esss.lu.se/ecdc/nexus-json-templates

Generate NeXus Files

Generate example NeXus files in the proposed format for ESS from existing NeXus files and Mantid IDFs. Uses https://github.com/ess-dmsc/python-nexus-utilities

Tested with Python 3.7, >=3.6 should be fine. You can install dependencies with

pip install -r requirements-base.txt
pip install -r requirements.txt

To display the plots generated by DetectorPlotter you may need to install tk libraries, on Ubuntu for example:

sudo apt install python3-tk

on CentOS (with EPEL installed):

sudo yum install python34-tkinter

Examples

Example scripts can be found in the examples directory. Example scripts should be run from their own directory with the root directory of the repository in PYTHONPATH (IDEs such as PyCharm do this by default).

  • SANS2D_example.py example using a NeXus file and Mantid instrument definition from the SANS2D instrument. This outputs a new NeXus file in the proposed new format and contains examples of using the proposed NXsolid_geometry group to describe pixel shape.

  • WISH_example geometry example using a Mantid IDF for the WISH instrument. This demonstrates conversion from a polar coordinates system and more complex geometry with many (10 panels x 152 tubes x 512 pixels) detector pixels.

  • LOKI_example.py geometry example using a Mantid IDF for the LOKI instrument. It contains an example of using an NXsolid_geometry group to describe the shape of entire detector panels.

  • SANS2D_NXlog_example.py demonstrates how one can use the cue datasets in the new NXevent_data group or in the updated NXlog to extract data for a specific time period from the file.

  • all/ contains all current IDFs from Mantid. Running parse_all.py will attempt to convert all of these to the NeXus format. This is intended to help discover where the parser currently fails.

  • SMALLFAKE_example creates a small (~35 kB) NeXus file for a fake instrument with a few tube detectors.

Other tools

For documentation of nexusutils and the detector plotter and HDF5 size profiling tools see https://github.com/ess-dmsc/python-nexus-utilities

About

Generate example NeXus files as will be created at the ESS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published