def spa_c(time, latitude, longitude, pressure=<NUM_LIT>, altitude=<NUM_LIT:0>,<EOL>temperature=<NUM_LIT:12>, delta_t=<NUM_LIT>,<EOL>raw_spa_output=False):
<EOL>try:<EOL><INDENT>from pvlib.spa_c_files.spa_py import spa_calc<EOL><DEDENT>except ImportError:<EOL><INDENT>raise ImportError('<STR_LIT>' +<EOL>'<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>time_utc = time.tz_convert('<STR_LIT>')<EOL><DEDENT>except TypeError:<EOL><INDENT>time_utc = time<EOL><DEDENT>spa_out = []<EOL>for date in time_utc:<EOL><INDENT>spa_out.append(spa_calc(year=date.year,<EOL>month=date.month,<EOL>day=date.day,<EOL>hour=date.hour,<EOL>minute=date.minute,<EOL>second=date.second,<EOL>time_zone=<NUM_LIT:0>,  <EOL>latitude=latitude,<EOL>longitude=longitude,<EOL>elevation=altitude,<EOL>pressure=pressure / <NUM_LIT:100>,<EOL>temperature=temperature,<EOL>delta_t=delta_t<EOL>))<EOL><DEDENT>spa_df = pd.DataFrame(spa_out, index=time)<EOL>if raw_spa_output:<EOL><INDENT>return spa_df.rename(columns={'<STR_LIT>': '<STR_LIT>'})<EOL><DEDENT>else:<EOL><INDENT>dfout = pd.DataFrame({'<STR_LIT>': spa_df['<STR_LIT>'],<EOL>'<STR_LIT>': spa_df['<STR_LIT>'],<EOL>'<STR_LIT>': spa_df['<STR_LIT:e>'],<EOL>'<STR_LIT>': spa_df['<STR_LIT>'],<EOL>'<STR_LIT>': <NUM_LIT> - spa_df['<STR_LIT>']})<EOL>return dfout<EOL><DEDENT>
Calculate the solar position using the C implementation of the NREL
SPA code.

The source files for this code are located in './spa_c_files/', along with
a README file which describes how the C code is wrapped in Python.
Due to license restrictions, the C code must be downloaded seperately
and used in accordance with it's license.

This function is slower and no more accurate than :py:func:`spa_python`.

Parameters
----------
time : pandas.DatetimeIndex
    Localized or UTC.
latitude : float
longitude : float
pressure : float, default 101325
    Pressure in Pascals
altitude : float, default 0
    Elevation above sea level.
temperature : float, default 12
    Temperature in C
delta_t : float, default 67.0
    Difference between terrestrial time and UT1.
    USNO has previous values and predictions.
raw_spa_output : bool, default False
    If true, returns the raw SPA output.

Returns
-------
DataFrame
    The DataFrame will have the following columns:
    elevation,
    azimuth,
    zenith,
    apparent_elevation,
    apparent_zenith.

References
----------
NREL SPA reference: http://rredc.nrel.gov/solar/codesandalgorithms/spa/
NREL SPA C files: https://midcdmz.nrel.gov/spa/

Note: The ``timezone`` field in the SPA C files is replaced with
``time_zone`` to avoid a nameclash with the function ``__timezone`` that is
redefined by Python>=3.5. This issue is
`Python bug 24643 <https://bugs.python.org/issue24643>`_.

USNO delta T:
http://www.usno.navy.mil/USNO/earth-orientation/eo-products/long-term

See also
--------
pyephem, spa_python, ephemeris