Input file formats
To generate the SQW file from which Horace reads S(Q,w), neutron scattering data for each individual run and needs to be provided in one of two formats: the legacy ASCII format SPE file, together with an ASCII detector parameter file (the PAR file), or their replacements the HDF5 (Hierarchical Data Format) NXSPE file. Two functions are available as part of Horace to create SQW files from these input files, namely
gen_sqw (creates a new SQW file) and
accumulate_sqw (accumulates data to an existing SQW file). The functions to generate SQW files are described in detail here.
SPE file and PAR file
The ASCII format SQW file stores S(w) and associated error bars as a function of energy transfer, ħw, for each detector in turn. In addition to the set of .spe files, Horace requires an accompanying ASCII file which contains information about the location of the detectors in the spectrometer’s reference frame, the PAR file. Although these ASCII format files have largely been superseded in favour of the NXSPE format described below, such files are ubiquitous as the format in which historic data is saved, and are recognised by several other neutron visualisation and analysis programs. Some programs can also write their own output as SPE files, and consequently the SPE file is sometimes used as a transportable format data file for time-of-flight neutron spectrometers. The format of these two files is described here, however, it is not recommended to create new .spe files as this is now an obsolete format.
SPE file format
The SPE file contains the intensity and estimated standard deviation on those intensities for each detector element in turn, with header blocks that give the number of detectors and energy bins, and the scattering angle and energy transfer bin boundaries. These blocks are all separated by character strings that begin with '###'. The format in ful is as follows:
|### Phi Grid|
|### Energy Grid|
PAR file format
The PAR file contains the position information of the detectors and their sizes. The format is:
The width and length of the detector are not actually used by Horace, but dummy values at least need to be present in the file.
The recommended input data file is the NXSPE file, which holds both the S(w) data and errors for each detector and detector position and size information, together with crystal orientation angle