NICOS supports the concept of different instrument setups. Not all devices that can be used at an instrument will be present all the time, so they need not be loaded.
A specific set of devices (and commands, which supports the notion of specialized commands) is collected in a “setup file”, a Python module in the subdirectory setups of the site-specific NICOS root directory.
A setup file can consist of the following entries, all of which are optional:
A device definition consists of a call like device(classname, parameters). The class name is fully qualified (i.e., includes the package/module name). See the class documentation for the existing device classes. The parameters are given as keyword arguments. Here are some example devices entries:
devices = dict(
p = device('nicos.taco.AnalogInput',
tacodevice = 'mira/ccr/pressure',
unit = 'bar'),
mth_motor = device('nicos.taco.Motor',
tacodevice = 'mira/motor/mth',
lowlevel = True,
unit = 'deg'),
mth_coder = device('nicos.taco.Coder',
tacodevice = 'mira/coder/mth',
lowlevel = True,
unit = 'deg'),
mth = device('nicos.generic.Axis',
motor = 'mth_motor',
coder = 'mth_coder',
abslimits = (0, 100),
userlimits = (0, 50)),
)
For example, an instrument with varying sample environment could have two setup files, cryostat and oven, where both include a base file that could contain the monochromator, sample table and detector that always stay the same.
On startup, an empty setup is initialized by NICOS. The user then loads a setup using the NewSetup('modulename') command. Each time the NewSetup command is used, the previous setup is unloaded and the created devices are destroyed. When more setups need to be loaded at the same time, the AddSetup('modulename') command can be used.
The possible entries for the sysconfig dictionary are:
A string giving the hostname of the cache server (or hostname:port, if the cache runs on a port other than 14869). If this is omitted, no caching will be available.
See also caching.
The name of the instrument device, defined somewhere in a devices dictionary. The class for this device must be nicos.instrument.Instrument or an instrument-specific subclass.
See principles.
The name of the experiment “device”, defined somewhere in a devices dictionary. The class for this device must be nicos.experiment.Experiment or an instrument-specific subclass.
See principles.
A list of names of “data sinks”, i.e. special devices that process measured data. These devices must be defined somewhere in a devices dictionary and be of class nicos.data.DataSink or a subclass.
See also datahandling.
A list of names of “notifiers”, i.e. special devices that can notify the user or instrument responsibles via various channels (e.g. email). These devices must be defined somewhere in a devices dictionary and be of class nicos.notify.Notifier or a subclass.
See also advanced.