Symmetrising etc
From Horace
It is now possible (as of January 2010) to do combinational operations on sqw objects, e.g. to combine specified symmetrically equivalent wavevectors such as (-1,0,0) and (1,0,0), for example. The advantage of doing this is that for a given cut or slice you are able to include data from many more detector pixels, thus improving the statistical quality of your data.
Contents |
Commands for cuts and slices
Symmetrising
v1=[0,1,0]; v2=[0,0,1]; v3=[0,0,0]; wout=symmetrise_sqw(win,v1,v2,v3);
The object wout is reflected in the plane specified by the vectors v1, v2, and v3. v1 and v2 are vectors which lie parallel to the plane but are not parallel to one another. v3 specifies the offset from Q=(0,0,0) of the reflection plane. In the above example the plane reflects (-1,0,0) to (1,0,0).
Combining
wout=combine_sqw(win)
Combine two sqw objects (w1 and w2) of the SAME dimensionality into a single sqw object in order to improve statistics. The output object will have a combined value for the integration range e.g. combining two 2d slices taken at L=1 and L=2 will result in an output for which the stated value of L is L=1.5. Two objects which use different projection axes can be combined. The output object will have the projection axes of w1.
Rebinning
Resize the bin boundaries along one or more axes, and rebin the data accordingly. There are several possibilities for the input format:
wout = rebin_sqw(win,step1,step2,...)
Rebin the sqw object win with bins along the first axis that have width step1, bins along the second axis (if there is one) with width step2, and so on. The original limits of the axes will be retained. To leave an axis unaltered, the corresponding step argument can be set to 0.
wout = rebin_sqw(win,[lo1,step1,hi1],[lo2,step2,hi2],...)
As above, but specifying new upper and lower limits along each of the axes to be rebinned.
wout = rebin_sqw(win,w2)
Rebin the sqw object win with the boundaries (and projection axes) of the template object w2.
Commands for entire datasets
It is possible to make a new .sqw data file that has had a specified symmetrisation performed on it for a certain data range. You specify which Brillouin zone you are interested in, and then tell Horace which Brillouin zones are symmetrically equivalent to this one. Data are then cut from all of these zones and combined with the data from your original choice. The result is output to a new file. For example:
wout=combine_equivalent_zones(data_source,proj,pos,qstep,erange,outfile);
where data_source is the master .sqw file, proj is the projection structure array (the same format as that used for cut_sqw), pos is a 3-element vector [h,k,l] specifying the Brillouin zone of interest. qstep is either a single number or a 3-element vector specifying the desired step size along h, k, and l of the 4-dimensional output object wout. erange is a 3-element vector specifying [lo,step,hi] for the energy range to be cut. Finally, outfile is the .sqw filename (including path and .sqw extension) where the symmetrised data will be saved. Note that the output argument wout is optional.
For the basic case detailed above, data from all permutations of pos=[h,k,l] will be included in the output. If you wish to be more restrictive then you can either use:
wout=combine_equivalent_zones(data_source,proj,pos,qstep,erange,outfile,keyword);
or
wout=combine_equivalent_zones(data_source,proj,pos,qstep,erange,outfile,zonelist);
The keywords that can be used are as follows:
-ab-ac-bc-cyclic-cycwithneg
-ab combines all equivalent zones with the same value of L (i.e. (H,K,L), (-H,K,L), (H,-K,L), (-H,-K,L), (K,H,L), (-K,H,L), (K,-H,L), and (-K,-H,L)). -ac combines all equivalent zones with the same K, and -bc combines equivalent zones with the same H.
-cyclic combines all equivalent zones that are cyclic permutations of (H,K,L) with no sign changes, whereas -cycwithneg does include sign changes.
If you wish to specify which zones to combine manually, this can be done by specifying the argument zonelist. This is a cell array, with each element a 3-element vector. For example you might have pos=[1,2,3], and zonelist={[1,2,3],[3,2,1],[2,3,1],[2,1,3],[3,1,2]}.
Limitations
- At present
symmetrise_sqw,combine_sqw, andrebin_sqwwork ONLY for sqw objects, since they require access to individual detector pixel information. The functions will work for any dimensionality of object, however.
combine_equivalent_zoneshas to perform some very memory intensive calculations, which realistically mean that it is not possible to run it on a normal desktop computer. This means you must either have access to a machine of your own with large memory resources, or use either the Mordred or Melehan Linux machines at ISIS.