Data arrays

Three types of arrays may be defined to store data for subsequent access in the commands section. Value arrays may be used to store integer or real data. Gate arrays store pairs of integer values to define arrays of gates. Gain arrays store the gain parameters associated with particular sortwords.

Value and 1D gate arrays both allow a lookup facility dependent on another parameter, e.g. group number.

Value arrays

VALUEARRAY defines a 1D, 2D or 3D array of 32-bit integer or real values that can be accessed in the commands section.

If no starting channel is given it is assumed to be zero and the maximum channel will be (x-range - 1) as before. If the SAVE keyword is specified, then the array is written back to disc at the end of the sort, allowing modified arrays to be preserved. This discfile will normally be in the sort setup directory created when a sortfile is compiled. The data-list is allowed in free format.

Note

The array data type (integer or float) is determined from the type of the first data element specified in data-list.

The values specified in data-list are given in C-style ordering: the z-parameter changes more quickly than y- which changes more quickly than x-. This is the opposite way round to the convention used in FORTRAN.

Example

VALUEARRAY   ANGLES   [1:20]
157.60 157.60 157.60 157.60 157.60
133.57   0    107.94   0    107.94
133.57  94.16 133.57 107.94  94.16
107.94 133.57   0    133.57 107.94
defines a real 1D array ANGLES containing 20 elements.

Example

VALUEARRAY   ARRAY2  [2:6,3]  1 11 21  2 12 22  3 13 23  4 14 24  5 15 25

defines an integer 2D array ARRAY2 spanning from channels 2 to 6 in the first dimension (5 channels) and from channels 0 to 2 in the second. The values will be assigned as follows:

(2,0),(2,1),(2,2),(3,0),(3,1),(3,2),(4,0),(4,1),(4,2)... etc.


An example of their use in the commands section would be:

Example

A = B / ANGLES(argument)
C = ARRAY2( argument1, argument2)

where argument is an integer expression. See Arithmetic Expressions.


Any array elements not initialised by VALUEARRAY are set to zero.

Gate arrays

A gate-array contains the definition of a 1D array of pairs of channel numbers and the corresponding array element number. Data is allowed in free format specified in order of increasing array element number in the range 0 to 255 where array elements may be omitted from the sequence. Each pair of channel numbers defines a gate.

Gate-arrays may be defined here and used in the commands section to filter all group format data of the same type through different 1D gates. See commands IF...PASSES and LOOPIF...PASSES.

Example

GATEARRAY TACGATES
1 (100 4000)   2 (95 4000)  6 (100 3950) ...  40 (85 4000)  45 (100 4000)

would define the gate array TACGATES. This array could then be accessed in the commands section to filter each germanium TAC word with parameters dependent on the group number.


Gain arrays

Sets of gain matching parameters may be specified in this section by means of a GAINWORD or GAINARRAY statement and referenced in the commands section via the GAIN command.

GAINWORD is designed for use with single variables and GAINARRAY is used with group-format variables, allowing the same item name associated with all groups of the same type to be gain-matched by a single command line in the commands section,

GAINARRAY data is allowed in free format with array element number in the range 0 to 255.

Example

*FORMATS
GAINWORD GE_19  0.3 -0.05  0.00     // single variable parameters
GAINWORD GE_29  0.6  0.02  0.00

GAINARRAY E2GAINS                    // group format
1  (-0.2  0.10  0.00)
3  (0.7 -0.03  0.00)
...
70 (-0.1  0.05  0.00)

Each statement stores a set of gain-matching parameters associated with a particular sortword.

The value of sortword may then be modified in the commands section using the GAIN command according to the equation:

sortword = a + b* sortword + c* sortword2

Arrays of arrays

A set of arrays of the same type (valuearray, gatearray or gainarray) may be defined. This is currently implemented for gainarrays and gatemaps in commands if...gatedby and loopif...gatedby.

The arraylist defines an array starting at element zero.