|
|
|
|||
|
About McXtrace Documentation |
5.5 Data formats - Analyzing and visualizing the simulation resultsTo analyze simulation results, one uses the same tools as for analyzing experimental data, i.e. programs such as Python/NumPy, Matlab, IDL. The output files from simulations are usually simple text files containing headers and data blocks. If data blocks are empty they may be accessed referring to an external file indicated in the header. Each data file contains information about the simulation, the instrument, the parameters used, and of course the signal, the estimated error on the signal, and the number of events used in each bin. Additionally, all data files indicate their first moment (mean value) and second moment (half width) in the ’statistics’ field. The available data formats are the legacy McXtrace (McCode) format, and the HDF/NeXus binary when the needed libraries are installed. In order for the user to choose the data format, we recommend to set it using the
Note that the x-ray event counts in detectors are typically not very meaningful except as a way to measure the performance of the simulation. Use the simulated intensity instead whenever analyzing simulation data. 5.5.1 The McXtrace/McCode text formatThe McXtrace original format, sometimes still referred to by its historical name “PGPLOT format” (the plotting package used in McXtrace 1.x/2.x), is simply columns of ASCII text that most programs should be able to read. One-dimensional histogram monitors (time-of-flight, energy) write one line for each histogram bin. Each line contains a number identifying the bin (i.e. the time-of-flight) followed by three numbers: the simulated intensity, an estimate of the statistical error as explained in section 4.2.1, and the number of x-ray events for this bin. Two-dimensional histogram monitors (position sensitive detectors) output \(M\) lines of \(N\) numbers representing x-ray intensities, where \(M\) and \(N\) are the number of bins in the two dimensions. The two-dimensional monitors also store the error estimates and event counts as additional matrices. Single-point monitors output the x-ray intensity, the estimated error, and the x-ray event
count as numbers on the terminal. (The results from a series of simulations may be combined
in a data file using the When using one- and two-dimensional monitors, the integrated intensities are written to
terminal as for the single-point monitor type, supplementing file output of the full one- or
two-dimensional intensity distribution. Both one- and two-dimensional monitor output by
default start with a header of comment lines, all beginning with the ‘ In addition to the files written for each one- and two-dimensional monitor component,
another file (by default named 5.5.2 NeXus formatThe NeXus format [Nex] is a platform independent HDF binary data file. To have McXtrace use it
All results are saved in a single file, containing ’groups’ of data. To view such files, install and use HDFView (or alternatively HDFExplorer). This Java viewer can show content of all detectors, including metadata (attributes). Basic detector images may also be generated. |
||||
| |||||