def get_extra_radiation(doy, solar_constant=<NUM_LIT>):
<EOL>B = (<NUM_LIT> * math.pi / <NUM_LIT>) * (doy - <NUM_LIT:1>)<EOL>RoverR0sqrd = (<NUM_LIT> + <NUM_LIT> * math.cos(B) + <NUM_LIT> * math.sin(B) +<EOL><NUM_LIT> * math.cos(<NUM_LIT:2> * B) + <NUM_LIT> * math.sin(<NUM_LIT:2> * B))<EOL>Ea = solar_constant * RoverR0sqrd<EOL>return Ea<EOL>
Determine extraterrestrial radiation from day of year (using the spencer method).

Note:
    [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

Args:
    doy : array of integers representing the days of the year.
    solar_constant : float, default 1366.1
        The solar constant.

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.