Indexed Spectrum update commands

Spectra may be indexed my means of the INDEXED keyword used with the INC or DEC commands where index may be an integer expression, or dollar word used to specify a group number. The value of index determines which spectrum will be incremented, decremented or set: a value of 1 indicates the actual spectrum specified; 2 indicates the subsequent spectrum defined in memory, and so on. Spectra indexed in this way must all have the same dimensions and precision and be defined consecutively in the spectra section.

For example, it is sometimes useful to be able to update a different spectrum for each gate number passed by a gate-map testing command. e.g.

Example

*SPECTRA
    ...
CE132[3:20] 4096
    ...
*COMMANDS
    ...
IF GAM1 GATEDBY GLREC {
    ...
INC CE132(GAM2) INDEXED GATE
    ...

where GATE denotes the gate number passed in the gate-map GLREC by the IF...GATEDBY command.

If GATE is 4 then the 3rd spectrum defined after CE132[3] in the *SPECTRA section, i.e. CE132[6], will be incremented with the value of sortword GAM2.


It is also possible to use this feature to increment a spectrum according to the group number of a word, e.g.

Example

INC CE132(GROUPA=GELIST.E2) INDEXED $GROUPA


where $GROUPA denotes the group number passed in the parameter list GELIST.