Changing Horace settings

From Horace
Jump to: navigation, search

It is possible to alter the default settings of Horace, depending on your personal preferences and/or computer specifications.


This is a set of basic configurations for Horace. In order to find out the current (default) settings, type

>> get(hor_config)

This will give the following information:

mem_chunk_size: 3000000
pixel_length: 9
threads: 1
ignore_nan: 1
ignore_inf: 0
horace_info_level: 1
use_mex: 1
delete_tmp: 1
fields_sealed: {'fields_sealed'  'pixel_length'}
config: [1x1 config]

To change one of the settings, type, for example;



  hc = hor_config;
  hc.mem_chunk_size = 500000;

Below are detailed the meanings of the various options.

mem_chunk_size refers to the number of pixels that are read into memory at a time when cutting data from a file. If your system is low on memory, it may be worth reducing this number. If you have a large amount of memory it is not, however, necessarily worth increasing this value much beyond the default setting of 3000000, as it does not result in much of a speed up when cutting.

pixel_length can be used to alter the number of fields in the pix arrays of sqw objects. This should only be altered if you have a REALLY good reason to do so...

thread is the number of computational threads that can be used. If you have a multi-core machine you can increase this number to make better use of all / more of your cores.

ignore_nan means that any NaNs (not-a-numbers) are ignored (if 1) wherever they occur in Horace.

ignore_inf means that infinities are (or not) ignored depending on whether this value is set to 1 or 0.

transformSPE2HDF is a setting that, if set to 1, converts any spe file addressed during the creation of an sqw file into an hdf file (which will be much smaller in size on disk than an spe file). However note that the original spe file is not deleted.

horace_info_level is a scalar. The larger it is, the more information Horace prints to the Matlab command window during operations. If it is set to -Inf then no information is printed to screen.

use_mex can be set to either 0 or 1. If 1, then the mex (i.e. C or Fortran) routines are preferentially used for e.g. cut. Generally these should be used, as they are faster than the Matlab alternatives. However you can, if you wish, choose not to use the mex files and use the Matlab equivalents instead.

delete_tmp is set to either 0 or 1, depending on whether you wish tmp files to be deleted after the creation of an sqw file. If set to 0, the tmp files are not deleted. Generally this should be set to 1, except if you are using accumulate_sqw.

The final two options should NOT be altered.

use_hdf is either 1 or 0, depending on whether you wish to force Horace to use hdf.

hdf_fail_on_new is a switch to determine what happens if an empty hdf file is encountered. If 1 then an error message will be given, whereas if 0 then the the program will attempt to continue.

hdf_restricted is either 1 or 0, depending on whether you wish to use a restricted set of hdf tools. Generally this should be set to 1 if you are using a version of Matlab earlier than 2009a.

hdf_compression is a number in the range 0 to 9, describing the level of compression in hdf files written, with 0 being none, and 9 being the maximum. Note that you cannot turn it up to 11.