@@ -239,8 +239,10 @@ def integrate(e):
239239 return smm
240240
241241
242- def spectral_factor_firstsolar (pw , airmass_absolute , module_type = None ,
243- coefficients = None , min_pw = 0.1 , max_pw = 8 ):
242+ def spectral_factor_firstsolar (precipitable_water , airmass_absolute ,
243+ module_type = None , coefficients = None ,
244+ min_precipitable_water = 0.1 ,
245+ max_precipitable_water = 8 ):
244246 r"""
245247 Spectral mismatch modifier based on precipitable water and absolute
246248 (pressure-adjusted) airmass.
@@ -277,21 +279,13 @@ def spectral_factor_firstsolar(pw, airmass_absolute, module_type=None,
277279
278280 Parameters
279281 ----------
280- pw : array-like
282+ precipitable_water : numeric
281283 atmospheric precipitable water. [cm]
282284
283- airmass_absolute : array-like
285+ airmass_absolute : numeric
284286 absolute (pressure-adjusted) airmass. [unitless]
285287
286- min_pw : float, default 0.1
287- minimum atmospheric precipitable water. Any pw value lower than min_pw
288- is set to min_pw to avoid model divergence. [cm]
289-
290- max_pw : float, default 8
291- maximum atmospheric precipitable water. Any pw value higher than max_pw
292- is set to NaN to avoid model divergence. [cm]
293-
294- module_type : None or string, default None
288+ module_type : str, optional
295289 a string specifying a cell type. Values of 'cdte', 'monosi', 'xsi',
296290 'multisi', and 'polysi' (can be lower or upper case). If provided,
297291 module_type selects default coefficients for the following modules:
@@ -307,7 +301,7 @@ def spectral_factor_firstsolar(pw, airmass_absolute, module_type=None,
307301 Manufacturer 2 Model C from [3]_. The spectral response (SR) of CIGS
308302 and a-Si modules used to derive coefficients can be found in [4]_
309303
310- coefficients : None or array-like, default None
304+ coefficients : array-like, optional
311305 Allows for entry of user-defined spectral correction
312306 coefficients. Coefficients must be of length 6. Derivation of
313307 coefficients requires use of SMARTS and PV module quantum
@@ -317,10 +311,20 @@ def spectral_factor_firstsolar(pw, airmass_absolute, module_type=None,
317311 modules with very similar quantum efficiency should be similar,
318312 in most cases limiting the need for module specific coefficients.
319313
314+ min_precipitable_water : float, default 0.1
315+ minimum atmospheric precipitable water. Any ``precipitable_water``
316+ value lower than ``min_precipitable_water``
317+ is set to ``min_precipitable_water`` to avoid model divergence. [cm]
318+
319+ max_precipitable_water : float, default 8
320+ maximum atmospheric precipitable water. Any ``precipitable_water``
321+ value greater than ``max_precipitable_water``
322+ is set to ``np.nan`` to avoid model divergence. [cm]
323+
320324 Returns
321325 -------
322326 modifier: array-like
323- spectral mismatch factor (unitless) which is can be multiplied
327+ spectral mismatch factor (unitless) which can be multiplied
324328 with broadband irradiance reaching a module's cells to estimate
325329 effective irradiance, i.e., the irradiance that is converted to
326330 electrical current.
@@ -347,16 +351,16 @@ def spectral_factor_firstsolar(pw, airmass_absolute, module_type=None,
347351 # *** Pw ***
348352 # Replace Pw Values below 0.1 cm with 0.1 cm to prevent model from
349353 # diverging"
350- pw = np .atleast_1d (pw )
354+ pw = np .atleast_1d (precipitable_water )
351355 pw = pw .astype ('float64' )
352- if np .min (pw ) < min_pw :
353- pw = np .maximum (pw , min_pw )
354- warn (f 'Exceptionally low pw values replaced with { min_pw } cm to '
355- ' prevent model divergence' )
356+ if np .min (pw ) < min_precipitable_water :
357+ pw = np .maximum (pw , min_precipitable_water )
358+ warn ('Exceptionally low pw values replaced with '
359+ f' { min_precipitable_water } cm to prevent model divergence' )
356360
357361 # Warn user about Pw data that is exceptionally high
358- if np .max (pw ) > max_pw :
359- pw [pw > max_pw ] = np .nan
362+ if np .max (pw ) > max_precipitable_water :
363+ pw [pw > max_precipitable_water ] = np .nan
360364 warn ('Exceptionally high pw values replaced by np.nan: '
361365 'check input data.' )
362366
0 commit comments