def cart2fracImg(lattice, cartesian_coords):
    """
    Convert cartesian coordinates to fracitonal coordiantes (using Pymatgen
    Lattice object) and then wrap into unit cell and return image.

    Args
    ----
    lattice: Pymatgen.core.Lattice
        Pymatgen Lattice object.

    cartesian_coords: np.ndarray
        Cartesian coords to convert to fractional coords and image flags.
    """

    # Get fractional coordiates.
    f = lattice.get_fractional_coords(cartesian_coords)

    # Wrap coordinates.
    fw = f % 1

    # Get image.
    img = (f - fw).astype(int)

    return fw, img