def update_chunk_id_maps(chunk_id_maps, cont_id_map):
    """
    Creates a new chunkwise id map as if cont_id_map is applied after each
    chunk id map
    """

    for mapping in chunk_id_maps.flat:
        for (k, v) in mapping.items():
            mapping[k] = cont_id_map.get(v, v)

    return chunk_id_maps