def test_deprecated_07(): with pytest.warns(pvlibDeprecationWarning): irradiance.extraradiation(300) with pytest.warns(pvlibDeprecationWarning): irradiance.grounddiffuse(40, 900) with pytest.warns(pvlibDeprecationWarning): irradiance.total_irrad(32, 180, 10, 180, 0, 0, 0, 1400, 1) with pytest.warns(pvlibDeprecationWarning): irradiance.globalinplane(0, 1000, 100, 10)
def test_globalinplane(): AOI = irradiance.aoi(40, 180, ephem_data['apparent_zenith'], ephem_data['apparent_azimuth']) AM = atmosphere.relativeairmass(ephem_data['apparent_zenith']) gr_sand = irradiance.grounddiffuse(40, ghi, surface_type='sand') diff_perez = irradiance.perez( 40, 180, irrad_data['DHI'], irrad_data['DNI'], dni_et, ephem_data['apparent_zenith'], ephem_data['apparent_azimuth'], AM) irradiance.globalinplane( AOI=AOI, DNI=irrad_data['DNI'], In_Plane_SkyDiffuse=diff_perez, GR=gr_sand)
def test_globalinplane(): aoi = irradiance.aoi(40, 180, ephem_data['apparent_zenith'], ephem_data['apparent_azimuth']) airmass = atmosphere.relativeairmass(ephem_data['apparent_zenith']) gr_sand = irradiance.grounddiffuse(40, ghi, surface_type='sand') diff_perez = irradiance.perez( 40, 180, irrad_data['dhi'], irrad_data['dni'], dni_et, ephem_data['apparent_zenith'], ephem_data['apparent_azimuth'], airmass) irradiance.globalinplane( aoi=aoi, dni=irrad_data['dni'], poa_sky_diffuse=diff_perez, poa_ground_diffuse=gr_sand)
def test_globalinplane(): aoi = irradiance.aoi(40, 180, ephem_data['apparent_zenith'], ephem_data['azimuth']) airmass = atmosphere.relativeairmass(ephem_data['apparent_zenith']) gr_sand = irradiance.grounddiffuse(40, ghi, surface_type='sand') diff_perez = irradiance.perez( 40, 180, irrad_data['dhi'], irrad_data['dni'], dni_et, ephem_data['apparent_zenith'], ephem_data['azimuth'], airmass) irradiance.globalinplane( aoi=aoi, dni=irrad_data['dni'], poa_sky_diffuse=diff_perez, poa_ground_diffuse=gr_sand)
def test_globalinplane(): AOI = irradiance.aoi(40, 180, ephem_data['apparent_zenith'], ephem_data['apparent_azimuth']) AM = atmosphere.relativeairmass(ephem_data['apparent_zenith']) gr_sand = irradiance.grounddiffuse(40, ghi, surface_type='sand') diff_perez = irradiance.perez(40, 180, irrad_data['DHI'], irrad_data['DNI'], dni_et, ephem_data['apparent_zenith'], ephem_data['apparent_azimuth'], AM) irradiance.globalinplane(AOI=AOI, DNI=irrad_data['DNI'], In_Plane_SkyDiffuse=diff_perez, GR=gr_sand)
def test_grounddiffuse_albedo_surface(): irradiance.grounddiffuse(40, ghi, surface_type='sand')
def test_grounddiffuse_albedo_invalid_surface(): irradiance.grounddiffuse(40, ghi, surface_type='invalid')
def test_grounddiffuse_albedo_0(): ground_irrad = irradiance.grounddiffuse(40, ghi, albedo=0) assert 0 == ground_irrad.all()
def test_grounddiffuse_simple_series(): ground_irrad = irradiance.grounddiffuse(40, ghi) assert ground_irrad.name == 'diffuse_ground'
def test_grounddiffuse_albedo_surface(): result = irradiance.grounddiffuse(40, ghi, surface_type='sand') assert_allclose(result, [0, 3.731058, 48.778813, 12.035025], atol=1e-4)
def test_grounddiffuse_albedo_invalid_surface(): with pytest.raises(KeyError): irradiance.grounddiffuse(40, ghi, surface_type='invalid')
def test_grounddiffuse_simple_float(): irradiance.grounddiffuse(40, 900)
def test_grounddiffuse_simple_float(): result = irradiance.grounddiffuse(40, 900) assert_allclose(result, 26.32000014911496)
def poa_gd(forecast_data, surf_tilt=33.865143, albedo=0.2): poa_ground_diffuse = irradiance.grounddiffuse(surf_tilt, forecast_data["ghi"], albedo=albedo) return (poa_ground_diffuse)
first = epw.weatherdata[0] last = epw.weatherdata[-1] times = pd.date_range(start=datetime.datetime(2015, first.month, first.day), end=datetime.datetime(2015, last.month, last.day, 23, 59, 59), 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):