From b006adbe43f073e16d37318f020c14471411761b Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 28 May 2024 21:59:53 +0100 Subject: [PATCH 01/72] Create test_pelland.py --- pvlib/tests/test_pelland.py | 73 +++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 pvlib/tests/test_pelland.py diff --git a/pvlib/tests/test_pelland.py b/pvlib/tests/test_pelland.py new file mode 100644 index 0000000000..50250783c8 --- /dev/null +++ b/pvlib/tests/test_pelland.py @@ -0,0 +1,73 @@ +import numpy as np +from warnings import warn + +def spectral_factor_pelland(airmass_absolute, clearness_index, + module_type = None, coefficients = None, + min_airmass_absolute = 0.58, + max_airmass_absolute = 10): +# ============================================================================= +# model implemented: https://ieeexplore.ieee.org/document/9300932 +# inputs: air mass, clearness index +# coefficients: six modules +# ============================================================================= +# ============================================================================= +# --- Screen Input Data --- +# ============================================================================= + #kc + kc = np.atleast_1d(clearness_index) + kc = kc.astype('float64') + if np.min(kc) < 0: + raise ValueError('Clearness index cannot be less than 0') + if np.max(kc) > 1: + raise ValueError('Clearness index cannot be grater than 1') + #ama + if np.max(airmass_absolute) > max_airmass_absolute: + warn('High air mass values greater than 'f'{max_airmass_absolute} '+ + 'in dataset') + # Warn user about exceptionally low ama data + if np.min(airmass_absolute) < min_airmass_absolute: + airmass_absolute = np.maximum(airmass_absolute, min_airmass_absolute ) + warn('Exceptionally low air mass: ' + + 'model not intended for extra-terrestrial use') +# ============================================================================= +# --- Default coefficients --- +# ============================================================================= + _coefficients = {} + _coefficients['polysi'] = ( + 0.9847, -0.05237, 0.03034) + _coefficients['monosi'] = ( + 0.9845, -0.05169, 0.03034) + _coefficients['fs-2'] = ( + 1.002, -0.07108, 0.02465) + _coefficients['fs-4'] = ( + 0.9981, -0.05776, 0.02336) + _coefficients['cigs'] = ( + 0.9791, -0.03904, 0.03096) + _coefficients['asi'] = ( + 1.051, -0.1033, 0.009838) + _coefficients['multisi'] = _coefficients['polysi'] + _coefficients['xsi'] = _coefficients['monosi'] +# ============================================================================= +# --- Check arguments --- +# ============================================================================= + if module_type is not None and coefficients is None: + coefficients = _coefficients[module_type.lower()] + elif module_type is None and coefficients is not None: + pass + elif module_type is None and coefficients is None: + raise TypeError('No valid input provided, both module_type and ' + + 'coefficients are None. module_type can be one of ' + + 'poly-Si, monosi, fs-2, fs-4, cigs, or asi') + else: + raise TypeError('Cannot resolve input, must supply only one of ' + + 'module_type and coefficients. module_type can be ' + + 'one of poly-Si, monosi, fs-2, fs-4, cigs, or asi') +# ============================================================================= +# --- Specral mismatch calculation --- +# ============================================================================= + coeff = coefficients + ama = airmass_absolute + kc = clearness_index + modifier = coeff[0]*kc**(coeff[1])*ama**(coeff[2]) + + return modifier \ No newline at end of file From a5563e615d391ead7cbc773b8cd6ceeaa55d27dc Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 28 May 2024 22:02:59 +0100 Subject: [PATCH 02/72] new spectral factor first attempt, PVSPEC model for the spectral mismatch factor based on air mass and clearness index --- pvlib/tests/test_pelland.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pvlib/tests/test_pelland.py b/pvlib/tests/test_pelland.py index 50250783c8..b969aa3726 100644 --- a/pvlib/tests/test_pelland.py +++ b/pvlib/tests/test_pelland.py @@ -5,6 +5,7 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, module_type = None, coefficients = None, min_airmass_absolute = 0.58, max_airmass_absolute = 10): + #0.58 -> same as spectral_factor_firstsolar # ============================================================================= # model implemented: https://ieeexplore.ieee.org/document/9300932 # inputs: air mass, clearness index From 82d289227eb9df61703e0681e762dd940693b77d Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 31 May 2024 09:19:52 +0100 Subject: [PATCH 03/72] Update __init__.py --- pvlib/spectrum/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pvlib/spectrum/__init__.py b/pvlib/spectrum/__init__.py index 6c97df978e..3644883670 100644 --- a/pvlib/spectrum/__init__.py +++ b/pvlib/spectrum/__init__.py @@ -6,4 +6,5 @@ spectral_factor_caballero, spectral_factor_firstsolar, spectral_factor_sapm, + test_spectral_factor_pelland ) From cb8a17a5bfa3e725e9dfd5bb92e0b3f9fa21e7f8 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 31 May 2024 09:20:30 +0100 Subject: [PATCH 04/72] Update mismatch.py add new spectral factor (to be tested) --- pvlib/spectrum/mismatch.py | 124 +++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 91bb19f6f0..ce4c06187f 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -571,3 +571,127 @@ def spectral_factor_caballero(precipitable_water, airmass_absolute, aod500, ) modifier = f_AM + f_AOD + f_PW # Eq 5 return modifier + +def test_spectral_factor_pelland(airmass_absolute, clearness_index, + module_type = None, coefficients = None, + min_airmass_absolute = 0.58, + max_airmass_absolute = 10): + r""" + Estimate a technology-specific spectral mismatch modifier from + airmass and clearness index using the Pelland model, which takes the + following form: + + .. math:: + + M = a_1*kc**(a_2)*ama**(a_3), + + where M is the spectral mismatch factor, and a_1, a_2, a_3 are + module-specific coefficients. + + The motivtion for this model is to include the effect of cloud cover on the + spectrum, and thus spectral mismatch. Another motivation is to develop a + simple parameterisation compared with existing models. Model coefficients + are derived using spectral irradiance and other meteorological data from + eight locations. These coefficients for seven modules, available here via + the ``module_type`` parameter, as well as more details on the model, can be + found in Ref. [1]_ + + Parameters + ---------- + airmass_absolute : numeric + absolute (pressure-adjusted) airmass. [unitless] + + clearness_index: numeric + clearness index. [unitless] + + module_type : str, optional + One of the following PV technology strings from [1]_: + + * ``'fs4-1'`` - First Solar series 4-1 and earlier CdTe module. + * ``'fs4-2'`` - First Solar 4-2 and earlier CdTe module. + * ``'monosi'``, - anonymous sc-si module. + * ``'multisi'``, - anonymous mc-si- module. + * ``'cigs'`` - anonymous copper indium gallium selenide module. + * ``'asi'`` - anonymous amorphous silicon module. + + coefficients : array-like, optional + user-defined coefficients, if not using one of the default coefficient + sets via the ``module_type`` parameter. + + Returns + ------- + mismatch: numeric + spectral mismatch factor (unitless) which is multiplied + with broadband irradiance reaching a module's cells to estimate + effective irradiance, i.e., the irradiance that is converted to + electrical current. + + References + ---------- + .. [1] Pelland, S., Beswick, C., Thevenard, D., Côté, A., Pai, A. and + Poissant, Y., 2020, June. Development and testing of the PVSPEC model of + photovoltaic spectral mismatch factor. In 2020 47th IEEE Photovoltaic + Specialists Conference (PVSC) (pp. 1258-1264). IEEE. + :doi:`https://doi.org/10.1109/PVSC45281.2020.9300932` + """ +# ============================================================================= +# --- Screen Input Data --- +# ============================================================================= + #kc + kc = np.atleast_1d(clearness_index) + kc = kc.astype('float64') + if np.min(kc) < 0: + raise ValueError('Clearness index cannot be less than 0') + if np.max(kc) > 1: + raise ValueError('Clearness index cannot be grater than 1') + #ama + if np.max(airmass_absolute) > max_airmass_absolute: + warn('High air mass values greater than 'f'{max_airmass_absolute} '+ + 'in dataset') + # Warn user about exceptionally low ama data + if np.min(airmass_absolute) < min_airmass_absolute: + airmass_absolute = np.maximum(airmass_absolute, min_airmass_absolute ) + warn('Exceptionally low air mass: ' + + 'model not intended for extra-terrestrial use') +# ============================================================================= +# --- Default coefficients --- +# ============================================================================= + _coefficients = {} + _coefficients['multisi'] = ( + 0.9847, -0.05237, 0.03034) + _coefficients['monosi'] = ( + 0.9845, -0.05169, 0.03034) + _coefficients['fs-2'] = ( + 1.002, -0.07108, 0.02465) + _coefficients['fs-4'] = ( + 0.9981, -0.05776, 0.02336) + _coefficients['cigs'] = ( + 0.9791, -0.03904, 0.03096) + _coefficients['asi'] = ( + 1.051, -0.1033, 0.009838) + _coefficients['polysi'] = _coefficients['multisi'] + _coefficients['xsi'] = _coefficients['monosi'] +# ============================================================================= +# --- Check arguments --- +# ============================================================================= + if module_type is not None and coefficients is None: + coefficients = _coefficients[module_type.lower()] + elif module_type is None and coefficients is not None: + pass + elif module_type is None and coefficients is None: + raise TypeError('No valid input provided, both module_type and ' + + 'coefficients are None. module_type can be one of ' + + 'poly-Si, monosi, fs-2, fs-4, cigs, or asi') + else: + raise TypeError('Cannot resolve input, must supply only one of ' + + 'module_type and coefficients. module_type can be ' + + 'one of poly-Si, monosi, fs-2, fs-4, cigs, or asi') +# ============================================================================= +# --- Specral mismatch calculation --- +# ============================================================================= + coeff = coefficients + ama = airmass_absolute + kc = clearness_index + mismatch = coeff[0]*kc**(coeff[1])*ama**(coeff[2]) + + return mismatch \ No newline at end of file From fa555a78b0f6104f84de7c7ee49a5725c4b8a7a1 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 31 May 2024 09:21:09 +0100 Subject: [PATCH 05/72] Delete test_pelland.py delete new py file (and add new model into mismatch.py) --- pvlib/tests/test_pelland.py | 74 ------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 pvlib/tests/test_pelland.py diff --git a/pvlib/tests/test_pelland.py b/pvlib/tests/test_pelland.py deleted file mode 100644 index b969aa3726..0000000000 --- a/pvlib/tests/test_pelland.py +++ /dev/null @@ -1,74 +0,0 @@ -import numpy as np -from warnings import warn - -def spectral_factor_pelland(airmass_absolute, clearness_index, - module_type = None, coefficients = None, - min_airmass_absolute = 0.58, - max_airmass_absolute = 10): - #0.58 -> same as spectral_factor_firstsolar -# ============================================================================= -# model implemented: https://ieeexplore.ieee.org/document/9300932 -# inputs: air mass, clearness index -# coefficients: six modules -# ============================================================================= -# ============================================================================= -# --- Screen Input Data --- -# ============================================================================= - #kc - kc = np.atleast_1d(clearness_index) - kc = kc.astype('float64') - if np.min(kc) < 0: - raise ValueError('Clearness index cannot be less than 0') - if np.max(kc) > 1: - raise ValueError('Clearness index cannot be grater than 1') - #ama - if np.max(airmass_absolute) > max_airmass_absolute: - warn('High air mass values greater than 'f'{max_airmass_absolute} '+ - 'in dataset') - # Warn user about exceptionally low ama data - if np.min(airmass_absolute) < min_airmass_absolute: - airmass_absolute = np.maximum(airmass_absolute, min_airmass_absolute ) - warn('Exceptionally low air mass: ' + - 'model not intended for extra-terrestrial use') -# ============================================================================= -# --- Default coefficients --- -# ============================================================================= - _coefficients = {} - _coefficients['polysi'] = ( - 0.9847, -0.05237, 0.03034) - _coefficients['monosi'] = ( - 0.9845, -0.05169, 0.03034) - _coefficients['fs-2'] = ( - 1.002, -0.07108, 0.02465) - _coefficients['fs-4'] = ( - 0.9981, -0.05776, 0.02336) - _coefficients['cigs'] = ( - 0.9791, -0.03904, 0.03096) - _coefficients['asi'] = ( - 1.051, -0.1033, 0.009838) - _coefficients['multisi'] = _coefficients['polysi'] - _coefficients['xsi'] = _coefficients['monosi'] -# ============================================================================= -# --- Check arguments --- -# ============================================================================= - if module_type is not None and coefficients is None: - coefficients = _coefficients[module_type.lower()] - elif module_type is None and coefficients is not None: - pass - elif module_type is None and coefficients is None: - raise TypeError('No valid input provided, both module_type and ' + - 'coefficients are None. module_type can be one of ' + - 'poly-Si, monosi, fs-2, fs-4, cigs, or asi') - else: - raise TypeError('Cannot resolve input, must supply only one of ' + - 'module_type and coefficients. module_type can be ' + - 'one of poly-Si, monosi, fs-2, fs-4, cigs, or asi') -# ============================================================================= -# --- Specral mismatch calculation --- -# ============================================================================= - coeff = coefficients - ama = airmass_absolute - kc = clearness_index - modifier = coeff[0]*kc**(coeff[1])*ama**(coeff[2]) - - return modifier \ No newline at end of file From 6656fee7a743ce483eedaecac3c65314e402bef9 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 31 May 2024 11:42:48 +0100 Subject: [PATCH 06/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index ce4c06187f..e94e7135eb 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -646,8 +646,8 @@ def test_spectral_factor_pelland(airmass_absolute, clearness_index, raise ValueError('Clearness index cannot be grater than 1') #ama if np.max(airmass_absolute) > max_airmass_absolute: - warn('High air mass values greater than 'f'{max_airmass_absolute} '+ - 'in dataset') + warn('Exceptionally high air mass: ' + + 'values greater than 'f'{max_airmass_absolute} in dataset') # Warn user about exceptionally low ama data if np.min(airmass_absolute) < min_airmass_absolute: airmass_absolute = np.maximum(airmass_absolute, min_airmass_absolute ) @@ -656,6 +656,7 @@ def test_spectral_factor_pelland(airmass_absolute, clearness_index, # ============================================================================= # --- Default coefficients --- # ============================================================================= + #Empirical coefficients from [1]_ _coefficients = {} _coefficients['multisi'] = ( 0.9847, -0.05237, 0.03034) From 56c46283bf16228a92eb9748e3ae8d45ccc324d0 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 31 May 2024 17:47:47 +0100 Subject: [PATCH 07/72] Update mismatch.py correct errors raised --- pvlib/spectrum/mismatch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index e94e7135eb..4b44f6c52f 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -641,9 +641,9 @@ def test_spectral_factor_pelland(airmass_absolute, clearness_index, kc = np.atleast_1d(clearness_index) kc = kc.astype('float64') if np.min(kc) < 0: - raise ValueError('Clearness index cannot be less than 0') + raise ValueError('Clearness index cannot be negative') if np.max(kc) > 1: - raise ValueError('Clearness index cannot be grater than 1') + raise ValueError('Clearness index cannot be >1') #ama if np.max(airmass_absolute) > max_airmass_absolute: warn('Exceptionally high air mass: ' + @@ -680,11 +680,11 @@ def test_spectral_factor_pelland(airmass_absolute, clearness_index, elif module_type is None and coefficients is not None: pass elif module_type is None and coefficients is None: - raise TypeError('No valid input provided, both module_type and ' + + raise ValueError('No valid input provided, both module_type and ' + 'coefficients are None. module_type can be one of ' + 'poly-Si, monosi, fs-2, fs-4, cigs, or asi') else: - raise TypeError('Cannot resolve input, must supply only one of ' + + raise ValueError('Cannot resolve input, must supply only one of ' + 'module_type and coefficients. module_type can be ' + 'one of poly-Si, monosi, fs-2, fs-4, cigs, or asi') # ============================================================================= From acc3998316c25cb5320deb86ca982f9979a7154f Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 31 May 2024 17:48:14 +0100 Subject: [PATCH 08/72] Update test_spectrum.py create new tests for pelland air mass / clearness index spectral correction --- pvlib/tests/test_spectrum.py | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 793eaacfdf..9cab71adaf 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -315,3 +315,56 @@ def test_spectral_factor_caballero_supplied_ambiguous(): with pytest.raises(ValueError): spectrum.spectral_factor_caballero(1, 1, 1, module_type=None, coefficients=None) + +@pytest.mark.parametrize("module_type,expected", [ + ('asi', np.array([1.15534029, 1.1123772, 1.08286684])), + ('fs-2', np.array([1.0694323, 1.04948777, 1.03556288])), + ('fs-4', np.array([1.05234725, 1.037771, 1.0275516])), + ('multisi', np.array([1.03310403, 1.02391703, 1.01744833])), + ('monosi', np.array([1.03225083, 1.02335353, 1.01708734])), + ('cigs', np.array([1.01475834, 1.01143927, 1.00909094])), +]) +def test_spectral_factor_pelland(module_type, expected): + ams = np.array([1.0, 1.5, 2.0]) + kcs = np.array([0.4, 0.6, 0.8]) + out = spectrum.test_spectral_factor_pelland(ams, kcs, + module_type=module_type) + assert np.allclose(expected, out, atol=1e-3) + +def test_spectral_factor_pelland_supplied(): + # use the multisi coeffs + coeffs = ( + 0.9847, -0.05237, 0.03034) + out = spectrum.test_spectral_factor_pelland(1.5, 0.8, coefficients=coeffs) + expected = 1.00982 + assert_allclose(out, expected, atol=1e-3) + +def test_spectral_factor_pelland_supplied_redundant(): + # Error when specifying both module_type and coefficients + coeffs = ( + 0.9847, -0.05237, 0.03034) + with pytest.raises(ValueError): + spectrum.test_spectral_factor_pelland(1.5, 0.8, module_type='multisi', + coefficients=coeffs) + +def test_spectral_factor_pelland_supplied_ambiguous(): + # Error when specifying neither module_type nor coefficients + with pytest.raises(ValueError): + spectrum.test_spectral_factor_pelland(1.5, 0.8, module_type=None, + coefficients=None) + +def test_spectral_factor_pelland_low_airmass(): + with pytest.warns(UserWarning, match='Exceptionally low air mass'): + _ = spectrum.test_spectral_factor_pelland(0.1, 0.8, 'multisi') + +def test_spectral_factor_pelland_high_airmass(): + with pytest.warns(UserWarning, match='Exceptionally high air mass'): + _ = spectrum.test_spectral_factor_pelland(12, 0.8, 'multisi') + +def test_spectral_factor_pelland_low_clearnessindex(): + with pytest.raises(ValueError, match='Clearness index cannot be negative'): + _ = spectrum.test_spectral_factor_pelland(1.5, -0.8, 'multisi') + +def test_spectral_factor_pelland_high_clearnessindex(): + with pytest.raises(ValueError, match='Clearness index cannot be >1'): + _ = spectrum.test_spectral_factor_pelland(1.5, 1.8, 'multisi') \ No newline at end of file From 11b38bdd0d6069369dabd087ee085a86103386c3 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 31 May 2024 18:11:41 +0100 Subject: [PATCH 09/72] Update test_spectrum.py Correct an expected value --- pvlib/tests/test_spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 9cab71adaf..f2c47a7ea1 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -336,7 +336,7 @@ def test_spectral_factor_pelland_supplied(): coeffs = ( 0.9847, -0.05237, 0.03034) out = spectrum.test_spectral_factor_pelland(1.5, 0.8, coefficients=coeffs) - expected = 1.00982 + expected = 1.00860641 assert_allclose(out, expected, atol=1e-3) def test_spectral_factor_pelland_supplied_redundant(): From d36d3b01be32d2d2c62d3d577993cb64de142e56 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 31 May 2024 18:31:31 +0100 Subject: [PATCH 10/72] correct function name --- pvlib/spectrum/__init__.py | 2 +- pvlib/spectrum/mismatch.py | 2 +- pvlib/tests/test_spectrum.py | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pvlib/spectrum/__init__.py b/pvlib/spectrum/__init__.py index 3644883670..4c0b485347 100644 --- a/pvlib/spectrum/__init__.py +++ b/pvlib/spectrum/__init__.py @@ -6,5 +6,5 @@ spectral_factor_caballero, spectral_factor_firstsolar, spectral_factor_sapm, - test_spectral_factor_pelland + spectral_factor_pelland ) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 4b44f6c52f..f393978703 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -572,7 +572,7 @@ def spectral_factor_caballero(precipitable_water, airmass_absolute, aod500, modifier = f_AM + f_AOD + f_PW # Eq 5 return modifier -def test_spectral_factor_pelland(airmass_absolute, clearness_index, +def spectral_factor_pelland(airmass_absolute, clearness_index, module_type = None, coefficients = None, min_airmass_absolute = 0.58, max_airmass_absolute = 10): diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index f2c47a7ea1..c4d019e62d 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -327,7 +327,7 @@ def test_spectral_factor_caballero_supplied_ambiguous(): def test_spectral_factor_pelland(module_type, expected): ams = np.array([1.0, 1.5, 2.0]) kcs = np.array([0.4, 0.6, 0.8]) - out = spectrum.test_spectral_factor_pelland(ams, kcs, + out = spectrum.spectral_factor_pelland(ams, kcs, module_type=module_type) assert np.allclose(expected, out, atol=1e-3) @@ -335,7 +335,7 @@ def test_spectral_factor_pelland_supplied(): # use the multisi coeffs coeffs = ( 0.9847, -0.05237, 0.03034) - out = spectrum.test_spectral_factor_pelland(1.5, 0.8, coefficients=coeffs) + out = spectrum.spectral_factor_pelland(1.5, 0.8, coefficients=coeffs) expected = 1.00860641 assert_allclose(out, expected, atol=1e-3) @@ -344,27 +344,27 @@ def test_spectral_factor_pelland_supplied_redundant(): coeffs = ( 0.9847, -0.05237, 0.03034) with pytest.raises(ValueError): - spectrum.test_spectral_factor_pelland(1.5, 0.8, module_type='multisi', + spectrum.spectral_factor_pelland(1.5, 0.8, module_type='multisi', coefficients=coeffs) def test_spectral_factor_pelland_supplied_ambiguous(): # Error when specifying neither module_type nor coefficients with pytest.raises(ValueError): - spectrum.test_spectral_factor_pelland(1.5, 0.8, module_type=None, + spectrum.spectral_factor_pelland(1.5, 0.8, module_type=None, coefficients=None) def test_spectral_factor_pelland_low_airmass(): with pytest.warns(UserWarning, match='Exceptionally low air mass'): - _ = spectrum.test_spectral_factor_pelland(0.1, 0.8, 'multisi') + _ = spectrum.spectral_factor_pelland(0.1, 0.8, 'multisi') def test_spectral_factor_pelland_high_airmass(): with pytest.warns(UserWarning, match='Exceptionally high air mass'): - _ = spectrum.test_spectral_factor_pelland(12, 0.8, 'multisi') + _ = spectrum.spectral_factor_pelland(12, 0.8, 'multisi') def test_spectral_factor_pelland_low_clearnessindex(): with pytest.raises(ValueError, match='Clearness index cannot be negative'): - _ = spectrum.test_spectral_factor_pelland(1.5, -0.8, 'multisi') + _ = spectrum.spectral_factor_pelland(1.5, -0.8, 'multisi') def test_spectral_factor_pelland_high_clearnessindex(): with pytest.raises(ValueError, match='Clearness index cannot be >1'): - _ = spectrum.test_spectral_factor_pelland(1.5, 1.8, 'multisi') \ No newline at end of file + _ = spectrum.spectral_factor_pelland(1.5, 1.8, 'multisi') \ No newline at end of file From 486ff9835e26b29677c10087258a9ee3c42c2416 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:34:18 +0100 Subject: [PATCH 11/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index f393978703..63d85eb808 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -581,9 +581,9 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, airmass and clearness index using the Pelland model, which takes the following form: - .. math:: + .. math:: - M = a_1*kc**(a_2)*ama**(a_3), + M = a_1*kc**(a_2)*ama**(a_3), where M is the spectral mismatch factor, and a_1, a_2, a_3 are module-specific coefficients. From 28e9339eb10d55cb569a4df4c6cf73387f33823f Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:34:34 +0100 Subject: [PATCH 12/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 63d85eb808..835b9d693f 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -594,7 +594,7 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, are derived using spectral irradiance and other meteorological data from eight locations. These coefficients for seven modules, available here via the ``module_type`` parameter, as well as more details on the model, can be - found in Ref. [1]_ + found in [1]_. Parameters ---------- From b642d059942cfd282ddd7f9abf7de5695ef37aa0 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:38:17 +0100 Subject: [PATCH 13/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 835b9d693f..6501e5cf01 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -695,4 +695,4 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, kc = clearness_index mismatch = coeff[0]*kc**(coeff[1])*ama**(coeff[2]) - return mismatch \ No newline at end of file + return mismatch From e430b279733605fadc62f2475c129da51de96284 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:39:05 +0100 Subject: [PATCH 14/72] Update pvlib/tests/test_spectrum.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/tests/test_spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index c4d019e62d..b5192a0849 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -367,4 +367,4 @@ def test_spectral_factor_pelland_low_clearnessindex(): def test_spectral_factor_pelland_high_clearnessindex(): with pytest.raises(ValueError, match='Clearness index cannot be >1'): - _ = spectrum.spectral_factor_pelland(1.5, 1.8, 'multisi') \ No newline at end of file + _ = spectrum.spectral_factor_pelland(1.5, 1.8, 'multisi') From 83c16839caf6c246e81e3ff0461eefec90589294 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:39:25 +0100 Subject: [PATCH 15/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 6501e5cf01..6ad00b0b43 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -629,10 +629,10 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, References ---------- .. [1] Pelland, S., Beswick, C., Thevenard, D., Côté, A., Pai, A. and - Poissant, Y., 2020, June. Development and testing of the PVSPEC model of - photovoltaic spectral mismatch factor. In 2020 47th IEEE Photovoltaic - Specialists Conference (PVSC) (pp. 1258-1264). IEEE. - :doi:`https://doi.org/10.1109/PVSC45281.2020.9300932` + Poissant, Y., 2020, June. Development and testing of the PVSPEC model of + photovoltaic spectral mismatch factor. In 2020 47th IEEE Photovoltaic + Specialists Conference (PVSC) (pp. 1258-1264). IEEE. + :doi:`https://doi.org/10.1109/PVSC45281.2020.9300932` """ # ============================================================================= # --- Screen Input Data --- From 6812f51235dcf1972d96db928c07e5b50ac297d1 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:49:24 +0100 Subject: [PATCH 16/72] Update spectrum.rst --- .../source/reference/effects_on_pv_system_output/spectrum.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst b/docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst index 8041d8f49b..c98f962c89 100644 --- a/docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst +++ b/docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst @@ -13,3 +13,4 @@ Spectrum spectrum.spectral_factor_caballero spectrum.spectral_factor_firstsolar spectrum.spectral_factor_sapm + spectrum.spectral_factor_pelland From b1ec78f67d5f76b60c8af563cece86e196f865ac Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:25:59 +0100 Subject: [PATCH 17/72] Update mismatch.py update eqn in docs --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 6ad00b0b43..58e58cdf64 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -583,7 +583,7 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, .. math:: - M = a_1*kc**(a_2)*ama**(a_3), + M = a_1\cdot K_c^{a_2}\cdot AM_a^{a_3}, where M is the spectral mismatch factor, and a_1, a_2, a_3 are module-specific coefficients. From 358a532d5dbc32e64d129cb5c1ab7d5c0b3cbfd4 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:32:19 +0100 Subject: [PATCH 18/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 58e58cdf64..bb0fcf6e6f 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -583,7 +583,7 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, .. math:: - M = a_1\cdot K_c^{a_2}\cdot AM_a^{a_3}, + M = a_1 K_c^{a_2} AM_a^{a_3}, where M is the spectral mismatch factor, and a_1, a_2, a_3 are module-specific coefficients. From 67299e3dd88107ed23df78b428fd0914059ece78 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 6 Jun 2024 22:36:40 +0100 Subject: [PATCH 19/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 94 +++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index bb0fcf6e6f..fb7420e3ff 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -44,14 +44,14 @@ def get_example_spectral_response(wavelength=None): ''' # Contributed by Anton Driesse (@adriesse), PV Performance Labs. Aug. 2022 - SR_DATA = np.array([[ 290, 0.00], - [ 350, 0.27], - [ 400, 0.37], - [ 500, 0.52], - [ 650, 0.71], - [ 800, 0.88], - [ 900, 0.97], - [ 950, 1.00], + SR_DATA = np.array([[290, 0.00], + [350, 0.27], + [400, 0.37], + [500, 0.52], + [650, 0.71], + [800, 0.88], + [900, 0.97], + [950, 1.00], [1000, 0.93], [1050, 0.58], [1100, 0.21], @@ -572,25 +572,24 @@ def spectral_factor_caballero(precipitable_water, airmass_absolute, aod500, modifier = f_AM + f_AOD + f_PW # Eq 5 return modifier -def spectral_factor_pelland(airmass_absolute, clearness_index, - module_type = None, coefficients = None, - min_airmass_absolute = 0.58, - max_airmass_absolute = 10): + +def spectral_factor_pelland(airmass_absolute, clearsky_index, + module_type=None, coefficients=None): r""" Estimate a technology-specific spectral mismatch modifier from - airmass and clearness index using the Pelland model, which takes the + airmass and clear sky index using the Pelland model, which takes the following form: - + .. math:: M = a_1 K_c^{a_2} AM_a^{a_3}, - - where M is the spectral mismatch factor, and a_1, a_2, a_3 are + + where M is the spectral mismatch factor, and :math: `a_1, a_2, a_3` are module-specific coefficients. The motivtion for this model is to include the effect of cloud cover on the spectrum, and thus spectral mismatch. Another motivation is to develop a - simple parameterisation compared with existing models. Model coefficients + simple parameterisation compared with exicting models. Model coefficients are derived using spectral irradiance and other meteorological data from eight locations. These coefficients for seven modules, available here via the ``module_type`` parameter, as well as more details on the model, can be @@ -601,8 +600,8 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, airmass_absolute : numeric absolute (pressure-adjusted) airmass. [unitless] - clearness_index: numeric - clearness index. [unitless] + clearsky_index: numeric + clear sky index. [unitless] module_type : str, optional One of the following PV technology strings from [1]_: @@ -626,37 +625,36 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, effective irradiance, i.e., the irradiance that is converted to electrical current. + Notes + ------- + In the PVSPEC model publication, absolute air mass is estimated using the + Kasten and Young model [2]_. The clear sky index, which is the ratio of GHI + to clear sky GHI, uses the ESRA model [3]_ to estimate the clear sky GHI + with monthly Linke turbidity values from [4]_ as inputs. + References ---------- - .. [1] Pelland, S., Beswick, C., Thevenard, D., Côté, A., Pai, A. and - Poissant, Y., 2020, June. Development and testing of the PVSPEC model of - photovoltaic spectral mismatch factor. In 2020 47th IEEE Photovoltaic + .. [1] Pelland, S., Beswick, C., Thevenard, D., Côté, A., Pai, A. and + Poissant, Y., 2020, June. Development and testing of the PVSPEC model of + photovoltaic spectral mismatch factor. In 2020 47th IEEE Photovoltaic Specialists Conference (PVSC) (pp. 1258-1264). IEEE. :doi:`https://doi.org/10.1109/PVSC45281.2020.9300932` + .. [2] Kasten, F. and Young, A.T., 1989. Revised optical air mass tables + and approximation formula. Applied optics, 28(22), pp.4735-4738. + :doi: `https://doi.org/10.1364/AO.28.004735` + .. [3] Rigollier, C., Bauer, O. and Wald, L., 2000. On the clear sky model + of the ESRA—European Solar Radiation Atlas—with respect to the Heliosat + method. Solar energy, 68(1), pp.33-48. + :doi: `https://doi.org/10.1016/S0038-092X(99)00055-9` + .. [4] SoDa website monthly Linke turbidity values: + `http://www.sodapro.com/gl/web-services/atmosphere/linke- + turbidity-factor-ozone-watervapor-and-angstroembeta` """ -# ============================================================================= -# --- Screen Input Data --- -# ============================================================================= - #kc - kc = np.atleast_1d(clearness_index) - kc = kc.astype('float64') - if np.min(kc) < 0: - raise ValueError('Clearness index cannot be negative') - if np.max(kc) > 1: - raise ValueError('Clearness index cannot be >1') - #ama - if np.max(airmass_absolute) > max_airmass_absolute: - warn('Exceptionally high air mass: ' + - 'values greater than 'f'{max_airmass_absolute} in dataset') - # Warn user about exceptionally low ama data - if np.min(airmass_absolute) < min_airmass_absolute: - airmass_absolute = np.maximum(airmass_absolute, min_airmass_absolute ) - warn('Exceptionally low air mass: ' + - 'model not intended for extra-terrestrial use') + # ============================================================================= # --- Default coefficients --- # ============================================================================= - #Empirical coefficients from [1]_ + # Empirical coefficients from [1]_ _coefficients = {} _coefficients['multisi'] = ( 0.9847, -0.05237, 0.03034) @@ -681,18 +679,18 @@ def spectral_factor_pelland(airmass_absolute, clearness_index, pass elif module_type is None and coefficients is None: raise ValueError('No valid input provided, both module_type and ' + - 'coefficients are None. module_type can be one of ' + - 'poly-Si, monosi, fs-2, fs-4, cigs, or asi') + 'coefficients are None. module_type can be one of ' + + 'poly-Si, monosi, fs-2, fs-4, cigs, or asi') else: raise ValueError('Cannot resolve input, must supply only one of ' + - 'module_type and coefficients. module_type can be ' + - 'one of poly-Si, monosi, fs-2, fs-4, cigs, or asi') + 'module_type and coefficients. module_type can be ' + + 'one of poly-Si, monosi, fs-2, fs-4, cigs, or asi') # ============================================================================= # --- Specral mismatch calculation --- # ============================================================================= coeff = coefficients ama = airmass_absolute - kc = clearness_index - mismatch = coeff[0]*kc**(coeff[1])*ama**(coeff[2]) + kc = clearsky_index + mismatch = coeff[0]*np.power(kc, coeff[1])*np.power(ama, coeff[2]) return mismatch From d5c97255225a89d0eca6a22d8ffe9d3851de5878 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:27:00 +0100 Subject: [PATCH 20/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index fb7420e3ff..bf74f65122 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -584,7 +584,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, M = a_1 K_c^{a_2} AM_a^{a_3}, - where M is the spectral mismatch factor, and :math: `a_1, a_2, a_3` are + where M is the spectral mismatch factor, and $a_1, a_2, a_3$ are module-specific coefficients. The motivtion for this model is to include the effect of cloud cover on the @@ -641,14 +641,14 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, :doi:`https://doi.org/10.1109/PVSC45281.2020.9300932` .. [2] Kasten, F. and Young, A.T., 1989. Revised optical air mass tables and approximation formula. Applied optics, 28(22), pp.4735-4738. - :doi: `https://doi.org/10.1364/AO.28.004735` + :doi:`https://doi.org/10.1364/AO.28.004735` .. [3] Rigollier, C., Bauer, O. and Wald, L., 2000. On the clear sky model of the ESRA—European Solar Radiation Atlas—with respect to the Heliosat method. Solar energy, 68(1), pp.33-48. - :doi: `https://doi.org/10.1016/S0038-092X(99)00055-9` + :doi:`https://doi.org/10.1016/S0038-092X(99)00055-9` .. [4] SoDa website monthly Linke turbidity values: - `http://www.sodapro.com/gl/web-services/atmosphere/linke- - turbidity-factor-ozone-watervapor-and-angstroembeta` + `http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity- + factor-ozone-watervapor-and-angstroembeta` """ # ============================================================================= From 0df61ed359ff4fafb949e6de4175cc613dd9f015 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:00:38 +0100 Subject: [PATCH 21/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index bf74f65122..2dc9ce2c95 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -640,11 +640,11 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, Specialists Conference (PVSC) (pp. 1258-1264). IEEE. :doi:`https://doi.org/10.1109/PVSC45281.2020.9300932` .. [2] Kasten, F. and Young, A.T., 1989. Revised optical air mass tables - and approximation formula. Applied optics, 28(22), pp.4735-4738. + and approximation formula. Applied Optics, 28(22), pp.4735-4738. :doi:`https://doi.org/10.1364/AO.28.004735` .. [3] Rigollier, C., Bauer, O. and Wald, L., 2000. On the clear sky model - of the ESRA—European Solar Radiation Atlas—with respect to the Heliosat - method. Solar energy, 68(1), pp.33-48. + of the ESRA—European Solar Radiation Atlas—with respect to the Heliosat + method. Solar energy, 68(1), pp.33-48. :doi:`https://doi.org/10.1016/S0038-092X(99)00055-9` .. [4] SoDa website monthly Linke turbidity values: `http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity- From 0d41306d645926c27f473f419f2007d61bd363d7 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:06:48 +0100 Subject: [PATCH 22/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 2dc9ce2c95..a883569ccd 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -584,7 +584,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, M = a_1 K_c^{a_2} AM_a^{a_3}, - where M is the spectral mismatch factor, and $a_1, a_2, a_3$ are + where M is the spectral mismatch factor, and $$a_1, a_2, a_3$$ are module-specific coefficients. The motivtion for this model is to include the effect of cloud cover on the From 24e05b81cb141e657e09f3c741f7cd6a877d152c Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:23:41 +0100 Subject: [PATCH 23/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index a883569ccd..3274b13b20 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -584,7 +584,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, M = a_1 K_c^{a_2} AM_a^{a_3}, - where M is the spectral mismatch factor, and $$a_1, a_2, a_3$$ are + where M is the spectral mismatch factor, and :math:`a_1, a_2, a_3` are module-specific coefficients. The motivtion for this model is to include the effect of cloud cover on the From 7b4f15dbb53d0cdbfd11a483c351509ce9b5e79f Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 12:02:56 +0100 Subject: [PATCH 24/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 3274b13b20..6c95c8dc0f 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -626,7 +626,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, electrical current. Notes - ------- + ----- In the PVSPEC model publication, absolute air mass is estimated using the Kasten and Young model [2]_. The clear sky index, which is the ratio of GHI to clear sky GHI, uses the ESRA model [3]_ to estimate the clear sky GHI From 3bd0b75d325037702eebd2a317e6ba369fc3eb70 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:26:30 +0100 Subject: [PATCH 25/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 6c95c8dc0f..fe01640014 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -584,7 +584,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, M = a_1 K_c^{a_2} AM_a^{a_3}, - where M is the spectral mismatch factor, and :math:`a_1, a_2, a_3` are + where :math:`M` is the spectral mismatch factor, and :math:`a_1, a_2, a_3` are module-specific coefficients. The motivtion for this model is to include the effect of cloud cover on the From f0706dec8abd655a6d329dd904676f6479841a62 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:27:29 +0100 Subject: [PATCH 26/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index fe01640014..7080fc19f3 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -638,7 +638,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, Poissant, Y., 2020, June. Development and testing of the PVSPEC model of photovoltaic spectral mismatch factor. In 2020 47th IEEE Photovoltaic Specialists Conference (PVSC) (pp. 1258-1264). IEEE. - :doi:`https://doi.org/10.1109/PVSC45281.2020.9300932` + :doi:`10.1109/PVSC45281.2020.9300932` .. [2] Kasten, F. and Young, A.T., 1989. Revised optical air mass tables and approximation formula. Applied Optics, 28(22), pp.4735-4738. :doi:`https://doi.org/10.1364/AO.28.004735` From 691936499aa3c704dcc9a89cdb2e734d7f9937ec Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:27:43 +0100 Subject: [PATCH 27/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 7080fc19f3..7a1eddd97f 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -648,7 +648,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, :doi:`https://doi.org/10.1016/S0038-092X(99)00055-9` .. [4] SoDa website monthly Linke turbidity values: `http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity- - factor-ozone-watervapor-and-angstroembeta` + factor-ozone-watervapor-and-angstroembeta`_. """ # ============================================================================= From ed13838c185282ea71615bf100c0de22052b0750 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:56:51 +0100 Subject: [PATCH 28/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 6c95c8dc0f..480ec9c29e 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -577,19 +577,11 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, module_type=None, coefficients=None): r""" Estimate a technology-specific spectral mismatch modifier from - airmass and clear sky index using the Pelland model, which takes the - following form: + airmass and clear sky index using the Pelland model. - .. math:: - - M = a_1 K_c^{a_2} AM_a^{a_3}, - - where M is the spectral mismatch factor, and :math:`a_1, a_2, a_3` are - module-specific coefficients. - - The motivtion for this model is to include the effect of cloud cover on the - spectrum, and thus spectral mismatch. Another motivation is to develop a - simple parameterisation compared with exicting models. Model coefficients + The motivation for this model is to include the effects of cloud cover on + the spectrum, and thus spectral mismatch. Another motivation is to develop + a simple parameterisation compared with existing models. Model coefficients are derived using spectral irradiance and other meteorological data from eight locations. These coefficients for seven modules, available here via the ``module_type`` parameter, as well as more details on the model, can be @@ -627,10 +619,19 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, Notes ----- - In the PVSPEC model publication, absolute air mass is estimated using the - Kasten and Young model [2]_. The clear sky index, which is the ratio of GHI - to clear sky GHI, uses the ESRA model [3]_ to estimate the clear sky GHI - with monthly Linke turbidity values from [4]_ as inputs. + The Pelland model expresses the spectral mismatch factor as a function + of absolute air mass and the clear sky index that takes the following form: + + .. math:: + + M = a_1 K_c^{a_2} AM_a^{a_3}, + + where M is the spectral mismatch factor, and :math:`a_1, a_2, a_3` are + module-specific coefficients. In the PVSPEC model publication, absolute air + mass is estimated using the Kasten and Young model [2]_. The clear sky + index, which is the ratio of GHI to clear sky GHI, uses the ESRA model [3]_ + to estimate the clear sky GHI with monthly Linke turbidity values from [4]_ + as inputs. References ---------- From 7c50791934444dd98544b8998174923497f56aa3 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:25:46 +0100 Subject: [PATCH 29/72] Update test_spectrum.py fix indentation and white spaces, change clearness to clearsky --- pvlib/tests/test_spectrum.py | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index b5192a0849..b7b0bd0201 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -316,6 +316,7 @@ def test_spectral_factor_caballero_supplied_ambiguous(): spectrum.spectral_factor_caballero(1, 1, 1, module_type=None, coefficients=None) + @pytest.mark.parametrize("module_type,expected", [ ('asi', np.array([1.15534029, 1.1123772, 1.08286684])), ('fs-2', np.array([1.0694323, 1.04948777, 1.03556288])), @@ -328,9 +329,10 @@ def test_spectral_factor_pelland(module_type, expected): ams = np.array([1.0, 1.5, 2.0]) kcs = np.array([0.4, 0.6, 0.8]) out = spectrum.spectral_factor_pelland(ams, kcs, - module_type=module_type) + module_type=module_type) assert np.allclose(expected, out, atol=1e-3) + def test_spectral_factor_pelland_supplied(): # use the multisi coeffs coeffs = ( @@ -338,33 +340,39 @@ def test_spectral_factor_pelland_supplied(): out = spectrum.spectral_factor_pelland(1.5, 0.8, coefficients=coeffs) expected = 1.00860641 assert_allclose(out, expected, atol=1e-3) - + + def test_spectral_factor_pelland_supplied_redundant(): # Error when specifying both module_type and coefficients coeffs = ( 0.9847, -0.05237, 0.03034) with pytest.raises(ValueError): spectrum.spectral_factor_pelland(1.5, 0.8, module_type='multisi', - coefficients=coeffs) + coefficients=coeffs) + def test_spectral_factor_pelland_supplied_ambiguous(): # Error when specifying neither module_type nor coefficients with pytest.raises(ValueError): spectrum.spectral_factor_pelland(1.5, 0.8, module_type=None, - coefficients=None) - + coefficients=None) + + def test_spectral_factor_pelland_low_airmass(): with pytest.warns(UserWarning, match='Exceptionally low air mass'): - _ = spectrum.spectral_factor_pelland(0.1, 0.8, 'multisi') + _ = spectrum.spectral_factor_pelland(0.1, 0.8, 'multisi') + def test_spectral_factor_pelland_high_airmass(): with pytest.warns(UserWarning, match='Exceptionally high air mass'): _ = spectrum.spectral_factor_pelland(12, 0.8, 'multisi') - -def test_spectral_factor_pelland_low_clearnessindex(): - with pytest.raises(ValueError, match='Clearness index cannot be negative'): - _ = spectrum.spectral_factor_pelland(1.5, -0.8, 'multisi') -def test_spectral_factor_pelland_high_clearnessindex(): - with pytest.raises(ValueError, match='Clearness index cannot be >1'): + +def test_spectral_factor_pelland_low_clearskyindex(): + with pytest.raises(ValueError, match='Clearsky index cannot be negative'): + _ = spectrum.spectral_factor_pelland(1.5, -0.8, 'multisi') + + +def test_spectral_factor_pelland_high_clearskysindex(): + with pytest.raises(ValueError, match='Clearsky index cannot be >1'): _ = spectrum.spectral_factor_pelland(1.5, 1.8, 'multisi') From e7c032b35b4ba8280f429b19c1abef4b72f34962 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:26:15 +0100 Subject: [PATCH 30/72] Update test_spectrum.py remove data screens no longer required --- pvlib/tests/test_spectrum.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index b7b0bd0201..2aab55aadc 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -356,23 +356,3 @@ def test_spectral_factor_pelland_supplied_ambiguous(): with pytest.raises(ValueError): spectrum.spectral_factor_pelland(1.5, 0.8, module_type=None, coefficients=None) - - -def test_spectral_factor_pelland_low_airmass(): - with pytest.warns(UserWarning, match='Exceptionally low air mass'): - _ = spectrum.spectral_factor_pelland(0.1, 0.8, 'multisi') - - -def test_spectral_factor_pelland_high_airmass(): - with pytest.warns(UserWarning, match='Exceptionally high air mass'): - _ = spectrum.spectral_factor_pelland(12, 0.8, 'multisi') - - -def test_spectral_factor_pelland_low_clearskyindex(): - with pytest.raises(ValueError, match='Clearsky index cannot be negative'): - _ = spectrum.spectral_factor_pelland(1.5, -0.8, 'multisi') - - -def test_spectral_factor_pelland_high_clearskysindex(): - with pytest.raises(ValueError, match='Clearsky index cannot be >1'): - _ = spectrum.spectral_factor_pelland(1.5, 1.8, 'multisi') From a7f99090d04e662345771d6d5929e08b52892682 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:44:21 +0100 Subject: [PATCH 31/72] Update mismatch.py trailing white space --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 4664575690..eeadead7e0 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -584,7 +584,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, motivation is to develop a simple parameterisation compared with existing models. Model coefficients are derived using spectral irradiance and other meteorological data from eight locations. These coefficients for seven - modules, available here via the ``module_type`` parameter, as well as more + modules, available here via the ``module_type`` parameter, as well as more details on the model, can be found in [1]_. Parameters From 4616dc2cb1ccae34e26e8841de7a68f13d31bef9 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:15:05 +0100 Subject: [PATCH 32/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Kevin Anderson --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index eeadead7e0..ad352091be 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -681,7 +681,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, elif module_type is None and coefficients is None: raise ValueError('No valid input provided, both module_type and ' + 'coefficients are None. module_type can be one of ' + - 'poly-Si, monosi, fs-2, fs-4, cigs, or asi') + ", ".join(_coefficients.keys())) else: raise ValueError('Cannot resolve input, must supply only one of ' + 'module_type and coefficients. module_type can be ' + From bd845371579eb3e3f15ff668baa4e8b67c5aae0a Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:15:52 +0100 Subject: [PATCH 33/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index eeadead7e0..e91c48117e 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -652,10 +652,6 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, factor-ozone-watervapor-and-angstroembeta`_. """ -# ============================================================================= -# --- Default coefficients --- -# ============================================================================= - # Empirical coefficients from [1]_ _coefficients = {} _coefficients['multisi'] = ( 0.9847, -0.05237, 0.03034) @@ -669,11 +665,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, 0.9791, -0.03904, 0.03096) _coefficients['asi'] = ( 1.051, -0.1033, 0.009838) - _coefficients['polysi'] = _coefficients['multisi'] - _coefficients['xsi'] = _coefficients['monosi'] -# ============================================================================= -# --- Check arguments --- -# ============================================================================= + if module_type is not None and coefficients is None: coefficients = _coefficients[module_type.lower()] elif module_type is None and coefficients is not None: @@ -686,9 +678,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, raise ValueError('Cannot resolve input, must supply only one of ' + 'module_type and coefficients. module_type can be ' + 'one of poly-Si, monosi, fs-2, fs-4, cigs, or asi') -# ============================================================================= -# --- Specral mismatch calculation --- -# ============================================================================= + coeff = coefficients ama = airmass_absolute kc = clearsky_index From b6a827b737cd9bbd4f55d08cf7cf8d6460ff0d99 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:21:21 +0100 Subject: [PATCH 34/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 8b37f84ba7..b563666737 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -677,7 +677,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, else: raise ValueError('Cannot resolve input, must supply only one of ' + 'module_type and coefficients. module_type can be ' + - 'one of poly-Si, monosi, fs-2, fs-4, cigs, or asi') + 'one of' ", ".join(_coefficients.keys())) coeff = coefficients ama = airmass_absolute From 3df83c3cdb2a9aac41a0d566f0340e1838977fbe Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:22:26 +0100 Subject: [PATCH 35/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Kevin Anderson --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index ad352091be..90e993ecc2 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -599,7 +599,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, One of the following PV technology strings from [1]_: * ``'fs4-1'`` - First Solar series 4-1 and earlier CdTe module. - * ``'fs4-2'`` - First Solar 4-2 and earlier CdTe module. + * ``'fs4-2'`` - First Solar 4-2 and later CdTe module. * ``'monosi'``, - anonymous sc-si module. * ``'multisi'``, - anonymous mc-si- module. * ``'cigs'`` - anonymous copper indium gallium selenide module. From f468db8e4062d2d8dc4373a765b01ce177934383 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:22:36 +0100 Subject: [PATCH 36/72] Update pvlib/tests/test_spectrum.py Co-authored-by: Kevin Anderson --- pvlib/tests/test_spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 2aab55aadc..6f61a2d4b5 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -346,7 +346,7 @@ def test_spectral_factor_pelland_supplied_redundant(): # Error when specifying both module_type and coefficients coeffs = ( 0.9847, -0.05237, 0.03034) - with pytest.raises(ValueError): + with pytest.raises(ValueError, match='supply only one of'): spectrum.spectral_factor_pelland(1.5, 0.8, module_type='multisi', coefficients=coeffs) From 43727b7fd8ebd1ea3c26623efec69a1f39ed0001 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:22:51 +0100 Subject: [PATCH 37/72] Update pvlib/tests/test_spectrum.py Co-authored-by: Kevin Anderson --- pvlib/tests/test_spectrum.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 6f61a2d4b5..46c357171e 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -344,8 +344,7 @@ def test_spectral_factor_pelland_supplied(): def test_spectral_factor_pelland_supplied_redundant(): # Error when specifying both module_type and coefficients - coeffs = ( - 0.9847, -0.05237, 0.03034) + coeffs = (0.9847, -0.05237, 0.03034) with pytest.raises(ValueError, match='supply only one of'): spectrum.spectral_factor_pelland(1.5, 0.8, module_type='multisi', coefficients=coeffs) From 8e53d561d78f8c5699936eba65354e47a99b85f1 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:33:02 +0100 Subject: [PATCH 38/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index e2f93d6b87..ca01d75223 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -653,18 +653,12 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, """ _coefficients = {} - _coefficients['multisi'] = ( - 0.9847, -0.05237, 0.03034) - _coefficients['monosi'] = ( - 0.9845, -0.05169, 0.03034) - _coefficients['fs-2'] = ( - 1.002, -0.07108, 0.02465) - _coefficients['fs-4'] = ( - 0.9981, -0.05776, 0.02336) - _coefficients['cigs'] = ( - 0.9791, -0.03904, 0.03096) - _coefficients['asi'] = ( - 1.051, -0.1033, 0.009838) + _coefficients['multisi'] = (0.9847, -0.05237, 0.03034) + _coefficients['monosi'] = (0.9845, -0.05169, 0.03034) + _coefficients['fs-2'] = (1.002, -0.07108, 0.02465) + _coefficients['fs-4'] = (0.9981, -0.05776, 0.02336) + _coefficients['cigs'] = (0.9791, -0.03904, 0.03096) + _coefficients['asi'] = (1.051, -0.1033, 0.009838) if module_type is not None and coefficients is None: coefficients = _coefficients[module_type.lower()] From da1780fe23d4754eb45f3142c94842b092a04778 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:34:52 +0100 Subject: [PATCH 39/72] Update pvlib/tests/test_spectrum.py Co-authored-by: Kevin Anderson --- pvlib/tests/test_spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 46c357171e..d8402dd94a 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -352,6 +352,6 @@ def test_spectral_factor_pelland_supplied_redundant(): def test_spectral_factor_pelland_supplied_ambiguous(): # Error when specifying neither module_type nor coefficients - with pytest.raises(ValueError): + with pytest.raises(ValueError, match='No valid input provided'): spectrum.spectral_factor_pelland(1.5, 0.8, module_type=None, coefficients=None) From 15e328c4a129ba8b87195e1b90f40ed576428ccb Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:40:21 +0100 Subject: [PATCH 40/72] name change --- .../effects_on_pv_system_output/spectrum.rst | 2 +- pvlib/spectrum/__init__.py | 2 +- pvlib/spectrum/mismatch.py | 6 +-- pvlib/tests/test_spectrum.py | 52 +++++++++---------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst b/docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst index c98f962c89..347658454c 100644 --- a/docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst +++ b/docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst @@ -13,4 +13,4 @@ Spectrum spectrum.spectral_factor_caballero spectrum.spectral_factor_firstsolar spectrum.spectral_factor_sapm - spectrum.spectral_factor_pelland + spectrum.spectral_factor_pvspec diff --git a/pvlib/spectrum/__init__.py b/pvlib/spectrum/__init__.py index 4c0b485347..f2fe91306d 100644 --- a/pvlib/spectrum/__init__.py +++ b/pvlib/spectrum/__init__.py @@ -6,5 +6,5 @@ spectral_factor_caballero, spectral_factor_firstsolar, spectral_factor_sapm, - spectral_factor_pelland + spectral_factor_pvspec ) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index ca01d75223..3f63f44d18 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -573,8 +573,8 @@ def spectral_factor_caballero(precipitable_water, airmass_absolute, aod500, return modifier -def spectral_factor_pelland(airmass_absolute, clearsky_index, - module_type=None, coefficients=None): +def spectral_factor_pvspec(airmass_absolute, clearsky_index, + module_type=None, coefficients=None): r""" Estimate a technology-specific spectral mismatch modifier from absolute airmass and clear sky index using the Pelland model. @@ -619,7 +619,7 @@ def spectral_factor_pelland(airmass_absolute, clearsky_index, Notes ----- - The Pelland model parameterises the spectral mismatch factor as a function + The PVSPEC model parameterises the spectral mismatch factor as a function of absolute air mass and the clear sky index as follows: .. math:: diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 46c357171e..38879ff0a3 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -175,25 +175,25 @@ def test_calc_spectral_mismatch_field(spectrl2_data): @pytest.mark.parametrize("module_type,expect", [ ('cdte', np.array( - [[ 0.99051020, 0.97640320, 0.93975028], - [ 1.02928735, 1.01881074, 0.98578821], - [ 1.04750335, 1.03814456, 1.00623986]])), + [[0.99051020, 0.97640320, 0.93975028], + [1.02928735, 1.01881074, 0.98578821], + [1.04750335, 1.03814456, 1.00623986]])), ('monosi', np.array( - [[ 0.97769770, 1.02043409, 1.03574032], - [ 0.98630905, 1.03055092, 1.04736262], - [ 0.98828494, 1.03299036, 1.05026561]])), + [[0.97769770, 1.02043409, 1.03574032], + [0.98630905, 1.03055092, 1.04736262], + [0.98828494, 1.03299036, 1.05026561]])), ('polysi', np.array( - [[ 0.97704080, 1.01705849, 1.02613202], - [ 0.98992828, 1.03173953, 1.04260662], - [ 0.99352435, 1.03588785, 1.04730718]])), + [[0.97704080, 1.01705849, 1.02613202], + [0.98992828, 1.03173953, 1.04260662], + [0.99352435, 1.03588785, 1.04730718]])), ('cigs', np.array( - [[ 0.97459190, 1.02821696, 1.05067895], - [ 0.97529378, 1.02967497, 1.05289307], - [ 0.97269159, 1.02730558, 1.05075651]])), + [[0.97459190, 1.02821696, 1.05067895], + [0.97529378, 1.02967497, 1.05289307], + [0.97269159, 1.02730558, 1.05075651]])), ('asi', np.array( - [[ 1.05552750, 0.87707583, 0.72243772], - [ 1.11225204, 0.93665901, 0.78487953], - [ 1.14555295, 0.97084011, 0.81994083]])) + [[1.05552750, 0.87707583, 0.72243772], + [1.11225204, 0.93665901, 0.78487953], + [1.14555295, 0.97084011, 0.81994083]])) ]) def test_spectral_factor_firstsolar(module_type, expect): ams = np.array([1, 3, 5]) @@ -325,33 +325,33 @@ def test_spectral_factor_caballero_supplied_ambiguous(): ('monosi', np.array([1.03225083, 1.02335353, 1.01708734])), ('cigs', np.array([1.01475834, 1.01143927, 1.00909094])), ]) -def test_spectral_factor_pelland(module_type, expected): +def test_spectral_factor_pvspec(module_type, expected): ams = np.array([1.0, 1.5, 2.0]) kcs = np.array([0.4, 0.6, 0.8]) - out = spectrum.spectral_factor_pelland(ams, kcs, - module_type=module_type) + out = spectrum.spectral_factor_pvspec(ams, kcs, + module_type=module_type) assert np.allclose(expected, out, atol=1e-3) -def test_spectral_factor_pelland_supplied(): +def test_spectral_factor_pvspec_supplied(): # use the multisi coeffs coeffs = ( 0.9847, -0.05237, 0.03034) - out = spectrum.spectral_factor_pelland(1.5, 0.8, coefficients=coeffs) + out = spectrum.spectral_factor_pvspec(1.5, 0.8, coefficients=coeffs) expected = 1.00860641 assert_allclose(out, expected, atol=1e-3) -def test_spectral_factor_pelland_supplied_redundant(): +def test_spectral_factor_pvspec_supplied_redundant(): # Error when specifying both module_type and coefficients coeffs = (0.9847, -0.05237, 0.03034) with pytest.raises(ValueError, match='supply only one of'): - spectrum.spectral_factor_pelland(1.5, 0.8, module_type='multisi', - coefficients=coeffs) + spectrum.spectral_factor_pvspec(1.5, 0.8, module_type='multisi', + coefficients=coeffs) -def test_spectral_factor_pelland_supplied_ambiguous(): +def test_spectral_factor_pvspec_supplied_ambiguous(): # Error when specifying neither module_type nor coefficients with pytest.raises(ValueError): - spectrum.spectral_factor_pelland(1.5, 0.8, module_type=None, - coefficients=None) + spectrum.spectral_factor_pvspec(1.5, 0.8, module_type=None, + coefficients=None) From cc4a3d1c4debb4123c86605ca9a077e3197c9865 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:46:05 +0100 Subject: [PATCH 41/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Kevin Anderson --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 3f63f44d18..51faab1d9b 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -628,7 +628,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, where M is the spectral mismatch factor, and :math:`a_1, a_2, a_3` are module-specific coefficients. In the PVSPEC model publication, absolute air - mass is estimated using the Kasten and Young model [2]_. The clear sky + mass is estimated starting from the Kasten and Young relative air mass [2]_. The clear sky index, which is the ratio of GHI to clear sky GHI, uses the ESRA model [3]_ to estimate the clear sky GHI with monthly Linke turbidity values from [4]_ as inputs. From 3d5eab623ad33bba2c2aeb65d4db675ff26333da Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:47:17 +0100 Subject: [PATCH 42/72] Update test_spectrum.py --- pvlib/tests/test_spectrum.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 75771689d8..5888d8eb7c 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -352,9 +352,6 @@ def test_spectral_factor_pvspec_supplied_redundant(): def test_spectral_factor_pvspec_supplied_ambiguous(): # Error when specifying neither module_type nor coefficients - with pytest.raises(ValueError): - spectrum.spectral_factor_pvspec(1.5, 0.8, module_type=None, - coefficients=None) with pytest.raises(ValueError, match='No valid input provided'): spectrum.spectral_factor_pelland(1.5, 0.8, module_type=None, coefficients=None) From 70f86c3e4528c9d77ef491cb9daddf0d1e598384 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 09:50:07 +0100 Subject: [PATCH 43/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 51faab1d9b..748279fc6f 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -628,10 +628,10 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, where M is the spectral mismatch factor, and :math:`a_1, a_2, a_3` are module-specific coefficients. In the PVSPEC model publication, absolute air - mass is estimated starting from the Kasten and Young relative air mass [2]_. The clear sky - index, which is the ratio of GHI to clear sky GHI, uses the ESRA model [3]_ - to estimate the clear sky GHI with monthly Linke turbidity values from [4]_ - as inputs. + mass is estimated starting from the Kasten and Young relative air mass + [2]_. The clear sky index, which is the ratio of GHI to clear sky GHI, uses + the ESRA model [3]_ to estimate the clear sky GHI with monthly Linke + turbidity values from [4]_ as inputs. References ---------- From 332fed5187debd8deca10bc1379780b3661e90b7 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 11:11:40 +0100 Subject: [PATCH 44/72] Update test_spectrum.py --- pvlib/tests/test_spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 5888d8eb7c..517346298f 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -353,5 +353,5 @@ def test_spectral_factor_pvspec_supplied_redundant(): def test_spectral_factor_pvspec_supplied_ambiguous(): # Error when specifying neither module_type nor coefficients with pytest.raises(ValueError, match='No valid input provided'): - spectrum.spectral_factor_pelland(1.5, 0.8, module_type=None, + spectrum.spectral_factor_pvpsec(1.5, 0.8, module_type=None, coefficients=None) From 974e098437ce99dcf0b16b3d9e6b1f42195c5c8f Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 11:13:59 +0100 Subject: [PATCH 45/72] Update test_spectrum.py --- pvlib/tests/test_spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 517346298f..35b7d6654d 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -353,5 +353,5 @@ def test_spectral_factor_pvspec_supplied_redundant(): def test_spectral_factor_pvspec_supplied_ambiguous(): # Error when specifying neither module_type nor coefficients with pytest.raises(ValueError, match='No valid input provided'): - spectrum.spectral_factor_pvpsec(1.5, 0.8, module_type=None, + spectrum.spectral_factor_pvspec(1.5, 0.8, module_type=None, coefficients=None) From cc054454470643564fa2038a426ad342bd2c0a5b Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 11:14:17 +0100 Subject: [PATCH 46/72] Update test_spectrum.py --- pvlib/tests/test_spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 35b7d6654d..b95743094e 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -354,4 +354,4 @@ def test_spectral_factor_pvspec_supplied_ambiguous(): # Error when specifying neither module_type nor coefficients with pytest.raises(ValueError, match='No valid input provided'): spectrum.spectral_factor_pvspec(1.5, 0.8, module_type=None, - coefficients=None) + coefficients=None) From b36116d837ec003dfdb1e6c1603fc02d37c1c8ce Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 8 Jun 2024 18:53:52 +0100 Subject: [PATCH 47/72] Update test_spectrum.py --- pvlib/tests/test_spectrum.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index b95743094e..36cac0695c 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -318,16 +318,16 @@ def test_spectral_factor_caballero_supplied_ambiguous(): @pytest.mark.parametrize("module_type,expected", [ - ('asi', np.array([1.15534029, 1.1123772, 1.08286684])), - ('fs-2', np.array([1.0694323, 1.04948777, 1.03556288])), - ('fs-4', np.array([1.05234725, 1.037771, 1.0275516])), - ('multisi', np.array([1.03310403, 1.02391703, 1.01744833])), - ('monosi', np.array([1.03225083, 1.02335353, 1.01708734])), - ('cigs', np.array([1.01475834, 1.01143927, 1.00909094])), + ('asi', np.array([1.15534029, 1.1123772, 1.08286684, 1.01915462])), + ('fs-2', np.array([1.0694323, 1.04948777, 1.03556288, 0.9881471])), + ('fs-4', np.array([1.05234725, 1.037771, 1.0275516, 0.98820533])), + ('multisi', np.array([1.03310403, 1.02391703, 1.01744833, 0.97947605])), + ('monosi', np.array([1.03225083, 1.02335353, 1.01708734, 0.97950110])), + ('cigs', np.array([1.01475834, 1.01143927, 1.00909094, 0.97852966])), ]) def test_spectral_factor_pvspec(module_type, expected): - ams = np.array([1.0, 1.5, 2.0]) - kcs = np.array([0.4, 0.6, 0.8]) + ams = np.array([1.0, 1.5, 2.0, 1.5]) + kcs = np.array([0.4, 0.6, 0.8, 1.4]) out = spectrum.spectral_factor_pvspec(ams, kcs, module_type=module_type) assert np.allclose(expected, out, atol=1e-8) From c09e8b81fc0bd8eef5966c624893ab4b23ebf6be Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sun, 9 Jun 2024 09:26:51 +0100 Subject: [PATCH 48/72] Update test_spectrum.py add series test --- pvlib/tests/test_spectrum.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 36cac0695c..6319094c33 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -332,6 +332,29 @@ def test_spectral_factor_pvspec(module_type, expected): module_type=module_type) assert np.allclose(expected, out, atol=1e-8) +@pytest.mark.parametrize("module_type,expected", [ + ('asi', pd.Series([1.15534029, 1.1123772, 1.08286684, 1.01915462])), + ('fs-2', pd.Series([1.0694323, 1.04948777, 1.03556288, 0.9881471])), + ('fs-4', pd.Series([1.05234725, 1.037771, 1.0275516, 0.98820533])), + ('multisi', pd.Series([1.03310403, 1.02391703, 1.01744833, 0.97947605])), + ('monosi', pd.Series([1.03225083, 1.02335353, 1.01708734, 0.97950110])), + ('cigs', pd.Series([1.01475834, 1.01143927, 1.00909094, 0.97852966])), +]) +def test_spectral_factor_pvspec_series(module_type, expected): + ams = pd.Series([1.0, 1.5, 2.0, 1.5]) + kcs = pd.Series([0.4, 0.6, 0.8, 1.4]) + out = spectrum.spectral_factor_pvspec(ams, kcs, + module_type=module_type) + out = pd.Series(out) + assert np.allclose(expected, out, atol=1e-8) + +def test_spectral_factor_pvspec_supplied(): + # use the multisi coeffs + coeffs = ( + 0.9847, -0.05237, 0.03034) + out = spectrum.spectral_factor_pvspec(1.5, 0.8, coefficients=coeffs) + expected = 1.00860641 + assert_allclose(out, expected, atol=1e-8) def test_spectral_factor_pvspec_supplied(): # use the multisi coeffs From bd133ef5da93fb0e70fb2834b74f76abf55cfe80 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sun, 9 Jun 2024 09:32:46 +0100 Subject: [PATCH 49/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 748279fc6f..71ae9f0153 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -577,7 +577,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, module_type=None, coefficients=None): r""" Estimate a technology-specific spectral mismatch modifier from absolute - airmass and clear sky index using the Pelland model. + airmass and clear sky index using the PVSPEC model. The motivation for this model is to include the effects of cloud cover on the spectrum, and thus spectral mismatch factor estimation. Another From 1a7416c9e69c612b9158916aeee800b17f8f4264 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:22:05 +0200 Subject: [PATCH 50/72] Update test_spectrum.py --- pvlib/tests/test_spectrum.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 6319094c33..a4f8e6a092 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -8,6 +8,7 @@ SPECTRL2_TEST_DATA = DATA_DIR / 'spectrl2_example_spectra.csv' + @pytest.fixture def spectrl2_data(): # reference spectra generated with solar_utils==0.3 @@ -332,6 +333,7 @@ def test_spectral_factor_pvspec(module_type, expected): module_type=module_type) assert np.allclose(expected, out, atol=1e-8) + @pytest.mark.parametrize("module_type,expected", [ ('asi', pd.Series([1.15534029, 1.1123772, 1.08286684, 1.01915462])), ('fs-2', pd.Series([1.0694323, 1.04948777, 1.03556288, 0.9881471])), @@ -347,19 +349,11 @@ def test_spectral_factor_pvspec_series(module_type, expected): module_type=module_type) out = pd.Series(out) assert np.allclose(expected, out, atol=1e-8) - -def test_spectral_factor_pvspec_supplied(): - # use the multisi coeffs - coeffs = ( - 0.9847, -0.05237, 0.03034) - out = spectrum.spectral_factor_pvspec(1.5, 0.8, coefficients=coeffs) - expected = 1.00860641 - assert_allclose(out, expected, atol=1e-8) + def test_spectral_factor_pvspec_supplied(): # use the multisi coeffs - coeffs = ( - 0.9847, -0.05237, 0.03034) + coeffs = (0.9847, -0.05237, 0.03034) out = spectrum.spectral_factor_pvspec(1.5, 0.8, coefficients=coeffs) expected = 1.00860641 assert_allclose(out, expected, atol=1e-8) From 35b1411a78aec9be1c417af732a07f8c93234b16 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 13:06:37 +0200 Subject: [PATCH 51/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Ioannis Sifnaios <88548539+IoannisSifnaios@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 71ae9f0153..e01179a48f 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -636,7 +636,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, References ---------- .. [1] Pelland, S., Beswick, C., Thevenard, D., Côté, A., Pai, A. and - Poissant, Y., 2020, June. Development and testing of the PVSPEC model of + Poissant, Y., 2020. Development and testing of the PVSPEC model of photovoltaic spectral mismatch factor. In 2020 47th IEEE Photovoltaic Specialists Conference (PVSC) (pp. 1258-1264). IEEE. :doi:`10.1109/PVSC45281.2020.9300932` From b0385a1bb2946e656f292ba2d7cce1f4553cdbb4 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 13:09:46 +0200 Subject: [PATCH 52/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index e01179a48f..3b7c6f1fe8 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -583,9 +583,9 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, the spectrum, and thus spectral mismatch factor estimation. Another motivation is to develop a simple parameterisation compared with existing models. Model coefficients are derived using spectral irradiance and other - meteorological data from eight locations. These coefficients for seven - modules, available here via the ``module_type`` parameter, as well as more - details on the model, can be found in [1]_. + meteorological data from eight locations. These coefficients for six + modules are available here via the ``module_type`` parameter. More details + on the model, can be found in [1]_. Parameters ---------- From e30694befd10efec152f65bfbeef1e395d9b1fc4 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:27:44 +0200 Subject: [PATCH 53/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Ioannis Sifnaios <88548539+IoannisSifnaios@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 3b7c6f1fe8..6d26c6f96b 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -626,7 +626,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, M = a_1 K_c^{a_2} AM_a^{a_3}, - where M is the spectral mismatch factor, and :math:`a_1, a_2, a_3` are + where :math:`M` is the spectral mismatch factor, :math:`k_c` is the clear sky index, :math:`AM` is the absolute air mass, and :math:`a_1, a_2, a_3` are module-specific coefficients. In the PVSPEC model publication, absolute air mass is estimated starting from the Kasten and Young relative air mass [2]_. The clear sky index, which is the ratio of GHI to clear sky GHI, uses From bcf8abc6488021160dc16b5ca8f40700f6b223d1 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:30:00 +0200 Subject: [PATCH 54/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 6d26c6f96b..aad534a910 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -585,7 +585,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, models. Model coefficients are derived using spectral irradiance and other meteorological data from eight locations. These coefficients for six modules are available here via the ``module_type`` parameter. More details - on the model, can be found in [1]_. + on the model can be found in [1]_. Parameters ---------- @@ -626,9 +626,10 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, M = a_1 K_c^{a_2} AM_a^{a_3}, - where :math:`M` is the spectral mismatch factor, :math:`k_c` is the clear sky index, :math:`AM` is the absolute air mass, and :math:`a_1, a_2, a_3` are - module-specific coefficients. In the PVSPEC model publication, absolute air - mass is estimated starting from the Kasten and Young relative air mass + where :math:`M` is the spectral mismatch factor, :math:`k_c` is the clear + sky index, :math:`AM_a` is the absolute air mass, and :math:`a_1, a_2, a_3` + are module-specific coefficients. In the PVSPEC model publication, absolute + air mass is estimated starting from the Kasten and Young relative air mass [2]_. The clear sky index, which is the ratio of GHI to clear sky GHI, uses the ESRA model [3]_ to estimate the clear sky GHI with monthly Linke turbidity values from [4]_ as inputs. From ba7c34b0185654cba54ac48ddc21cf9047472cbb Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:35:31 +0200 Subject: [PATCH 55/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index aad534a910..7b6d96a3f4 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -624,7 +624,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, .. math:: - M = a_1 K_c^{a_2} AM_a^{a_3}, + M = a_1 k_c^{a_2} AM_a^{a_3}, where :math:`M` is the spectral mismatch factor, :math:`k_c` is the clear sky index, :math:`AM_a` is the absolute air mass, and :math:`a_1, a_2, a_3` From 0f1bce08a3c39fe4c03e9f79c07289fb5abc8f52 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:37:54 +0200 Subject: [PATCH 56/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 7b6d96a3f4..8afac43ae1 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -629,10 +629,10 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, where :math:`M` is the spectral mismatch factor, :math:`k_c` is the clear sky index, :math:`AM_a` is the absolute air mass, and :math:`a_1, a_2, a_3` are module-specific coefficients. In the PVSPEC model publication, absolute - air mass is estimated starting from the Kasten and Young relative air mass - [2]_. The clear sky index, which is the ratio of GHI to clear sky GHI, uses - the ESRA model [3]_ to estimate the clear sky GHI with monthly Linke - turbidity values from [4]_ as inputs. + air mass (denoted as :math:`AM`) is estimated starting from the Kasten and + Young relative air mass [2]_. The clear sky index, which is the ratio of + GHI to clear sky GHI, uses the ESRA model [3]_ to estimate the clear sky + GHI with monthly Linke turbidity values from [4]_ as inputs. References ---------- From 7701d850bf57010d1026ab2272d24c9695bff271 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:14:19 +0200 Subject: [PATCH 57/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 8afac43ae1..f0e2bdae66 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -647,7 +647,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, .. [3] Rigollier, C., Bauer, O. and Wald, L., 2000. On the clear sky model of the ESRA—European Solar Radiation Atlas—with respect to the Heliosat method. Solar energy, 68(1), pp.33-48. - :doi:`https://doi.org/10.1016/S0038-092X(99)00055-9` + :doi:`10.1016/S0038-092X(99)00055-9` .. [4] SoDa website monthly Linke turbidity values: `http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity- factor-ozone-watervapor-and-angstroembeta`_. From d5f097995356eb50f8939b49094987b3e0de4f7d Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:14:41 +0200 Subject: [PATCH 58/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index f0e2bdae66..14a1aabf36 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -649,9 +649,8 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, method. Solar energy, 68(1), pp.33-48. :doi:`10.1016/S0038-092X(99)00055-9` .. [4] SoDa website monthly Linke turbidity values: - `http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity- - factor-ozone-watervapor-and-angstroembeta`_. - """ + `http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity-factor-ozone-watervapor-and-angstroembeta`_. + """ # noqa: E501 _coefficients = {} _coefficients['multisi'] = (0.9847, -0.05237, 0.03034) From 887faee8b3fe9e01b2707688a0b4b084ace22daa Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:20:05 +0200 Subject: [PATCH 59/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 14a1aabf36..bb734f85d7 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -643,7 +643,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, :doi:`10.1109/PVSC45281.2020.9300932` .. [2] Kasten, F. and Young, A.T., 1989. Revised optical air mass tables and approximation formula. Applied Optics, 28(22), pp.4735-4738. - :doi:`https://doi.org/10.1364/AO.28.004735` + :doi:`10.1364/AO.28.004735` .. [3] Rigollier, C., Bauer, O. and Wald, L., 2000. On the clear sky model of the ESRA—European Solar Radiation Atlas—with respect to the Heliosat method. Solar energy, 68(1), pp.33-48. From 3c478d5e322015c67efe3d9f8ec14ccf4e14d1ec Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:58:13 +0200 Subject: [PATCH 60/72] Update mismatch.py tried typesetting the url differently, will fix line character length after --- pvlib/spectrum/mismatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index bb734f85d7..635b2131e1 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -648,8 +648,8 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, of the ESRA—European Solar Radiation Atlas—with respect to the Heliosat method. Solar energy, 68(1), pp.33-48. :doi:`10.1016/S0038-092X(99)00055-9` - .. [4] SoDa website monthly Linke turbidity values: - `http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity-factor-ozone-watervapor-and-angstroembeta`_. + .. [4] `SoDa website monthly Linke turbidity values: + http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity-factor-ozone-watervapor-and-angstroembeta`_ """ # noqa: E501 _coefficients = {} From 9a4510ce9d77b6746330fcb650b6c8167827ffb9 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:36:25 +0200 Subject: [PATCH 61/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index e0e60330ac..343cb3755f 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -659,7 +659,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, method. Solar energy, 68(1), pp.33-48. :doi:`10.1016/S0038-092X(99)00055-9` .. [4] SoDa website monthly Linke turbidity values: - `http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity-factor-ozone-watervapor-and-angstroembeta`_ + http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity-factor-ozone-watervapor-and-angstroembeta """ # noqa: E501 _coefficients = {} From 8aeb8b54f18e9cc0a8897a775e401420268b8679 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:44:32 +0200 Subject: [PATCH 62/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 343cb3755f..4d801a28b8 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -634,7 +634,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, .. math:: - M = a_1 k_c^{a_2} AM_a^{a_3}, + M = a_1 k_c^{a_2} AM_a^{a_3}, where :math:`M` is the spectral mismatch factor, :math:`k_c` is the clear sky index, :math:`AM_a` is the absolute air mass, and :math:`a_1, a_2, a_3` From 7ba41ba85b0b2a5b905a02c252f9ce617eedbabb Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 11 Jun 2024 18:37:08 +0200 Subject: [PATCH 63/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 4d801a28b8..20730274f8 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -659,7 +659,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, method. Solar energy, 68(1), pp.33-48. :doi:`10.1016/S0038-092X(99)00055-9` .. [4] SoDa website monthly Linke turbidity values: - http://www.sodapro.com/gl/web-services/atmosphere/linke-turbidity-factor-ozone-watervapor-and-angstroembeta + http://www.soda-pro.com/gl/web-services/atmosphere/linke-turbidity-factor-ozone-watervapor-and-angstroembeta """ # noqa: E501 _coefficients = {} From 604e911dbb7962f44a7a0f8a473b4fc6456923ec Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 12 Jun 2024 23:10:41 +0200 Subject: [PATCH 64/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Cliff Hansen --- pvlib/spectrum/mismatch.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 20730274f8..13d56d1c9d 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -589,12 +589,10 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, Estimate a technology-specific spectral mismatch modifier from absolute airmass and clear sky index using the PVSPEC model. - The motivation for this model is to include the effects of cloud cover on - the spectrum, and thus spectral mismatch factor estimation. Another - motivation is to develop a simple parameterisation compared with existing - models. Model coefficients are derived using spectral irradiance and other - meteorological data from eight locations. These coefficients for six - modules are available here via the ``module_type`` parameter. More details + The PVSPEC spectral mismatch model includes the effects of cloud cover on + the irradiance spectrum. Model coefficients are derived using spectral irradiance + and other meteorological data from eight locations. Coefficients for six + module types are available via the ``module_type`` parameter. More details on the model can be found in [1]_. Parameters From 8897411477c7a7c706cd0b44318fba29ccfd8857 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 12 Jun 2024 23:11:00 +0200 Subject: [PATCH 65/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Cliff Hansen --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 13d56d1c9d..7760adf928 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -609,7 +609,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, * ``'fs4-1'`` - First Solar series 4-1 and earlier CdTe module. * ``'fs4-2'`` - First Solar 4-2 and later CdTe module. * ``'monosi'``, - anonymous sc-si module. - * ``'multisi'``, - anonymous mc-si- module. + * ``'multisi'``, - anonymous multicrystalline Si module. * ``'cigs'`` - anonymous copper indium gallium selenide module. * ``'asi'`` - anonymous amorphous silicon module. From 413cc044082da90caea1c57e18e2f0cfdae6d84a Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 12 Jun 2024 23:11:41 +0200 Subject: [PATCH 66/72] Update pvlib/spectrum/mismatch.py Co-authored-by: Cliff Hansen --- pvlib/spectrum/mismatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 7760adf928..a134c762db 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -608,7 +608,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, * ``'fs4-1'`` - First Solar series 4-1 and earlier CdTe module. * ``'fs4-2'`` - First Solar 4-2 and later CdTe module. - * ``'monosi'``, - anonymous sc-si module. + * ``'monosi'``, - anonymous monocrystalline Si module. * ``'multisi'``, - anonymous multicrystalline Si module. * ``'cigs'`` - anonymous copper indium gallium selenide module. * ``'asi'`` - anonymous amorphous silicon module. From 4605d0660eb182bcab735e81ec275e67430b640b Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 12 Jun 2024 23:21:03 +0200 Subject: [PATCH 67/72] Update mismatch.py --- pvlib/spectrum/mismatch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index a134c762db..9290b04f1d 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -590,10 +590,10 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, airmass and clear sky index using the PVSPEC model. The PVSPEC spectral mismatch model includes the effects of cloud cover on - the irradiance spectrum. Model coefficients are derived using spectral irradiance - and other meteorological data from eight locations. Coefficients for six - module types are available via the ``module_type`` parameter. More details - on the model can be found in [1]_. + the irradiance spectrum. Model coefficients are derived using spectral + irradiance and other meteorological data from eight locations. Coefficients + for six module types are available via the ``module_type`` parameter. + More details on the model can be found in [1]_. Parameters ---------- From a772a94fbeb3d6e507caa2147e87c49a20808556 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 13 Jun 2024 08:05:43 +0200 Subject: [PATCH 68/72] test for output type --- pvlib/spectrum/mismatch.py | 2 +- pvlib/tests/test_spectrum.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 9290b04f1d..d04a1a22f4 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -592,7 +592,7 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, The PVSPEC spectral mismatch model includes the effects of cloud cover on the irradiance spectrum. Model coefficients are derived using spectral irradiance and other meteorological data from eight locations. Coefficients - for six module types are available via the ``module_type`` parameter. + for six module types are available via the ``module_type`` parameter. More details on the model can be found in [1]_. Parameters diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index ccef3d0eaf..8ddf29be3c 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -347,8 +347,8 @@ def test_spectral_factor_pvspec_series(module_type, expected): kcs = pd.Series([0.4, 0.6, 0.8, 1.4]) out = spectrum.spectral_factor_pvspec(ams, kcs, module_type=module_type) - out = pd.Series(out) - assert np.allclose(expected, out, atol=1e-8) + if isinstance(out, pd.Series): + assert np.allclose(expected, out, atol=1e-8) def test_spectral_factor_pvspec_supplied(): From 55d34ed6bd0aa9b48874f9555284546b72808f96 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 13 Jun 2024 08:22:08 +0200 Subject: [PATCH 69/72] Update mismatch.py specific data resource via extended url is either behind a paywall or moved; linking the main site homepage instead --- pvlib/spectrum/mismatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index d04a1a22f4..7c70a35360 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -657,8 +657,8 @@ def spectral_factor_pvspec(airmass_absolute, clearsky_index, method. Solar energy, 68(1), pp.33-48. :doi:`10.1016/S0038-092X(99)00055-9` .. [4] SoDa website monthly Linke turbidity values: - http://www.soda-pro.com/gl/web-services/atmosphere/linke-turbidity-factor-ozone-watervapor-and-angstroembeta - """ # noqa: E501 + http://www.soda-pro.com/ + """ _coefficients = {} _coefficients['multisi'] = (0.9847, -0.05237, 0.03034) From 38469cff985083d4c27f22dea172db25c8994f47 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:05:59 +0200 Subject: [PATCH 70/72] Update pvlib/tests/test_spectrum.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/tests/test_spectrum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py index 8ddf29be3c..6b1dcd4506 100644 --- a/pvlib/tests/test_spectrum.py +++ b/pvlib/tests/test_spectrum.py @@ -347,8 +347,8 @@ def test_spectral_factor_pvspec_series(module_type, expected): kcs = pd.Series([0.4, 0.6, 0.8, 1.4]) out = spectrum.spectral_factor_pvspec(ams, kcs, module_type=module_type) - if isinstance(out, pd.Series): - assert np.allclose(expected, out, atol=1e-8) + assert isinstance(out, pd.Series) + assert np.allclose(expected, out, atol=1e-8) def test_spectral_factor_pvspec_supplied(): From 294eb8e1f94cce6df68af087073c7e3ea1ffe1a7 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:31:46 +0200 Subject: [PATCH 71/72] Update v0.11.0.rst --- docs/sphinx/source/whatsnew/v0.11.0.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.0.rst b/docs/sphinx/source/whatsnew/v0.11.0.rst index 14694d0fc4..b7ef4e6fba 100644 --- a/docs/sphinx/source/whatsnew/v0.11.0.rst +++ b/docs/sphinx/source/whatsnew/v0.11.0.rst @@ -32,7 +32,9 @@ Enhancements efficiency ([unitless]) and vice versa. The conversion functions are :py:func:`pvlib.spectrum.sr_to_qe` and :py:func:`pvlib.spectrum.qe_to_sr` respectively. (:issue:`2040`, :pull:`2041`) - +* Add function :py:func`spectrum.spectral_factor_pvspec`, which calculates the + spectral mismatch factor as a function of absolute airmass and clearsky index + using the PVSPEC model. (:issue:`1950`, :issue:`2065`, :pull:`2072`) Bug fixes ~~~~~~~~~ @@ -56,3 +58,4 @@ Contributors * Mark Mikofski (:ghuser:`mikofski`) * Siddharth Kaul (:ghuser:`k10blogger`) * Mark Campanelli (:ghuser:`markcampanelli`) +* Rajiv Daxini (:ghuser:`RDaxini`) From bc37d4965f3fdcf9cd7dc64d4fe4e09ec1f10182 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:20:59 +0200 Subject: [PATCH 72/72] Update docs/sphinx/source/whatsnew/v0.11.0.rst Co-authored-by: Kevin Anderson --- docs/sphinx/source/whatsnew/v0.11.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.0.rst b/docs/sphinx/source/whatsnew/v0.11.0.rst index b7ef4e6fba..9d36af22e3 100644 --- a/docs/sphinx/source/whatsnew/v0.11.0.rst +++ b/docs/sphinx/source/whatsnew/v0.11.0.rst @@ -32,7 +32,7 @@ Enhancements efficiency ([unitless]) and vice versa. The conversion functions are :py:func:`pvlib.spectrum.sr_to_qe` and :py:func:`pvlib.spectrum.qe_to_sr` respectively. (:issue:`2040`, :pull:`2041`) -* Add function :py:func`spectrum.spectral_factor_pvspec`, which calculates the +* Add function :py:func:`pvlib.spectrum.spectral_factor_pvspec`, which calculates the spectral mismatch factor as a function of absolute airmass and clearsky index using the PVSPEC model. (:issue:`1950`, :issue:`2065`, :pull:`2072`)