def cross_chan_coherence(st1, st2, allow_shift=False, shift_len=<NUM_LIT>, i=<NUM_LIT:0>,<EOL>xcorr_func='<STR_LIT>'):
cccoh = <NUM_LIT:0.0><EOL>kchan = <NUM_LIT:0><EOL>array_xcorr = get_array_xcorr(xcorr_func)<EOL>for tr in st1:<EOL><INDENT>tr2 = st2.select(station=tr.stats.station,<EOL>channel=tr.stats.channel)<EOL>if len(tr2) > <NUM_LIT:0> and tr.stats.sampling_rate !=tr2[<NUM_LIT:0>].stats.sampling_rate:<EOL><INDENT>warnings.warn('<STR_LIT>'<EOL>% (tr.stats.station, tr.stats.channel))<EOL><DEDENT>if len(tr2) > <NUM_LIT:0> and allow_shift:<EOL><INDENT>index, corval = xcorr(tr, tr2[<NUM_LIT:0>],<EOL>int(shift_len * tr.stats.sampling_rate))<EOL>cccoh += corval<EOL>kchan += <NUM_LIT:1><EOL><DEDENT>elif len(tr2) > <NUM_LIT:0>:<EOL><INDENT>min_len = min(len(tr.data), len(tr2[<NUM_LIT:0>].data))<EOL>cccoh += array_xcorr(<EOL>np.array([tr.data[<NUM_LIT:0>:min_len]]), tr2[<NUM_LIT:0>].data[<NUM_LIT:0>:min_len],<EOL>[<NUM_LIT:0>])[<NUM_LIT:0>][<NUM_LIT:0>][<NUM_LIT:0>]<EOL>kchan += <NUM_LIT:1><EOL><DEDENT><DEDENT>if kchan:<EOL><INDENT>cccoh /= kchan<EOL>return np.round(cccoh, <NUM_LIT:6>), i<EOL><DEDENT>else:<EOL><INDENT>warnings.warn('<STR_LIT>')<EOL>return <NUM_LIT:0>, i<EOL><DEDENT>
Calculate cross-channel coherency.

Determine the cross-channel coherency between two streams of multichannel
seismic data.

:type st1: obspy.core.stream.Stream
:param st1: Stream one
:type st2: obspy.core.stream.Stream
:param st2: Stream two
:type allow_shift: bool
:param allow_shift:
    Whether to allow the optimum alignment to be found for coherence,
    defaults to `False` for strict coherence
:type shift_len: float
:param shift_len: Seconds to shift, only used if `allow_shift=True`
:type i: int
:param i: index used for parallel async processing, returned unaltered
:type xcorr_func: str, callable
:param xcorr_func:
    The method for performing correlations. Accepts either a string or
     callabe. See :func:`eqcorrscan.utils.correlate.register_array_xcorr`
     for more details

:returns:
    cross channel coherence, float - normalized by number of channels,
    and i, where i is int, as input.
:rtype: tuple