spa_c(time, latitude, longitude, pressure=101325, altitude=0, temperature=12, delta_t=67.0, raw_spa_output=False)¶
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
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.
DataFrame – The DataFrame will have the following columns: elevation, azimuth, zenith, apparent_elevation, apparent_zenith.
NREL SPA reference: http://rredc.nrel.gov/solar/codesandalgorithms/spa/ NREL SPA C files: https://midcdmz.nrel.gov/spa/
timezonefield in the SPA C files is replaced with
time_zoneto avoid a nameclash with the function
__timezonethat is redefined by Python>=3.5. This issue is Python bug 24643.