NeXpy Example Files¶
The following files are included in the NeXpy distribution and may be accessed from the Help menu or downloaded from the Github repository.
About these example data files¶
These files are examples of data files that may be read by NeXpy.
2-D NeXus sine wave example
2-D time-of-flight neutron chopper spectrometer
About the example plugin¶
This contains an example of a package,
chopper_plugin that provides a
plugin menu to NeXpy. The entire directory can be copied to another location
to form the template of another plugin, which should be given a unique name.
The package has an example
pyproject.toml file, which defines the name
of the package and an entry point labelled
allows NeXpy to discover the plugin when the package has been installed,
python -m pip install ..
chopper sub-directory could be installed either
locally or within the installed NeXpy package using the
dialog. However, installing the plugin as an external package with an
entry point is now the preferred method for making the plugin discoverable.
In this example, a menu item, ‘Chopper’, is added to the top-level NeXpy
menu, with two sub-menu items designed to operated on
which is included as an example file. When loaded, select the
root in the NeXpy tree before clicking on either menu item.
The requirement for a plugin is that a function
the submenu items in the package’s
__init__.py. These would normally
initiate dialog boxes that are defined within files in the package, although
they could also be imported from an external package.
A simple GUI to calibrate the incident energy by determining the first moments of two monitor peaks and computing the energy from the time difference. The NeXus root must be selected and unlocked so that the calibrated energy can be saved to the NXmonochromator group.
A simple GUI to convert inelastic neutron scattering data in
from angular and time-of-flight coordinates into Q and energy transfer. After
choosing Q and energy bin sizes, the converted data can be plotted and/or
saved as a new NXdata group within the NeXus root.
About these example scripts¶
These files are examples of scripts that can be run from the script editor within NeXpy. If they are copied to ~/.nexpy/scripts, they can be opened directly from the Scripts Menu.
A simple script to create a NeXus tree containing a two-dimensional function of NumPy arrays. A similar example is given in the NeXpy documentation.
A script to plot a sequence of cuts, displaced along the y-axis. It assumes
chopper.nxs, which is one of the example files, has been loaded.