def ineichen(apparent_zenith, airmass_absolute, linke_turbidity,<EOL>altitude=<NUM_LIT:0>, dni_extra=<NUM_LIT>, perez_enhancement=False):
<EOL>cos_zenith = np.maximum(tools.cosd(apparent_zenith), <NUM_LIT:0>)<EOL>tl = linke_turbidity<EOL>fh1 = np.exp(-altitude/<NUM_LIT>)<EOL>fh2 = np.exp(-altitude/<NUM_LIT>)<EOL>cg1 = <NUM_LIT> * altitude + <NUM_LIT><EOL>cg2 = <NUM_LIT> * altitude + <NUM_LIT><EOL>ghi = np.exp(-cg2*airmass_absolute*(fh1 + fh2*(tl - <NUM_LIT:1>)))<EOL>if perez_enhancement:<EOL><INDENT>ghi *= np.exp(<NUM_LIT>*airmass_absolute**<NUM_LIT>)<EOL><DEDENT>ghi = cg1 * dni_extra * cos_zenith * tl / tl * np.fmax(ghi, <NUM_LIT:0>)<EOL>b = <NUM_LIT> + <NUM_LIT>/fh1<EOL>bnci = b * np.exp(-<NUM_LIT> * airmass_absolute * (tl - <NUM_LIT:1>))<EOL>bnci = dni_extra * np.fmax(bnci, <NUM_LIT:0>)<EOL>bnci_2 = ((<NUM_LIT:1> - (<NUM_LIT:0.1> - <NUM_LIT>*np.exp(-tl))/(<NUM_LIT:0.1> + <NUM_LIT>/fh1)) /<EOL>cos_zenith)<EOL>bnci_2 = ghi * np.fmin(np.fmax(bnci_2, <NUM_LIT:0>), <NUM_LIT>)<EOL>dni = np.minimum(bnci, bnci_2)<EOL>dhi = ghi - dni*cos_zenith<EOL>irrads = OrderedDict()<EOL>irrads['<STR_LIT>'] = ghi<EOL>irrads['<STR_LIT>'] = dni<EOL>irrads['<STR_LIT>'] = dhi<EOL>if isinstance(dni, pd.Series):<EOL><INDENT>irrads = pd.DataFrame.from_dict(irrads)<EOL><DEDENT>return irrads<EOL>
Determine clear sky GHI, DNI, and DHI from Ineichen/Perez model.

Implements the Ineichen and Perez clear sky model for global
horizontal irradiance (GHI), direct normal irradiance (DNI), and
calculates the clear-sky diffuse horizontal (DHI) component as the
difference between GHI and DNI*cos(zenith) as presented in [1, 2]. A
report on clear sky models found the Ineichen/Perez model to have
excellent performance with a minimal input data set [3].

Default values for monthly Linke turbidity provided by SoDa [4, 5].

Parameters
-----------
apparent_zenith : numeric
    Refraction corrected solar zenith angle in degrees.

airmass_absolute : numeric
    Pressure corrected airmass.

linke_turbidity : numeric
    Linke Turbidity.

altitude : numeric, default 0
    Altitude above sea level in meters.

dni_extra : numeric, default 1364
    Extraterrestrial irradiance. The units of ``dni_extra``
    determine the units of the output.

perez_enhancement : bool, default False
    Controls if the Perez enhancement factor should be applied.
    Setting to True may produce spurious results for times when
    the Sun is near the horizon and the airmass is high.
    See https://github.com/pvlib/pvlib-python/issues/435

Returns
-------
clearsky : DataFrame (if Series input) or OrderedDict of arrays
    DataFrame/OrderedDict contains the columns/keys
    ``'dhi', 'dni', 'ghi'``.

See also
--------
lookup_linke_turbidity
pvlib.location.Location.get_clearsky

References
----------
[1] P. Ineichen and R. Perez, "A New airmass independent formulation for
    the Linke turbidity coefficient", Solar Energy, vol 73, pp. 151-157,
    2002.

[2] R. Perez et. al., "A New Operational Model for Satellite-Derived
    Irradiances: Description and Validation", Solar Energy, vol 73, pp.
    307-317, 2002.

[3] M. Reno, C. Hansen, and J. Stein, "Global Horizontal Irradiance Clear
    Sky Models: Implementation and Analysis", Sandia National
    Laboratories, SAND2012-2389, 2012.

[4] http://www.soda-is.com/eng/services/climat_free_eng.php#c5 (obtained
    July 17, 2012).

[5] J. Remund, et. al., "Worldwide Linke Turbidity Information", Proc.
    ISES Solar World Congress, June 2003. Goteborg, Sweden.