Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Breaking Changes
* Modified the ``surface_azimuth`` parameter in :py:func:`pvlib.iotools.get_pvgis_hourly` to conform to the
pvlib azimuth convention (counterclockwise from north). Previously 0 degrees represented south.
(:issue:`1724`, :pull:`1739`)
* For consistency with the rest of pvlib, the ``pw`` parameter is renamed to
``precipitable_water`` in :py:func:`pvlib.spectrum.spectral_factor_firstsolar`.
(:pull:`1768`)
* For consistency with the rest of pvlib, the ``tilt`` parameter is renamed
to ``surface_tilt`` in :py:func:`pvlib.soiling.hsu`. (:issue:`1717`, :pull:`1738`)

Expand Down
31 changes: 16 additions & 15 deletions pvlib/spectrum/mismatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ def integrate(e):
return smm


def spectral_factor_firstsolar(pw, airmass_absolute, module_type=None,
coefficients=None, min_pw=0.1, max_pw=8):
def spectral_factor_firstsolar(precipitable_water, airmass_absolute,
module_type=None, coefficients=None,
min_pw=0.1, max_pw=8):
r"""
Spectral mismatch modifier based on precipitable water and absolute
(pressure-adjusted) airmass.
Expand Down Expand Up @@ -277,21 +278,13 @@ def spectral_factor_firstsolar(pw, airmass_absolute, module_type=None,

Parameters
----------
pw : array-like
precipitable_water : numeric
atmospheric precipitable water. [cm]

airmass_absolute : array-like
airmass_absolute : numeric
absolute (pressure-adjusted) airmass. [unitless]

min_pw : float, default 0.1
minimum atmospheric precipitable water. Any pw value lower than min_pw
is set to min_pw to avoid model divergence. [cm]

max_pw : float, default 8
maximum atmospheric precipitable water. Any pw value higher than max_pw
is set to NaN to avoid model divergence. [cm]

module_type : None or string, default None
module_type : str, optional
a string specifying a cell type. Values of 'cdte', 'monosi', 'xsi',
'multisi', and 'polysi' (can be lower or upper case). If provided,
module_type selects default coefficients for the following modules:
Expand All @@ -307,7 +300,7 @@ def spectral_factor_firstsolar(pw, airmass_absolute, module_type=None,
Manufacturer 2 Model C from [3]_. The spectral response (SR) of CIGS
and a-Si modules used to derive coefficients can be found in [4]_

coefficients : None or array-like, default None
coefficients : array-like, optional
Allows for entry of user-defined spectral correction
coefficients. Coefficients must be of length 6. Derivation of
coefficients requires use of SMARTS and PV module quantum
Expand All @@ -317,6 +310,14 @@ def spectral_factor_firstsolar(pw, airmass_absolute, module_type=None,
modules with very similar quantum efficiency should be similar,
in most cases limiting the need for module specific coefficients.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When did we start leaving spaces between parameter descriptions? 😯

min_pw : float, default 0.1
minimum atmospheric precipitable water. Any pw value lower than min_pw
is set to min_pw to avoid model divergence. [cm]

max_pw : float, default 8
maximum atmospheric precipitable water. Any pw value higher than max_pw
is set to NaN to avoid model divergence. [cm]

Returns
-------
modifier: array-like
Expand Down Expand Up @@ -347,7 +348,7 @@ def spectral_factor_firstsolar(pw, airmass_absolute, module_type=None,
# *** Pw ***
# Replace Pw Values below 0.1 cm with 0.1 cm to prevent model from
# diverging"
pw = np.atleast_1d(pw)
pw = np.atleast_1d(precipitable_water)
pw = pw.astype('float64')
if np.min(pw) < min_pw:
pw = np.maximum(pw, min_pw)
Expand Down