def center_coordinates(coords, size, binning=1):
    """
    Given an XYZ tuple of particle coordinates and the reconstruction they came from, shift the
        coordinates so that the origin is at the center of the tomogram

    Args:
        coords: the (x, y, z) coordinates for the particle
        size: the reconstruction MRC half-dimensions in (nx/2, ny/2, nz/2) form
        binning: the bin factor from the original stack to the final reconstruction

    Returns: the new coordinates as a (x, y, z) tuple

    """
    return (
        float(coords[0]) / binning - size[0],
        float(coords[1]) / binning - size[1],
        float(coords[2]) / binning - size[2],
    )