def cross_net(stream, env=False, debug=<NUM_LIT:0>, master=False):
event = Event()<EOL>event.origins.append(Origin())<EOL>event.creation_info = CreationInfo(author='<STR_LIT>',<EOL>creation_time=UTCDateTime())<EOL>event.comments.append(Comment(text='<STR_LIT>'))<EOL>samp_rate = stream[<NUM_LIT:0>].stats.sampling_rate<EOL>if not env:<EOL><INDENT>if debug > <NUM_LIT:2>:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>st = stream.copy()<EOL>st.resample(samp_rate)<EOL><DEDENT>else:<EOL><INDENT>st = stream.copy()<EOL>if debug > <NUM_LIT:2>:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>for tr in st:<EOL><INDENT>tr.resample(samp_rate)<EOL>tr.data = envelope(tr.data)<EOL><DEDENT><DEDENT>if not master:<EOL><INDENT>master = st[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>master = master<EOL><DEDENT>master.data = np.nan_to_num(master.data)<EOL>for i, tr in enumerate(st):<EOL><INDENT>tr.data = np.nan_to_num(tr.data)<EOL>if debug > <NUM_LIT:2>:<EOL><INDENT>msg = '<STR_LIT:U+0020>'.join(['<STR_LIT>', tr.stats.station, tr.stats.channel,<EOL>'<STR_LIT>'])<EOL>print(msg)<EOL><DEDENT>shift_len = int(<NUM_LIT> * len(tr))<EOL>if debug > <NUM_LIT:2>:<EOL><INDENT>print('<STR_LIT>' + str(shift_len) + '<STR_LIT>')<EOL><DEDENT>index, cc = xcorr(master, tr, shift_len)<EOL>wav_id = WaveformStreamID(station_code=tr.stats.station,<EOL>channel_code=tr.stats.channel,<EOL>network_code=tr.stats.network)<EOL>event.picks.append(Pick(time=tr.stats.starttime +<EOL>(index / tr.stats.sampling_rate),<EOL>waveform_id=wav_id,<EOL>phase_hint='<STR_LIT:S>',<EOL>onset='<STR_LIT>'))<EOL>if debug > <NUM_LIT:2>:<EOL><INDENT>print(event.picks[i])<EOL><DEDENT><DEDENT>event.origins[<NUM_LIT:0>].time = min([pick.time for pick in event.picks]) - <NUM_LIT:1><EOL>del st<EOL>return event<EOL>
Generate picks using a simple envelope cross-correlation.

Picks are made for each channel based on optimal moveout defined by
maximum cross-correlation with master trace.  Master trace will be the
first trace in the stream if not set.  Requires good inter-station
coherance.

:type stream: obspy.core.stream.Stream
:param stream: Stream to pick
:type env: bool
:param env: To compute cross-correlations on the envelope or not.
:type debug: int
:param debug: Debug level from 0-5
:type master: obspy.core.trace.Trace
:param master:
    Trace to use as master, if False, will use the first trace in stream.

:returns: :class:`obspy.core.event.event.Event`

.. rubric:: Example

>>> from obspy import read
>>> from eqcorrscan.utils.picker import cross_net
>>> st = read()
>>> event = cross_net(st, env=True)
>>> print(event.creation_info.author)
EQcorrscan

.. warning::
    This routine is not designed for accurate picking, rather it can be
    used for a first-pass at picks to obtain simple locations. Based on
    the waveform-envelope cross-correlation method.