def getTable(grid, volumes, headers):
    """
    convert grid to a table (array of arrays)
    """
    table = []
    for volume in volumes:
        # only include a row if it has some data
        gridrow = grid.get(volume)
        if gridrow:
            row = [gridrow.get(header) for header in headers]
            table.append(row)
    return table