Environment Variable Catalog

This is the catalog of the available environment variables that can be used in Sardana.

General Environment Variables

ActiveMntGrp

Mandatory, set by user

Environment variable to define the measurement group that will be used when running a scan.

See also

For further information regarding measurement groups, please read the following document: Measurement Group Overview

PreserveMacroData

Boolean environment variable used to keep in memory the data generated by a macro.

Diffractometer Environment Variables

DiffracDevice

Mandatory, set by user

This environment variable is used to define the name of the diffractometer device. At this moment, this name is supporting only Tango device names and it should be pointing to the Sardana controller of the class HklPseudoMotorCtrl that will be used by the hkl macros.

Psi

Not mandatory, set by user

Environment variable to specify the psi device. This device must be the Tango device server corresponding Sardana PseudoMotor steering the movement of the azimuthal angle.

Q

Mandatory, set by macro wh

This environment variable is set by the macro wh and it correspond to the Q vector.

See also

For a better understanding of the wh macro, please refer to wh

Macro Logging Environment Variables

LogMacro

Not mandatory, set by user

Enable and disable the macro logging via this boolean environment variable.

LogMacroDir

Not mandatory, set by user or to default value: tmp, by macro

Directory where the macro logging file will be save.

LogMacroMode

Not mandatory, set by user or to default value: 0, by macro

With this environment variable it’s possible to specify the number of backup files to be saved.

Todo

Add and example here.

LogMacroFormat

Not mandatory, set by user or to default value by macro

Definition of the format to be used to save the file.

Motion Environment Variables

MotionDecoupled

Not mandatory, set by user

Enable/disable the decoupled motion for continuous scans.

See also

For a deeper understanding of the continuous scans, please refer to the continuous scans documentation

Scan Environment Variables

ApplyExtrapolation

Not mandatory, set by user

Enable/disable the extrapolation method to fill the missing parts of the very first scan records in case the software synchronized acquisition could not follow the pace. Can be used only with the continuous acquisition macros e.g. ct type of continuous scans or timescan. Its value is of boolean type.

Note

The ApplyExtrapolation environment variable has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of this variable) may occur if deemed necessary by the core developers.

ApplyInterpolation

Not mandatory, set by user

Enable/disable the zero order hold a.k.a. “constant interpolation” method to fill the missing parts of the scan records in case the software synchronized acquisition could not follow the pace. Can be used only with the continuous acquisition macros ct type of continuous scans or timescan. Its value is of boolean type.

Note

The ApplyInterpolation environment variable has been included in Sardana on a provisional basis with SEP6. Backwards incompatible changes (up to and including removal of this variable) may occur if deemed necessary by the core developers.

DataCompressionRank

Not mandatory, set by user

Environment variable used to select the data compression rank that will be used to save the data into a file.

The data compression rank is the minimum number of dimensions above which the dataset will be compressed, e.g. 0 for scalars, 1 for spectrums, 2 for images.

The possible values are:

  • -1: No where
  • 0: for all datasets
  • 1: for datasets of rank 1 or more
  • 2: for datasets of rank 2 or more
  • 3: for datasets of rank 3 or more

DirectoryMap

Not mandatory, set by user

In case that the server and the client do not run on the same host, the scan data may be easily shared between them using the NFS. Since some of the tools e.g. showscan rely on the scan data file the DirectoryMap may help in overcoming the shared directory naming issues between the hosts.

Its value is a dictionary with keys pointing to the server side directory and values to the client side directory/ies (string or list of strings).

Todo

Add an example here.

JsonRecorder

Not mandatory, set by user

Enable/disable the JsonRecorder. This recorder is used to retrieve the data generated by a macro during its run time in a json format. An example of usage of this recorder is plotting live scans.

Todo

Add reference to the jsonrecorder documentation when available.

OutputBlock

Not mandatory, set by user

Enable/disable printing the scan output records at the same line instead of appending records as new lines a.k.a. block mode. This can save space of the console output and facilitate an easy visual access to the scan header printed at the beginning of the scan - especially useful for very long scans.

OutputCols

Not mandatory, set by user

Select a subset of the scan output columns to be printed. Two different ways of specifying the selected columns exists. First, by specifying an integer number e.g. 2 means print just the very first two columns. Second, by specifying a list of string identifiers e.g. scan elements URIs or the scan record metadata identifiers: “point_nb”, “timestamp”.

The original order of colums is not changed. This feature is similar to the expconf enable/disable output.

Example:

senv OutputCols "['tango_host:port/expchan/zerodctrl01/1','motor1','timestamp']"

PreScanSnapshot

Not mandatory, set by user

Variable listing the elements that will be collected and saved before a Scan is executed.

The format for the value is the following:

[(taurus model URI, label)]

If the first element in the tuple is a Sardana element, it’s enough to set up the URI up to the Tango device server name. If the element is outside Sardana, i.e. A Tango attribute, you need to add the full URI, up to the attribute name.

Example:

[('tango://sardana/motor/01', 'mot01')]

or

[('tango://device/server/01/attribute','label')]

SampleInfo

Not mandatory, set by user

Extra information about the sample that could be added as a string. This environment variable exist for metadata purposes.

ScanDir

Mandatory if you want scan file to be saved, set by user

Its value is of string type and indicates an absolute path to the directory where scan data will be stored.

ScanFile

Mandatory if you want scan file to be saved, set by user

Its value may be either of type string or of list of strings. In the second case data will be duplicated in multiple files (different file formats may be used). Recorder class is implicitly selected based on the file extension. For example “myexperiment.spec” will by default store data in SPEC compatible format.

ScanRecorder

Not mandatory, set by user

Its value may be either of type string or of list of strings. If ScanRecorder variable is defined, it explicitly indicates which recorder class should be used and for which file defined by ScanFile (based on the order).

Example 1:

ScanFile = myexperiment.spec
ScanRecorder = FIO_FileRecorder

FIO_FileRecorder will write myexperiment.spec file.

Example 2:

ScanFile = myexperiment.spec, myexperiment.h5
ScanRecorder = FIO_FileRecorder

FIO_FileRecorder will write myexperiment.spec file and
NXscan_FileRecorder will write the myexpriment.h5. The selection of the
second recorder is based on the extension.

See also

More about the extension to recorder map in Writing recorders.

SharedMemory

Not mandatory, set by user

Its value is of string type and it indicates which shared memory recorder should be used during the scan e.g. “sps” will use SPSRecorder (sps Python module must be installed on the PC where the MacroServer runs).

See also

For more information about the implementation details of the scan macros in Sardana, see scan framework

SourceInfo

Not mandatory, set by user

Extra information about the source that could be added as a string. This environment variable exist for metadata purposes.