def clear_sky_solar_radiation(ra, a_s=None, b_s=None, elev=None):
    """
    Calculate the clear-sky solar radiation (Allen et al. 1998).

    NOTE: The calculation of this parameter, when n_act = n_max, is
    required for computing the net longwave radiation.

    NOTE: a_s + b_s represents the fraction of extraterrestrial radiation
    reaching the earth on clear-sky days (n_act = n_max).

    Parameters
    ----------
    ra : float
        Extraterrestrial radiation (MJ m-2 day-1)
    a_s : float, optional
        Regression constant, expressing the fraction of extraterrestrial
        radiation reaching the earth on overcast days (n_act = 0),
        default is None.
    a_s : float, optional
        Regression constant, default is None.
    elev : int or float, optional
        Station elevation above the sea level (m a.s.l.).

    Returns
    -------
    float
        Clear-sky solar radiation (MJ m-2 day-1).

    Raises
    ------
    ValueError
        If neither a_s and b_s nor elev are provided.

    """
    if a_s is not None and b_s is not None:
        # For near sea level or when calibrated values for a_s and b_s are
        # available.
        return ra * (a_s + b_s)

    else:
        if elev is None:
            raise ValueError('Either a_s and b_s or elev need to be provided.')

        return ra * (0.75 + 2e-5 * elev)