def read_gwf(filename, channels, start=None, end=None, scaled=None,<EOL>ctype=None, series_class=TimeSeries):
<EOL>if not start:<EOL><INDENT>start = <NUM_LIT:0><EOL><DEDENT>if not end:<EOL><INDENT>end = <NUM_LIT:0><EOL><DEDENT>span = Segment(start, end)<EOL>stream = io_gwf.open_gwf(filename, '<STR_LIT:r>')<EOL>nframes = stream.GetNumberOfFrames()<EOL>out = series_class.DictClass()<EOL>i = <NUM_LIT:0><EOL>while True:<EOL><INDENT>this = i<EOL>i += <NUM_LIT:1><EOL>try:<EOL><INDENT>frame = stream.ReadFrameNSubset(this, <NUM_LIT:0>)<EOL><DEDENT>except IndexError:<EOL><INDENT>if this >= nframes:<EOL><INDENT>break<EOL><DEDENT>raise<EOL><DEDENT>if not _need_frame(frame, start, end):<EOL><INDENT>continue<EOL><DEDENT>epoch = LIGOTimeGPS(*frame.GetGTime())<EOL>for channel in channels:<EOL><INDENT>_scaled = _dynamic_scaled(scaled, channel)<EOL>try:<EOL><INDENT>new = _read_channel(stream, this, str(channel),<EOL>ctype.get(channel, None),<EOL>epoch, start, end, scaled=_scaled,<EOL>series_class=series_class)<EOL><DEDENT>except _Skip:  <EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>out[channel].append(new)<EOL><DEDENT>except KeyError:<EOL><INDENT>out[channel] = numpy.require(new, requirements=['<STR_LIT:O>'])<EOL><DEDENT><DEDENT>if all(span in out[channel].span for channel in out):<EOL><INDENT>break<EOL><DEDENT><DEDENT>for channel in channels:<EOL><INDENT>if channel not in out:<EOL><INDENT>msg = "<STR_LIT>".format(<EOL>str(channel), filename)<EOL>if start or end:<EOL><INDENT>msg += '<STR_LIT>'.format(span)<EOL><DEDENT>raise ValueError(msg)<EOL><DEDENT><DEDENT>return out<EOL>
Read a dict of series data from a single GWF file

    Parameters
    ----------
    filename : `str`
        the GWF path from which to read

    channels : `~gwpy.detector.ChannelList`, `list`
        a list of channels to read from the source.

    start : `~gwpy.time.LIGOTimeGPS`, `float`, `str` optional
        GPS start time of required data, anything parseable by
        :func:`~gwpy.time.to_gps` is fine.

    end : `~gwpy.time.LIGOTimeGPS`, `float`, `str`, optional
        GPS end time of required data, anything parseable by
        :func:`~gwpy.time.to_gps` is fine.

    scaled : `bool`, optional
        apply slope and bias calibration to ADC data.

    type : `dict`, optional
        a `dict` of ``(name, channel-type)`` pairs, where ``channel-type``
        can be one of ``'adc'``, ``'proc'``, or ``'sim'``.

    series_class : `type`, optional
        the `Series` sub-type to return.

    Returns
    -------
    data : `~gwpy.timeseries.TimeSeriesDict` or similar
        a dict of ``(channel, series)`` pairs read from the GWF file.