def set_real(data, v):
    """
    Set real component of data to a constant.

    Parameters
    ----------
    data : ndarray
        Array of NMR data.
    v : float
        Constant to set both real component of `data` to.

    Returns
    -------
    ndata : ndarray
        Array of NMR data with real components set to v.

    Notes
    -----
    data is set in place, if original data is required make a copy before
    calling this function.

    """
    data.real = v
    return data