2.2. Commands supported by batch SpecTcl

In the previous section we've seen how to incorporate the Batch Spectcl library in a Tcl interpreter. The spectcl package provides most of SpecTcl's commands. Since batch SpecTcl is fully non-interactive, however, it does not make sense to provide all of SpecTcl's commands.

Below is a list of the SpecTcl commands Batch SpecTcl provides. See the SpecTcl command reference for complete documentation of each command.


Allows you to define raw parameters and give them slot numbers in the CEvent object passed to elements of the event processing pipeline.


Provides support for creating computed paramters at the Tcl script level. While these are not very performant in serial SpecTcls, in parallel SpecTcl you can uses as many cores as you need to get the performance up to the file read limit.


Used to define and delete spectra as well as to list the available spectra.


Clears the contents one or more spectra.


Support for getting or setting channel values in a spectrum. We'll see how useful this is in parallel SpecTcl later in this manual.


Writes spectra to file. The result of a batch SpecTcl run is a set of spectra. The swrite command is the means you have to obtain those analysis products after the analysis is run.


Reads spectra from file. This is not as useful in batch SpecTcl but is supported.

sbind, unbind

These are effectively No-ops but are don't flag errors. They are provided in case your setup files include e.g. sbind -all commands.


Allows the creation, modification, deletion and listing of conditions (gates) that can be applied to spectra.


Allows you to apply gates to spectra. When a gate is applied to a spectrum, events can only increment that spectrum if the gate is satisfied by that event.


Removes any condition on the increment of a spectrum.


Provides support for parameters with default ranges and units. Tree parameters are often specified in configuration files.


Provides support for Tcl variables that are easily visible within compiled C code. These variables can also have units of measure. treevariable commands often are part of configuration files.


This command can define folds on gamma spectra. Folds are used in gamma spectroscopy.


provides support to create spectra that are dynamic projections of 2-d spectra.


Provides limited fitting support. Note that including the rootinterface package provides the rootexec command which provides access to root's fitting capabilities and access to SpecTcl's spectra.


Supports integration of a region of interest in a spectrum.


Returns the full SpecTcl version (e.g. 5.2-000).


Produces the contents of the non-zero channels in a spectrum in either Tcl usable or JSON form.


Returns the under and overflow counters for a spectrum. By underflow and overflow, we mean the number times an increment was attempted off the left and right side of the a spectrum respectively.


Provides for dynamic manipulation of the event processing pipeline.


Provides for constructing event processing pipelines that work on event built data.

Additional commands that are specific to batch SpecTcl are also defined. These are described in th enext section.