def disc(ghi, altitude, doy, pressure=<NUM_LIT>,<EOL>min_sin_altitude=<NUM_LIT>, min_altitude=<NUM_LIT:3>, max_airmass=<NUM_LIT:12>):
if altitude > min_altitude and ghi > <NUM_LIT:0>:<EOL><INDENT>I0 = get_extra_radiation(doy, <NUM_LIT>)<EOL>kt = clearness_index(ghi, altitude, I0, min_sin_altitude=min_sin_altitude,<EOL>max_clearness_index=<NUM_LIT:1>)<EOL>am = get_relative_airmass(altitude, model='<STR_LIT>')<EOL>if pressure is not None:<EOL><INDENT>am = get_absolute_airmass(am, pressure)<EOL><DEDENT>Kn, am = _disc_kn(kt, am, max_airmass=max_airmass)<EOL>dni = Kn * I0<EOL>dni = max(dni, <NUM_LIT:0>)<EOL>return dni, kt, am<EOL><DEDENT>else:<EOL><INDENT>return <NUM_LIT:0>, <NUM_LIT:0>, None<EOL><DEDENT>
Estimate Direct Normal Irradiance from Global Horizontal Irradiance
using the DISC model.

The DISC algorithm converts global horizontal irradiance to direct
normal irradiance through empirical relationships between the global
and direct clearness indices.

This implementation limits the clearness index to 1 by default.

The original report describing the DISC model [1]_ uses the
relative airmass rather than the absolute (pressure-corrected)
airmass. However, the NREL implementation of the DISC model [2]_
uses absolute airmass. PVLib Matlab also uses the absolute airmass.
pvlib python defaults to absolute airmass, but the relative airmass
can be used by supplying `pressure=None`.

Note:
    [1] 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.

    [2] Maxwell, E. "DISC Model", Excel Worksheet.
    https://www.nrel.gov/grid/solar-resource/disc.html

Args:
    ghi : numeric
        Global horizontal irradiance in W/m^2.
    altitude : numeric
        True (not refraction-corrected) solar altitude angles in decimal
        degrees.
    doy : An integer representing the day of the year.
    pressure : None or numeric, default 101325
        Site pressure in Pascal. If None, relative airmass is used
        instead of absolute (pressure-corrected) airmass.
    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`.
    max_airmass : numeric, default 12
        Maximum value of the airmass to allow in Kn calculation.
        Default value (12) comes from range over which Kn was fit
        to airmass in the original paper.

Returns:
    dni: The modeled direct normal irradiance
        in W/m^2 provided by the
        Direct Insolation Simulation Code (DISC) model.
    kt: Ratio of global to extraterrestrial
        irradiance on a horizontal plane.
    am: Airmass