skip to navigation
skip to content

Not Logged In

spec2nexus 2014-02-19

Converts SPEC data files and scans into NeXus HDF5 files

Package Documentation

Latest Version: 2014.0410.0


Converts SPEC data files and scans into NeXus HDF5 files

status:forking from NeXpy prjPySpec branch
author:Pete R. Jemian
copyright:2014, Pete R. Jemian
license:Creative Commons Attribution 4.0 International Public License (see LICENSE.txt)


  • spec2nexus : command-line tool to convert SPEC data files to NeXus HDF5
  • prjPySpec : python binding to read SPEC [1] data files
  • eznx : (Easy NeXus) supports writing NeXus [2] HDF5 [3] files using h5py [4]


Released versions of spec2nexus are available on PyPI. If you have the Python Setup Tools installed, then you can install using either:

$ pip install spec2nexus


$ easy_install spec2nexus

The latest development versions of spec2nexus can be downloaded from the GitHub repository listed above:

$ git clone

To install in the standard Python location:

$ cd spec2nexus
$ python install

To install in user's home directory:

$ python install --user

To install in an alternate location:

$ python install --prefix=/path/to/installation/dir

Required Libraries

Library URL

How to use spec2nexus

See the documentation ( for complete instructions.

simple use

Convert all scans in a SPEC data file:

$ spec2nexus  path/to/file/specfile.dat

Writes path/to/file/specfile.hdf5 (note: will not overwrite if the HDF5 exists, use the -f option to force overwrite).

show installed version

Verify the version of the installed spec2nexus:

$ spec2nexus  -V

Help on usage

$ -h
usage: spec2nexus [-h] [-e HDF5_EXTENSION] [-f] [-V] [-s SCAN_LIST] [-t]
                  [-q | -v]
                  infile [infile ...]

spec2nexus: Convert SPEC data file into a NeXus HDF5 file.

positional arguments:
  infile                SPEC data file name(s)

optional arguments:
  -h, --help            show this help message and exit
  -e HDF5_EXTENSION, --hdf5-extension HDF5_EXTENSION
                        NeXus HDF5 output file extension, default = .hdf5
  -f, --force-overwrite
                        overwrite output file if it exists
  -V, --version         show program's version number and exit
  -s SCAN_LIST, --scan SCAN_LIST
                        specify which scans to save, such as: -s all or -s 1
                        or -s 1,2,3-5 (no spaces!), default = all
  -t, --tree-only       print NeXus/HDF5 node tree (does not save to a file)
  -q, --quiet           suppress all program output (except errors), do not
                        use with -v option
  -v, --verbose         print more program output, do not use with -q option
  • Downloads (All Versions):
  • 38 downloads in the last day
  • 1022 downloads in the last week
  • 3449 downloads in the last month