def spa_python(time, latitude, longitude,
               altitude=0, pressure=101325, temperature=12, delta_t=None,
               atmos_refract=None, how='numpy', numthreads=4):

    # Added by Tony Lorenzo (@alorenzo175), University of Arizona, 2015

    pvl_logger.debug('Calculating solar position with spa_python code')

    lat = latitude
    lon = longitude
    elev = altitude
    pressure = pressure / 100  # pressure must be in millibars for calculation
    delta_t = delta_t or 67.0
    atmos_refract = atmos_refract or 0.5667

    if not isinstance(time, pd.DatetimeIndex):
        try:
            time = pd.DatetimeIndex(time)
        except (TypeError, ValueError):
            time = pd.DatetimeIndex([time, ])

    unixtime = time.astype(np.int64)/10**9

    spa = _spa_python_import(how)

    app_zenith, zenith, app_elevation, elevation, azimuth, eot = spa.solar_position(
        unixtime, lat, lon, elev, pressure, temperature, delta_t,
        atmos_refract, numthreads)

    result = pd.DataFrame({'apparent_zenith': app_zenith, 'zenith': zenith,
                           'apparent_elevation': app_elevation,
                           'elevation': elevation, 'azimuth': azimuth,
                           'equation_of_time': eot},
                          index=time)

    return result
Static Page view
dataset/ETHPy150Open pvlib/pvlib-python/pvlib/solarposition.py/spa_python--crossover with--dataset/ETHPy150Open treeio/treeio/treeio/core/administration/views.py/page_view