Skip to content

Commit 3493f79

Browse files
authored
Update test_mismatch.py
Add test of use of spectral_factor_polo fuction (pull pvlib#2491)
1 parent dfafe6d commit 3493f79

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/spectrum/test_mismatch.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,18 @@ def test_spectral_factor_jrc_supplied_ambiguous():
302302
with pytest.raises(ValueError, match='No valid input provided'):
303303
spectrum.spectral_factor_jrc(1.0, 0.8, module_type=None,
304304
coefficients=None)
305+
@pytest.mark.parametrize("module_type,expected", [
306+
('cdte', np.array([0.990364, 0.999809, 1.01348, 0.992724, 0.959229, 0.972377])),
307+
('monosi', np.array([1.00098, 0.971769, 0.98771, 1.0163, 1.0221, 1.01151])),
308+
('cigs', np.array([1.00721, 0.959666, 0.975684, 1.02841, 1.0537, 1.0319])),
309+
('asi', np.array([0.979633, 1.04674, 1.05175, 0.950219, 0.868163, 0.921484])),
310+
])
311+
def test_spectral_factor_polo(module_type, expected):
312+
pws = np.array([0.96, 0.96, 1.85, 1.88, 0.66, 0.66])
313+
aods = np.array([0.085, 0.085, 0.16, 0.19, 0.088, 0.088])
314+
ams = np.array([1.34, 1.34, 2.2, 2.2, 2.6, 2.6])
315+
aois = np.array([46.0, 76.0, 74.0, 28.0, 24.0, 55.0])
316+
altitude=500
317+
out = spectrum.spectral_factor_polo(pws, ams, aods, aois, altitude,
318+
module_type=module_type)
319+
assert np.allclose(expected, out, atol=1e-8)

0 commit comments

Comments
 (0)