def is_tdc_from_channel(channel=<NUM_LIT:4>):  
if channel >= <NUM_LIT:1> and channel < <NUM_LIT:8>:<EOL><INDENT>def f(value):<EOL><INDENT>return np.equal(np.right_shift(np.bitwise_and(value, <NUM_LIT>), <NUM_LIT>), channel)<EOL><DEDENT>f.__name__ = "<STR_LIT>" + str(channel)  <EOL>return f<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>
Selecting TDC data from given channel.

    Parameters
    ----------
    channel : int
        Channel number (4 is default channel on Single Chip Card).

    Returns
    -------
    Function.

    Usage:
    1 Selecting TDC data from channel 4 (combine with is_tdc_word):
        filter_tdc_data_from_channel_4 = logical_and(is_tdc_word, is_tdc_from_channel(4))
        tdc_data_from_channel_4 = data_array[filter_tdc_data_from_channel_4(data_array)]