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.

parameter

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

psuedo

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.

spectrum

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

clear

Clears the contents one or more spectra.

channel

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

swrite

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.

sread

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.

gate

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

apply

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.

ungate

Removes any condition on the increment of a spectrum.

treeparameter

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

treevariable

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.

fold

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

project

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

fit

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.

integrate

Supports integration of a region of interest in a spectrum.

version

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

scontents

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

specstats

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.

pipeline

Provides for dynamic manipulation of the event processing pipeline.

evbunpack

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.