def METHOD_NAME(px, xc, L):
    """ fix periodicity similar to in mpas_vector_operations """
    pfix = ne.evaluate('px - (abs(px-xc) > L/2.0)*((px-xc)/abs(px-xc))*L')
    idx = np.where((px-xc) == 0)
    pfix[idx] = (px*np.ones_like(pfix))[idx]
    return pfix