6. Special SQW information from sqw objects and files

sqw or dnd objects in memory are normal MATLAB objects, so they can be converted into structure for analysis. The objects contain complex information including service information, so converting them into structure may return a lot of unnecessary and unclear information. This is why MATLAB normally warns you against applying struct function to an object.

To return full essential information about Horace objects in memory, one may use to_struct method. Majority of Horace objects are serializable objects, which means they may be converted into linear sequence of bytes and reconstruct from this sequence. to_struct method is used for converting object into a structure containing information, sufficient for recovering sqw or dnd object from this information.

Number of additional commands exist for extracting information essential for physical problem or some special purposes.

Note

The commands described here work on object in memory and return information about part of the object, placed in memory. If they applied to a file-backed object or object which would not fit memory, they return different forms of references to the part of the information remained in file.

6.2. xye

Extract the bin centres, intensity and standard errors from an sqw or dnd object.

S = xye(object);

The output is a structure with fields:

  • S.x - vector of bin centres if a 1D object, or cell array of vectors containing the bin centres along each axis if 2D, 3D or 4D object

  • S.y - array of intensities

  • S.e - array of estimated error on the intensities

6.3. save_xye

Save an sqw or dnd object to an ascii format file at the location filename.

save_xye(object, filename);

The format of the ascii file for an n-dimensional dataset is n columns of co-ordinates along each of the axes, plus one column of signal and another column of error (standard deviation).