channel -- Access spectrum channels


channel -get spname indices

channel -set spname indices value


Allows you to set or get the values of channels in a spectrum.



The channnel command will retrieve the contents of the channel of spname specified by the channel indices indices/ The indices are raw channel parameters. For a two dimensional spectrum, this must be a list of, in order, x and y channel numbers.

The result of the command is the channel value.


The channel command will set the value of the channel in spname specified by the raw channel indices indices to the new value value. As with -get, for a 2-d spectrum, the indices parameter must be a list of x and y channel numbers.


Example 1. Getting the value of a channel in a 1-d spectrum

channel -set TwodSpectrum {123 456} 100

Example 2. Clearing a spectrum using channel

for {set i 0 } { $i < 128 } {incr i } {
   for {set j 0} {$j < 128 } {incr j } {}
      channel -set TwodSpectrum [list $i $j] 0]

Normally use the clear command instead of this method.