66from __future__ import division
77
88import numpy as np
9+ from warnings import warn
910
1011APPARENT_ZENITH_MODELS = ('simple' , 'kasten1966' , 'kastenyoung1989' ,
1112 'gueymard1993' , 'pickering2002' )
@@ -339,7 +340,7 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None,
339340 .. math::
340341
341342 M = c_1 + c_2*AMa + c_3*Pwat + c_4*AMa^.5
342- + c_5*Pwat^.5 + c_6*AMa/Pwat
343+ + c_5*Pwat^.5 + c_6*AMa/Pwat^.5
343344
344345 Default coefficients are determined for several cell types with
345346 known quantum efficiency curves, by using the Simple Model of the
@@ -348,7 +349,7 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None,
348349 Pwat where:
349350
350351 * 0.5 cm <= Pwat <= 5 cm
351- * 0.8 <= AMa <= 4.75 (Pressure of 800 mbar and 1.01 <= AM <= 6)
352+ * 1.0 <= AMa <= 5.0
352353 * Spectral range is limited to that of CMP11 (280 nm to 2800 nm)
353354 * spectrum simulated on a plane normal to the sun
354355 * All other parameters fixed at G173 standard
@@ -358,14 +359,14 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None,
358359 applied to fit Eq. 1 to determine the coefficients for each module.
359360
360361 Based on the PVLIB Matlab function ``pvl_FSspeccorr`` by Mitchell
361- Lee and Alex Panchula, at First Solar, 2015 .
362+ Lee and Alex Panchula, at First Solar, 2016 [2]_ .
362363
363364 Parameters
364365 ----------
365366 pw : array-like
366367 atmospheric precipitable water (cm).
367368
368- airmass_absolute :
369+ airmass_absolute : array-like
369370 absolute (pressure corrected) airmass.
370371
371372 module_type : None or string
@@ -380,7 +381,7 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None,
380381
381382 The module used to calculate the spectral correction
382383 coefficients corresponds to the Mult-crystalline silicon
383- Manufacturer 2 Model C from [2 ]_.
384+ Manufacturer 2 Model C from [3 ]_.
384385
385386 coefficients : array-like
386387 allows for entry of user defined spectral correction
@@ -406,20 +407,55 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None,
406407 .. [1] Gueymard, Christian. SMARTS2: a simple model of the atmospheric
407408 radiative transfer of sunshine: algorithms and performance
408409 assessment. Cocoa, FL: Florida Solar Energy Center, 1995.
409-
410- .. [2] Marion, William F., et al. User's Manual for Data for Validating
410+ .. [2] Lee, Mitchell, and Panchula, Alex. "Spectral Correction for
411+ Photovoltaic Module Performance Based on Air Mass and Precipitable
412+ Water." IEEE Photovoltaic Specialists Conference, Portland, 2016
413+ .. [3] Marion, William F., et al. User's Manual for Data for Validating
411414 Models for PV Module Performance. National Renewable Energy
412415 Laboratory, 2014. http://www.nrel.gov/docs/fy14osti/61610.pdf
413416 """
414417
418+ # --- Screen Input Data ---
419+
420+ # *** Pwat ***
421+ # Replace Pwat Values below 0.1 cm with 0.1 cm to prevent model from
422+ # diverging"
423+
424+ if np .min (pw ) < 0.1 :
425+ pw = np .maximum (pw , 0.1 )
426+ warn ('Exceptionally low Pwat values replaced with 0.1 cm to prevent' +
427+ ' model divergence' )
428+
429+
430+ # Warn user about Pwat data that is exceptionally high
431+ if np .max (pw ) > 8 :
432+ warn ('Exceptionally high Pwat values. Check input data:' +
433+ ' model may diverge in this range' )
434+
435+
436+ # *** AMa ***
437+ # Replace Extremely High AM with AM 10 to prevent model divergence
438+ # AM > 10 will only occur very close to sunset
439+ if np .max (airmass_absolute ) > 10 :
440+ airmass_absolute = np .minimum (airmass_absolute ,10 )
441+
442+ # Warn user about AMa data that is exceptionally low
443+ if np .min (airmass_absolute ) < 0.58 :
444+ warn ('Exceptionally low air mass: ' +
445+ 'model not intended for extra-terrestrial use' )
446+ # pvl_absoluteairmass(1,pvl_alt2pres(4340)) = 0.58
447+ # Elevation of Mina Pirquita, Argentian = 4340 m. Highest elevation city
448+ # with population over 50,000.
449+
450+
415451 _coefficients = {}
416452 _coefficients ['cdte' ] = (
417- 0.87102 , - 0.040543 , - 0.00929202 , 0.10052 , 0.073062 , - 0.0034187 )
453+ 0.86273 , - 0.038948 , - 0.012506 , 0.098871 , 0.084658 , - 0.0042948 )
418454 _coefficients ['monosi' ] = (
419- 0.86588 , - 0.021637 , - 0.0030218 , 0.12081 , 0.017514 , - 0.0012610 )
455+ 0.85914 , - 0.020880 , - 0.0058853 , 0.12029 , 0.026814 , - 0.0017810 )
420456 _coefficients ['xsi' ] = _coefficients ['monosi' ]
421457 _coefficients ['polysi' ] = (
422- 0.84674 , - 0.028568 , - 0.0051832 , 0.13669 , 0.029234 , - 0.0014207 )
458+ 0.84090 , - 0.027539 , - 0.0079224 , 0.13570 , 0.038024 , - 0.0021218 )
423459 _coefficients ['multisi' ] = _coefficients ['polysi' ]
424460
425461 if module_type is not None and coefficients is None :
@@ -435,6 +471,6 @@ def first_solar_spectral_correction(pw, airmass_absolute, module_type=None,
435471 AMa = airmass_absolute
436472 modifier = (
437473 coeff [0 ] + coeff [1 ]* AMa + coeff [2 ]* pw + coeff [3 ]* np .sqrt (AMa ) +
438- + coeff [4 ]* np .sqrt (pw ) + coeff [5 ]* AMa / pw )
474+ + coeff [4 ]* np .sqrt (pw ) + coeff [5 ]* AMa / np . sqrt ( pw ) )
439475
440476 return modifier
0 commit comments