def get_extra_radiation(datetime_or_doy, solar_constant=<NUM_LIT>,<EOL>method='<STR_LIT>', epoch_year=<NUM_LIT>, **kwargs):
to_doy, to_datetimeindex, to_output =_handle_extra_radiation_types(datetime_or_doy, epoch_year)<EOL>method = method.lower()<EOL>if method == '<STR_LIT>':<EOL><INDENT>B = solarposition._calculate_simple_day_angle(to_doy(datetime_or_doy))<EOL>RoverR0sqrd = <NUM_LIT:1> + <NUM_LIT> * np.cos(B)<EOL><DEDENT>elif method == '<STR_LIT>':<EOL><INDENT>B = solarposition._calculate_simple_day_angle(to_doy(datetime_or_doy))<EOL>RoverR0sqrd = (<NUM_LIT> + <NUM_LIT> * np.cos(B) + <NUM_LIT> * np.sin(B) +<EOL><NUM_LIT> * np.cos(<NUM_LIT:2> * B) + <NUM_LIT> * np.sin(<NUM_LIT:2> * B))<EOL><DEDENT>elif method == '<STR_LIT>':<EOL><INDENT>times = to_datetimeindex(datetime_or_doy)<EOL>RoverR0sqrd = solarposition.pyephem_earthsun_distance(times) ** (-<NUM_LIT:2>)<EOL><DEDENT>elif method == '<STR_LIT>':<EOL><INDENT>times = to_datetimeindex(datetime_or_doy)<EOL>RoverR0sqrd =solarposition.nrel_earthsun_distance(times, **kwargs) ** (-<NUM_LIT:2>)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>', method)<EOL><DEDENT>Ea = solar_constant * RoverR0sqrd<EOL>Ea = to_output(Ea)<EOL>return Ea<EOL>
Determine extraterrestrial radiation from day of year.

Parameters
----------
datetime_or_doy : numeric, array, date, datetime, Timestamp, DatetimeIndex
    Day of year, array of days of year, or datetime-like object

solar_constant : float, default 1366.1
    The solar constant.

method : string, default 'spencer'
    The method by which the ET radiation should be calculated.
    Options include ``'pyephem', 'spencer', 'asce', 'nrel'``.

epoch_year : int, default 2014
    The year in which a day of year input will be calculated. Only
    applies to day of year input used with the pyephem or nrel
    methods.

kwargs :
    Passed to solarposition.nrel_earthsun_distance

Returns
-------
dni_extra : float, array, or Series
    The extraterrestrial radiation present in watts per square meter
    on a surface which is normal to the sun. Pandas Timestamp and
    DatetimeIndex inputs will yield a Pandas TimeSeries. All other
    inputs will yield a float or an array of floats.

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

[2] <http://solardat.uoregon.edu/SolarRadiationBasics.html>, Eqs.
SR1 and SR2

[3] Partridge, G. W. and Platt, C. M. R. 1976. Radiative Processes
in Meteorology and Climatology.

[4] Duffie, J. A. and Beckman, W. A. 1991. Solar Engineering of
Thermal Processes, 2nd edn. J. Wiley and Sons, New York.