def solar_position(unixtime, lat, lon, elev, pressure, temp, delta_t,<EOL>atmos_refract, numthreads=<NUM_LIT:8>, sst=False, esd=False):
if USE_NUMBA:<EOL><INDENT>do_calc = solar_position_numba<EOL><DEDENT>else:<EOL><INDENT>do_calc = solar_position_numpy<EOL><DEDENT>result = do_calc(unixtime, lat, lon, elev, pressure,<EOL>temp, delta_t, atmos_refract, numthreads,<EOL>sst, esd)<EOL>if not isinstance(result, np.ndarray):<EOL><INDENT>try:<EOL><INDENT>result = np.array(result)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return result<EOL>
Calculate the solar position using the
NREL SPA algorithm described in [1].

If numba is installed, the functions can be compiled
and the code runs quickly. If not, the functions
still evaluate but use numpy instead.

Parameters
----------
unixtime : numpy array
    Array of unix/epoch timestamps to calculate solar position for.
    Unixtime is the number of seconds since Jan. 1, 1970 00:00:00 UTC.
    A pandas.DatetimeIndex is easily converted using .astype(np.int64)/10**9
lat : float
    Latitude to calculate solar position for
lon : float
    Longitude to calculate solar position for
elev : float
    Elevation of location in meters
pressure : int or float
    avg. yearly pressure at location in millibars;
    used for atmospheric correction
temp : int or float
    avg. yearly temperature at location in
    degrees C; used for atmospheric correction
delta_t : float, optional
    If delta_t is None, uses spa.calculate_deltat
    using time.year and time.month from pandas.DatetimeIndex.
    For most simulations specifing delta_t is sufficient.
    Difference between terrestrial time and UT1.
    *Note: delta_t = None will break code using nrel_numba,
    this will be fixed in a future version.
    By default, use USNO historical data and predictions
atmos_refrac : float, optional
    The approximate atmospheric refraction (in degrees)
    at sunrise and sunset.
numthreads: int, optional, default 8
    Number of threads to use for computation if numba>=0.17
    is installed.
sst : bool, default False
    If True, return only data needed for sunrise, sunset, and transit
    calculations.
esd : bool, default False
    If True, return only Earth-Sun distance in AU

Returns
-------
Numpy Array with elements:
    apparent zenith,
    zenith,
    elevation,
    apparent_elevation,
    azimuth,
    equation_of_time

References
----------
[1] I. Reda and A. Andreas, Solar position algorithm for solar radiation
applications. Solar Energy, vol. 76, no. 5, pp. 577-589, 2004.

[2] I. Reda and A. Andreas, Corrigendum to Solar position algorithm for
solar radiation applications. Solar Energy, vol. 81, no. 6, p. 838, 2007.