def _convert_to_array(stream):
    ' Extracts trace data from an obspy stream and returns a 2D array.\n\n    Parameters\n    ----------\n    stream: Obspy stream object\n        Stream storing trace data\n\n    Returns\n    -------\n    output: ndarray, ndim=2\n        Returns an (nt*nr) array. nt and nr are the number of sample points\n        and number of traces respectively. Assumes trace lengths are equal\n        for all traces.\n\n    Raises\n    ------\n    TypeError\n        If stream is not an obspy stream\n    '
    if (not isinstance(stream, Stream)):
        raise TypeError('Input object should be an obspy stream.')
    nt = len(stream.traces[0].data)
    nr = len(stream)
    output = np.zeros((nt, nr))
    for (i, trace) in enumerate(stream):
        output[:, i] = trace.data[:]
    return output
Extracts trace data from an obspy stream and returns a 2D array.

Parameters
----------
stream: Obspy stream object
    Stream storing trace data

Returns
-------
output: ndarray, ndim=2
    Returns an (nt*nr) array. nt and nr are the number of sample points
    and number of traces respectively. Assumes trace lengths are equal
    for all traces.

Raises
------
TypeError
    If stream is not an obspy stream
def _convert_to_array(stream):
    ' Extracts trace data from an obspy stream and returns a 2D array.\n\n    Parameters\n    ----------\n    stream: Obspy stream object\n        Stream storing trace data\n\n    Returns\n    -------\n    output: ndarray, ndim=2\n        Returns an (nt*nr) array. nt and nr are the number of sample points\n        and number of traces respectively. Assumes trace lengths are equal\n        for all traces.\n\n    Raises\n    ------\n    TypeError\n        If stream is not an obspy stream\n    '
    if (not isinstance(stream, Stream)):
        raise TypeError('Input object should be an obspy stream.')
    nt = len(stream.traces[0].data)
    nr = len(stream)
    output = np.zeros((nt, nr))
    for (i, trace) in enumerate(stream):
        output[:, i] = trace.data[:]
    return output