Skip to content

Commit f0a4f34

Browse files
committed
replace altitude parameter with pressure
1 parent bd1ff4f commit f0a4f34

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

pvlib/spectrum/mismatch.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ def spectral_factor_jrc(airmass, clearsky_index, module_type=None,
713713

714714

715715
def spectral_factor_polo(precipitable_water, airmass_absolute, aod500, aoi,
716-
altitude, module_type=None, coefficients=None,
716+
pressure, module_type=None, coefficients=None,
717717
albedo=0.2):
718718
"""
719719
Estimate the spectral mismatch for BIPV application in vertical facades.
@@ -730,8 +730,8 @@ def spectral_factor_polo(precipitable_water, airmass_absolute, aod500, aoi,
730730
aoi : numeric
731731
Angle of incidence on the vertical surface. See :term:`aoi`.
732732
[degrees]
733-
altitude: numeric
734-
altitude over sea level. [m]
733+
pressure : numeric
734+
Atmospheric pressure. See :term`pressure`. [Pa]
735735
module_type : str, optional
736736
One of the following PV technology strings from [1]_:
737737
@@ -764,7 +764,6 @@ def spectral_factor_polo(precipitable_water, airmass_absolute, aod500, aoi,
764764
if module_type is not None and coefficients is not None:
765765
raise ValueError('Only one of `module_type` and `coefficients` should '
766766
'be provided')
767-
pressure = pvlib.atmosphere.alt2pres(altitude)
768767
f_aoi_rel = pvlib.atmosphere.get_relative_airmass(aoi,
769768
model='kastenyoung1989')
770769
f_aoi = pvlib.atmosphere.get_absolute_airmass(f_aoi_rel, pressure)

tests/spectrum/test_mismatch.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,21 +306,21 @@ def test_spectral_factor_jrc_supplied_ambiguous():
306306

307307
@pytest.mark.parametrize("module_type,expected", [
308308
('cdte', np.array(
309-
[0.991926, 0.999809, 1.01108, 0.993319, 0.956621, 0.970872])),
309+
[0.992801, 1.00004 , 1.011576, 0.995003, 0.950156, 0.975665])),
310310
('monosi', np.array(
311-
[1.00174, 0.971769, 0.986224, 1.01661, 1.02026, 1.0106])),
311+
[1.000152, 0.969588, 0.984636, 1.015405, 1.024238, 1.005061])),
312312
('cigs', np.array(
313-
[1.00769, 0.959666, 0.974438, 1.02861, 1.05203, 1.03117])),
313+
[1.004621, 0.956719, 0.971668, 1.0254, 1.060066, 1.020196])),
314314
('asi', np.array(
315-
[0.982133, 1.04674, 1.04859, 0.951109, 0.865328, 0.919515])),
315+
[0.986968, 1.049725, 1.051978, 0.957968, 0.842258, 0.941927])),
316316
])
317317
def test_spectral_factor_polo(module_type, expected):
318-
altitude = 500
319318
pws = np.array([0.96, 0.96, 1.85, 1.88, 0.66, 0.66])
320319
aods = np.array([0.085, 0.085, 0.16, 0.19, 0.088, 0.088])
321320
ams = np.array([1.34, 1.34, 2.2, 2.2, 2.6, 2.6])
322321
aois = np.array([46.0, 76.0, 74.0, 28.0, 24.0, 55.0])
322+
pressure = np.array([101300, 101400, 100500, 101325, 80000, 120000])
323323
alb = np.array([0.15, 0.2, 0.3, 0.18, 0.32, 0.26])
324324
out = spectrum.spectral_factor_polo(
325-
pws, ams, aods, aois, altitude, module_type=module_type, albedo=alb)
326-
assert np.allclose(expected, out, atol=1e-8)
325+
pws, ams, aods, aois, pressure, module_type=module_type, albedo=alb)
326+
np.testing.assert_allclose(out, expected, atol=1e-6)

0 commit comments

Comments
 (0)