Returns geometry shifted to center of mass.

    Helper function to automate / encapsulate translation of a geometry to its
    center of mass.

    Parameters
    ----------
    geom
        length-3N |npfloat_| --
        Original coordinates of the atoms

    masses
        length-N OR length-3N |npfloat_| --
        Atomic masses of the atoms. Length-3N option is to allow calculation of
        a per-coordinate perturbed value.

    Returns
    -------
    ctr_geom
        length-3N |npfloat_| --
        Atomic coordinates after shift to center of mass

    Raises
    ------
    ~exceptions.ValueError
        If shapes of `geom` & `masses` are inconsistent

def ctr_geom(geom, masses):
    """ Returns geometry shifted to center of mass.

    Helper function to automate / encapsulate translation of a geometry to its
    center of mass.

    Parameters
    ----------
    geom
        length-3N |npfloat_| --
        Original coordinates of the atoms

    masses
        length-N OR length-3N |npfloat_| --
        Atomic masses of the atoms. Length-3N option is to allow calculation of
        a per-coordinate perturbed value.

    Returns
    -------
    ctr_geom
        length-3N |npfloat_| --
        Atomic coordinates after shift to center of mass

    Raises
    ------
    ~exceptions.ValueError
        If shapes of `geom` & `masses` are inconsistent

    """

    # Imports
    import numpy as np

    # Calculate the shift vector. Possible bad shape of geom or masses is
    #  addressed internally by the ctr_mass call.
    shift = np.tile(ctr_mass(geom, masses), geom.shape[0] / 3)

    # Shift the geometry and return
    ctr_geom = geom - shift
    return ctr_geom