def dirint(ghi, altitudes, doys, pressures, use_delta_kt_prime=True,
           temp_dew=None, min_sin_altitude=0.065, min_altitude=3):
    """
    Determine DNI from GHI using the DIRINT modification of the DISC
    model.

    Implements the modified DISC model known as "DIRINT" introduced in
    [1]. DIRINT predicts direct normal irradiance (DNI) from measured
    global horizontal irradiance (GHI). DIRINT improves upon the DISC
    model by using time-series GHI data and dew point temperature
    information. The effectiveness of the DIRINT model improves with
    each piece of information provided.

    The pvlib implementation limits the clearness index to 1.
    The DIRINT model requires time series data.

    Note:
        [1] Perez, R., P. Ineichen, E. Maxwell, R. Seals and A. Zelenka,
        (1992). "Dynamic Global-to-Direct Irradiance Conversion Models".
        ASHRAE Transactions-Research Series, pp. 354-369

        [2] Maxwell, E. L., "A Quasi-Physical Model for Converting Hourly
        Global Horizontal to Direct Normal Insolation", Technical Report No.
        SERI/TR-215-3087, Golden, CO: Solar Energy Research Institute, 1987.

    Args:
        ghi: array-like
            Global horizontal irradiance in W/m^2.
        altitudes: array-like
            True (not refraction-corrected) solar altitude angles in decimal
            degrees.
        doys: array-like
            Integers representing the day of the year.
        pressures: array-like
            The site pressure in Pascal. Pressure may be measured or an
            average pressure may be calculated from site altitude.
        use_delta_kt_prime: bool, default True
            If True, indicates that the stability index delta_kt_prime is
            included in the model. The stability index adjusts the estimated
            DNI in response to dynamics in the time series of GHI. It is
            recommended that delta_kt_prime is not used if the time between
            GHI points is 1.5 hours or greater. If use_delta_kt_prime=True,
            input data must be Series.
        temp_dew: None or array-like, default None
            Surface dew point temperatures, in degrees C. Values of temp_dew
            must be numeric. If temp_dew is not provided, then dew point
            improvements are not applied.
        min_sin_altitude: numeric, default 0.065
            Minimum value of sin(altitude) to allow when calculating global
            clearness index `kt`. Equivalent to altitude = 3.727 degrees.
        min_altitude: numeric, default 87
            Minimum value of altitude to allow in DNI calculation. DNI will be
            set to 0 for times with altitude values smaller than `min_altitude`.

    Returns:
        dni: array-like
            The modeled direct normal irradiance in W/m^2 provided by the
            DIRINT model.
    """
    # calculate kt_prime values
    kt_primes = []
    disc_dni = []
    for i in range(len(ghi)):
        dni, kt, airmass = disc(ghi[i], altitudes[i], doys[i], pressure=pressures[i],
                                min_sin_altitude=min_sin_altitude,
                                min_altitude=min_altitude)
        kt_prime = clearness_index_zenith_independent(
            kt, airmass, max_clearness_index=1)
        kt_primes.append(kt_prime)
        disc_dni.append(dni)

    # calculate delta_kt_prime values
    if use_delta_kt_prime is True:
        delta_kt_prime = []
        for i in range(len(kt_primes)):
            try:
                kt_prime_1 = kt_primes[i + 1]
            except IndexError:
                # last hour
                kt_prime_1 = kt_primes[0]
            delta_kt_prime.append(0.5 * (abs(kt_primes[i] - kt_prime_1) +
                                         abs(kt_primes[i] - kt_primes[i - 1])))
    else:
        delta_kt_prime = [-1] * len(ghi)

    # calculate W values if dew point temperatures have been provided
    if temp_dew is not None:
        w = [math.exp(0.07 * td - 0.075) for td in temp_dew]
    else:
        w = [-1] * len(ghi)

    # bin the values into appropriate categoreis for lookup in the coefficient matirx.
    ktp_bin, alt_bin, w_bin, delta_ktp_bin = \
        _dirint_bins(kt_primes, altitudes, w, delta_kt_prime)

    # get the dirint coefficient by looking up values in the matrix
    coeffs = _get_dirint_coeffs()
    dirint_coeffs = [coeffs[ktp_bin[i]][alt_bin[i]][delta_ktp_bin[i]][w_bin[i]]
                     for i in range(len(ghi))]

    # Perez eqn 5
    dni = [disc_d * coef for disc_d, coef in zip(disc_dni, dirint_coeffs)]

    return dni
Determine DNI from GHI using the DIRINT modification of the DISC
    model.

    Implements the modified DISC model known as "DIRINT" introduced in
    [1]. DIRINT predicts direct normal irradiance (DNI) from measured
    global horizontal irradiance (GHI). DIRINT improves upon the DISC
    model by using time-series GHI data and dew point temperature
    information. The effectiveness of the DIRINT model improves with
    each piece of information provided.

    The pvlib implementation limits the clearness index to 1.
    The DIRINT model requires time series data.

    Note:
        [1] Perez, R., P. Ineichen, E. Maxwell, R. Seals and A. Zelenka,
        (1992). "Dynamic Global-to-Direct Irradiance Conversion Models".
        ASHRAE Transactions-Research Series, pp. 354-369

        [2] Maxwell, E. L., "A Quasi-Physical Model for Converting Hourly
        Global Horizontal to Direct Normal Insolation", Technical Report No.
        SERI/TR-215-3087, Golden, CO: Solar Energy Research Institute, 1987.

    Args:
        ghi: array-like
            Global horizontal irradiance in W/m^2.
        altitudes: array-like
            True (not refraction-corrected) solar altitude angles in decimal
            degrees.
        doys: array-like
            Integers representing the day of the year.
        pressures: array-like
            The site pressure in Pascal. Pressure may be measured or an
            average pressure may be calculated from site altitude.
        use_delta_kt_prime: bool, default True
            If True, indicates that the stability index delta_kt_prime is
            included in the model. The stability index adjusts the estimated
            DNI in response to dynamics in the time series of GHI. It is
            recommended that delta_kt_prime is not used if the time between
            GHI points is 1.5 hours or greater. If use_delta_kt_prime=True,
            input data must be Series.
        temp_dew: None or array-like, default None
            Surface dew point temperatures, in degrees C. Values of temp_dew
            must be numeric. If temp_dew is not provided, then dew point
            improvements are not applied.
        min_sin_altitude: numeric, default 0.065
            Minimum value of sin(altitude) to allow when calculating global
            clearness index `kt`. Equivalent to altitude = 3.727 degrees.
        min_altitude: numeric, default 87
            Minimum value of altitude to allow in DNI calculation. DNI will be
            set to 0 for times with altitude values smaller than `min_altitude`.

    Returns:
        dni: array-like
            The modeled direct normal irradiance in W/m^2 provided by the
            DIRINT model.