def _global2local_offsets(global_offsets):
    """
    Given existing global offsets, return a copy with offsets localized to each process.

    Parameters
    ----------
    global_offsets : dict
        Arrays of global offsets keyed by vec_name and deriv direction.

    Returns
    -------
    dict
        Arrays of local offsets keyed by vec_name and deriv direction.
    """
    offsets = {}
    for type_ in global_offsets:
        goff = global_offsets[type_]
        offsets[type_] = goff.copy()
        if goff[0].size > 0:
            # adjust offsets to be local in each process
            offsets[type_] -= goff[:, 0].reshape((goff.shape[0], 1))

    return offsets