def wrapTheta(theta):
    """ Wrap an angle from the real line onto (-180, 180].

    Parameters
    ----------
    theta : float
        Angle, in degrees.

    Returns
    -------
    theta_wrapped : float
        The input, projected into (-180, 180].
    """
    return (theta + 90) % 360 - 90