def _convert_block_indexers_to_array_indexers(block_indexers, chunks):
    """Convert a dict of dask block indexers to array indexers.

    Parameters
    ----------
    block_indexers : dict
        Dictionary mapping dimension names to slices.  The slices
        represent slices in dask block space.
    chunks : dict
        Dictionary mapping dimension names to tuples representing
        the chunk structure of the given dimension.

    Returns
    -------
    dict
    """
    array_indexers = {}
    for dim, block_indexer in block_indexers.items():
        if block_indexer.start is None:
            start = 0
        else:
            start = sum(chunks[dim][: block_indexer.start])
        stop = sum(chunks[dim][: block_indexer.stop])
        array_indexers[dim] = slice(start, stop)
    return array_indexers