Exemple #1
0
def test_klucher_series():
    result = irradiance.klucher(40, 180, irrad_data['dhi'], irrad_data['ghi'],
                                ephem_data['apparent_zenith'],
                                ephem_data['azimuth'])
    assert_allclose(result, [0, 37.446276, 109.209347, 56.965916], atol=1e-4)
    # expect same result for np.array and pd.Series
    expected = irradiance.klucher(40, 180, irrad_data['dhi'].values,
                                  irrad_data['ghi'].values,
                                  ephem_data['apparent_zenith'].values,
                                  ephem_data['azimuth'].values)
    assert_allclose(result, expected, atol=1e-4)
Exemple #2
0
def test_klucher_series_float():
    # klucher inputs
    surface_tilt, surface_azimuth = 40.0, 180.0
    dhi, ghi = 100.0, 900.0
    solar_zenith, solar_azimuth = 20.0, 180.0
    # expect same result for floats and pd.Series
    expected = irradiance.klucher(
        surface_tilt, surface_azimuth, pd.Series(dhi), pd.Series(ghi),
        pd.Series(solar_zenith), pd.Series(solar_azimuth))  # 94.99429931664851
    result = irradiance.klucher(surface_tilt, surface_azimuth, dhi, ghi,
                                solar_zenith, solar_azimuth)
    assert_allclose(result, expected[0])
def test_klucher_series(irrad_data, ephem_data):
    result = irradiance.klucher(40, 180, irrad_data['dhi'], irrad_data['ghi'],
                                ephem_data['apparent_zenith'],
                                ephem_data['azimuth'])
    # pvlib matlab 1.4 does not contain the max(cos_tt, 0) correction
    # so, these values are different
    assert_allclose(result, [0., 36.789794, 109.209347, 56.965916], atol=1e-4)
    # expect same result for np.array and pd.Series
    expected = irradiance.klucher(
        40, 180, irrad_data['dhi'].values, irrad_data['ghi'].values,
        ephem_data['apparent_zenith'].values, ephem_data['azimuth'].values
    )
    assert_allclose(result, expected, atol=1e-4)
Exemple #4
0
def test_klucher_series(irrad_data, ephem_data):
    result = irradiance.klucher(40, 180, irrad_data['dhi'], irrad_data['ghi'],
                                ephem_data['apparent_zenith'],
                                ephem_data['azimuth'])
    # pvlib matlab 1.4 does not contain the max(cos_tt, 0) correction
    # so, these values are different
    assert_allclose(result, [0., 36.789794, 109.209347, 56.965916], atol=1e-4)
    # expect same result for np.array and pd.Series
    expected = irradiance.klucher(40, 180, irrad_data['dhi'].values,
                                  irrad_data['ghi'].values,
                                  ephem_data['apparent_zenith'].values,
                                  ephem_data['azimuth'].values)
    assert_allclose(result, expected, atol=1e-4)
def test_klucher_series_float():
    # klucher inputs
    surface_tilt, surface_azimuth = 40.0, 180.0
    dhi, ghi = 100.0, 900.0
    solar_zenith, solar_azimuth = 20.0, 180.0
    # expect same result for floats and pd.Series
    expected = irradiance.klucher(
        surface_tilt, surface_azimuth,
        pd.Series(dhi), pd.Series(ghi),
        pd.Series(solar_zenith), pd.Series(solar_azimuth)
    )  # 94.99429931664851
    result = irradiance.klucher(
        surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, solar_azimuth
    )
    assert_allclose(result, expected[0])
def test_klucher_series():
    result = irradiance.klucher(40, 180, irrad_data['dhi'], irrad_data['ghi'],
                                ephem_data['apparent_zenith'],
                                ephem_data['azimuth'])
    assert_allclose(result, [0, 37.446276, 109.209347, 56.965916], atol=1e-4)
def test_klucher_series_float():
    result = irradiance.klucher(40, 180, 100, 900, 20, 180)
    assert_allclose(result, 88.3022221559)
def test_klucher_series():
    irradiance.klucher(40, 180, irrad_data['DHI'], irrad_data['GHI'],
                              ephem_data['apparent_zenith'],
                              ephem_data['apparent_azimuth']) 
def test_klucher_series_float():
    irradiance.klucher(40, 180, 100, 900, 20, 180)
Exemple #10
0
def test_klucher_series():
    irradiance.klucher(40, 180, irrad_data['dhi'], irrad_data['ghi'],
                       ephem_data['apparent_zenith'],
                       ephem_data['apparent_azimuth'])
Exemple #11
0
def test_klucher_series_float():
    irradiance.klucher(40, 180, 100, 900, 20, 180)
def test_klucher_series():
    result = irradiance.klucher(40, 180, irrad_data['dhi'], irrad_data['ghi'],
                       ephem_data['apparent_zenith'],
                       ephem_data['azimuth'])
    assert_allclose(result, [0, 37.446276, 109.209347, 56.965916], atol=1e-4)
def test_klucher_series_float():
    result = irradiance.klucher(40, 180, 100, 900, 20, 180)
    assert_allclose(result, 88.3022221559)
                      freq='h')

# Compute the sun position at each hour of the year:
ephem_data = solarposition.get_solarposition(times,
                                             latitude=latitude,
                                             longitude=longitude,
                                             method='nrel_numpy')

# Compute the diffuse irradiance on the panel, reflected from the ground:
S_d_reflect = irradiance.grounddiffuse(surface_tilt,
                                       I_hor,
                                       albedo=0.25,
                                       surface_type=None)

# Compute the diffuse irradiance on the panel, from the sky:
S_d_sky = irradiance.klucher(surface_tilt, surface_azimuth, I_d_hor, I_hor,
                             ephem_data['zenith'], ephem_data['azimuth'])

# Compute the angles between the panel and the sun:
aoi = irradiance.aoi(surface_tilt, surface_azimuth, ephem_data['zenith'],
                     ephem_data['azimuth'])

# Compute the global irradiance on the panel:
S = irradiance.globalinplane(aoi, DNI, S_d_sky, S_d_reflect)

# Second case: with tracking (axis is supposed to be north-south):

S_track = tracking.singleaxis(ephem_data['apparent_zenith'],
                              ephem_data['azimuth'],
                              axis_tilt=0,
                              axis_azimuth=0,
                              max_angle=360,