def read_hdf5_segmentlist(h5f, path=None, gpstype=LIGOTimeGPS, **kwargs):
    """Read a `SegmentList` object from an HDF5 file or group.
    """
    # find dataset
    dataset = io_hdf5.find_dataset(h5f, path=path)

    segtable = Table.read(dataset, format='hdf5', **kwargs)
    out = SegmentList()
    for row in segtable:
        start = LIGOTimeGPS(int(row['start_time']), int(row['start_time_ns']))
        end = LIGOTimeGPS(int(row['end_time']), int(row['end_time_ns']))
        if gpstype is LIGOTimeGPS:
            out.append(Segment(start, end))
        else:
            out.append(Segment(gpstype(start), gpstype(end)))
    return out
def read_hdf5_segmentlist ( h5f , path = None , gpstype = LIGOTimeGPS , ** kwargs ) : dataset = io_hdf5 . find_dataset ( h5f , path = path ) segtable = Table . read ( dataset , format = 'hdf5' , ** kwargs ) out = SegmentList ( ) for row in segtable : start = LIGOTimeGPS ( int ( row [ 'start_time' ] ) , int ( row [ 'start_time_ns' ] ) ) end = LIGOTimeGPS ( int ( row [ 'end_time' ] ) , int ( row [ 'end_time_ns' ] ) ) if gpstype is LIGOTimeGPS : out . append ( Segment ( start , end ) ) else : out . append ( Segment ( gpstype ( start ) , gpstype ( end ) ) ) return out
Read a `SegmentList` object from an HDF5 file or group.