Prev Up
Go backward to Simple updates
Go up to Spectrum update commands

Indexed updates


INC|DEC <spectrum-name>(<x-channel> [,<y-channel> [,<z-channel>]])INDEXED <index>

SET <spectrum-name>(<x-channel> [,<y-channel> [,<z-channel>]])INDEXED <index> = <expression>


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. eg.

*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, ie. 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, eg.

INC CE132_($GROUPA=GELIST.E2) INDEXED $GROUPA
where $GROUPX denotes the group number passed in the parameter list $GELIST.
support@ns.ph.liv.ac.uk

Prev Up