SPEC allows one to add user-defined data columns to the scan files. It is done by redefine the SPEC standard macros Fheader, Flabel and Fout. In Fheader,you tell that how many extra columns are added. In Flabel, the name of each new column are given. In Fout, the cmd to retrieve each column and the output format in the data file. The uspec_column package attempts to provide a relative easy way to redefine the Fheader, Flabel and Fout macros. This is based UNI_CAT's macro by Pete Jemian.

It includes four functions to meet the needs:


to add a new user defined column

/* tag -- a string, the name of the new column

fmt -- a string, output format of the data used by the sprintf() function

cmd -- a string, command to get the data

key -- a string, identifier to group the data columns. You can have several columns grouped under this key, and remove them together while keep other columns.



to remove one column

/* tag -- a string key -- a string


u_column_remove(key): to remove columns under the key identifier

/* key -- a string : if key is "all", then all user-defined columns are deleted.



to show all user defined columns


Here are some examples:

- to add the sample temperature from the epics based Lakeshore controller:


- to add the rois of a MCA into scan data



- to display the user defined columns


Columns defined as pieces of identifier:mca

roi2 : epics_get("xxx:mca.R02") : %.8g

roi1 : epics_get("xxx:mca.R01") : %.8g

Columns defined as pieces of identifier:temp

TempSample : epics_get("xxx:LS331:TC1:SampleA") : %.8g

- to remove the roi1 column


- to remove all columns under "mca" key


- to clear all user columns