|
3 | 3 | absolute airmass and to determine pressure from altitude or vice versa.
|
4 | 4 | """
|
5 | 5 |
|
6 |
| -from warnings import warn |
7 |
| - |
8 | 6 | import numpy as np
|
9 | 7 | import pandas as pd
|
| 8 | +import pvlib |
10 | 9 |
|
| 10 | +from pvlib._deprecation import deprecated |
11 | 11 |
|
12 | 12 | APPARENT_ZENITH_MODELS = ('simple', 'kasten1966', 'kastenyoung1989',
|
13 | 13 | 'gueymard1993', 'pickering2002')
|
@@ -336,175 +336,10 @@ def gueymard94_pw(temp_air, relative_humidity):
|
336 | 336 | return pw
|
337 | 337 |
|
338 | 338 |
|
339 |
| -def first_solar_spectral_correction(pw, airmass_absolute, |
340 |
| - module_type=None, coefficients=None, |
341 |
| - min_pw=0.1, max_pw=8): |
342 |
| - r""" |
343 |
| - Spectral mismatch modifier based on precipitable water and absolute |
344 |
| - (pressure-adjusted) airmass. |
345 |
| -
|
346 |
| - Estimates a spectral mismatch modifier :math:`M` representing the effect on |
347 |
| - module short circuit current of variation in the spectral |
348 |
| - irradiance. :math:`M` is estimated from absolute (pressure currected) air |
349 |
| - mass, :math:`AM_a`, and precipitable water, :math:`Pw`, using the following |
350 |
| - function: |
351 |
| -
|
352 |
| - .. math:: |
353 |
| -
|
354 |
| - M = c_1 + c_2 AM_a + c_3 Pw + c_4 AM_a^{0.5} |
355 |
| - + c_5 Pw^{0.5} + c_6 \frac{AM_a} {Pw^{0.5}} |
356 |
| -
|
357 |
| - Default coefficients are determined for several cell types with |
358 |
| - known quantum efficiency curves, by using the Simple Model of the |
359 |
| - Atmospheric Radiative Transfer of Sunshine (SMARTS) [1]_. Using |
360 |
| - SMARTS, spectrums are simulated with all combinations of AMa and |
361 |
| - Pw where: |
362 |
| -
|
363 |
| - * :math:`0.5 \textrm{cm} <= Pw <= 5 \textrm{cm}` |
364 |
| - * :math:`1.0 <= AM_a <= 5.0` |
365 |
| - * Spectral range is limited to that of CMP11 (280 nm to 2800 nm) |
366 |
| - * spectrum simulated on a plane normal to the sun |
367 |
| - * All other parameters fixed at G173 standard |
368 |
| -
|
369 |
| - From these simulated spectra, M is calculated using the known |
370 |
| - quantum efficiency curves. Multiple linear regression is then |
371 |
| - applied to fit Eq. 1 to determine the coefficients for each module. |
372 |
| -
|
373 |
| - Based on the PVLIB Matlab function ``pvl_FSspeccorr`` by Mitchell |
374 |
| - Lee and Alex Panchula of First Solar, 2016 [2]_. |
375 |
| -
|
376 |
| - Parameters |
377 |
| - ---------- |
378 |
| - pw : array-like |
379 |
| - atmospheric precipitable water. [cm] |
380 |
| -
|
381 |
| - airmass_absolute : array-like |
382 |
| - absolute (pressure-adjusted) airmass. [unitless] |
383 |
| -
|
384 |
| - min_pw : float, default 0.1 |
385 |
| - minimum atmospheric precipitable water. Any pw value lower than min_pw |
386 |
| - is set to min_pw to avoid model divergence. [cm] |
387 |
| -
|
388 |
| - max_pw : float, default 8 |
389 |
| - maximum atmospheric precipitable water. Any pw value higher than max_pw |
390 |
| - is set to NaN to avoid model divergence. [cm] |
391 |
| -
|
392 |
| - module_type : None or string, default None |
393 |
| - a string specifying a cell type. Values of 'cdte', 'monosi', 'xsi', |
394 |
| - 'multisi', and 'polysi' (can be lower or upper case). If provided, |
395 |
| - module_type selects default coefficients for the following modules: |
396 |
| -
|
397 |
| - * 'cdte' - First Solar Series 4-2 CdTe module. |
398 |
| - * 'monosi', 'xsi' - First Solar TetraSun module. |
399 |
| - * 'multisi', 'polysi' - anonymous multi-crystalline silicon module. |
400 |
| - * 'cigs' - anonymous copper indium gallium selenide module. |
401 |
| - * 'asi' - anonymous amorphous silicon module. |
402 |
| -
|
403 |
| - The module used to calculate the spectral correction |
404 |
| - coefficients corresponds to the Multi-crystalline silicon |
405 |
| - Manufacturer 2 Model C from [3]_. The spectral response (SR) of CIGS |
406 |
| - and a-Si modules used to derive coefficients can be found in [4]_ |
407 |
| -
|
408 |
| - coefficients : None or array-like, default None |
409 |
| - Allows for entry of user-defined spectral correction |
410 |
| - coefficients. Coefficients must be of length 6. Derivation of |
411 |
| - coefficients requires use of SMARTS and PV module quantum |
412 |
| - efficiency curve. Useful for modeling PV module types which are |
413 |
| - not included as defaults, or to fine tune the spectral |
414 |
| - correction to a particular PV module. Note that the parameters for |
415 |
| - modules with very similar quantum efficiency should be similar, |
416 |
| - in most cases limiting the need for module specific coefficients. |
417 |
| -
|
418 |
| - Returns |
419 |
| - ------- |
420 |
| - modifier: array-like |
421 |
| - spectral mismatch factor (unitless) which is can be multiplied |
422 |
| - with broadband irradiance reaching a module's cells to estimate |
423 |
| - effective irradiance, i.e., the irradiance that is converted to |
424 |
| - electrical current. |
425 |
| -
|
426 |
| - References |
427 |
| - ---------- |
428 |
| - .. [1] Gueymard, Christian. SMARTS2: a simple model of the atmospheric |
429 |
| - radiative transfer of sunshine: algorithms and performance |
430 |
| - assessment. Cocoa, FL: Florida Solar Energy Center, 1995. |
431 |
| - .. [2] Lee, Mitchell, and Panchula, Alex. "Spectral Correction for |
432 |
| - Photovoltaic Module Performance Based on Air Mass and Precipitable |
433 |
| - Water." IEEE Photovoltaic Specialists Conference, Portland, 2016 |
434 |
| - .. [3] Marion, William F., et al. User's Manual for Data for Validating |
435 |
| - Models for PV Module Performance. National Renewable Energy |
436 |
| - Laboratory, 2014. http://www.nrel.gov/docs/fy14osti/61610.pdf |
437 |
| - .. [4] Schweiger, M. and Hermann, W, Influence of Spectral Effects |
438 |
| - on Energy Yield of Different PV Modules: Comparison of Pwat and |
439 |
| - MMF Approach, TUV Rheinland Energy GmbH report 21237296.003, |
440 |
| - January 2017 |
441 |
| - """ |
442 |
| - |
443 |
| - # --- Screen Input Data --- |
444 |
| - |
445 |
| - # *** Pw *** |
446 |
| - # Replace Pw Values below 0.1 cm with 0.1 cm to prevent model from |
447 |
| - # diverging" |
448 |
| - pw = np.atleast_1d(pw) |
449 |
| - pw = pw.astype('float64') |
450 |
| - if np.min(pw) < min_pw: |
451 |
| - pw = np.maximum(pw, min_pw) |
452 |
| - warn(f'Exceptionally low pw values replaced with {min_pw} cm to ' |
453 |
| - 'prevent model divergence') |
454 |
| - |
455 |
| - # Warn user about Pw data that is exceptionally high |
456 |
| - if np.max(pw) > max_pw: |
457 |
| - pw[pw > max_pw] = np.nan |
458 |
| - warn('Exceptionally high pw values replaced by np.nan: ' |
459 |
| - 'check input data.') |
460 |
| - |
461 |
| - # *** AMa *** |
462 |
| - # Replace Extremely High AM with AM 10 to prevent model divergence |
463 |
| - # AM > 10 will only occur very close to sunset |
464 |
| - if np.max(airmass_absolute) > 10: |
465 |
| - airmass_absolute = np.minimum(airmass_absolute, 10) |
466 |
| - |
467 |
| - # Warn user about AMa data that is exceptionally low |
468 |
| - if np.min(airmass_absolute) < 0.58: |
469 |
| - warn('Exceptionally low air mass: ' + |
470 |
| - 'model not intended for extra-terrestrial use') |
471 |
| - # pvl_absoluteairmass(1,pvl_alt2pres(4340)) = 0.58 Elevation of |
472 |
| - # Mina Pirquita, Argentian = 4340 m. Highest elevation city with |
473 |
| - # population over 50,000. |
474 |
| - |
475 |
| - _coefficients = {} |
476 |
| - _coefficients['cdte'] = ( |
477 |
| - 0.86273, -0.038948, -0.012506, 0.098871, 0.084658, -0.0042948) |
478 |
| - _coefficients['monosi'] = ( |
479 |
| - 0.85914, -0.020880, -0.0058853, 0.12029, 0.026814, -0.0017810) |
480 |
| - _coefficients['xsi'] = _coefficients['monosi'] |
481 |
| - _coefficients['polysi'] = ( |
482 |
| - 0.84090, -0.027539, -0.0079224, 0.13570, 0.038024, -0.0021218) |
483 |
| - _coefficients['multisi'] = _coefficients['polysi'] |
484 |
| - _coefficients['cigs'] = ( |
485 |
| - 0.85252, -0.022314, -0.0047216, 0.13666, 0.013342, -0.0008945) |
486 |
| - _coefficients['asi'] = ( |
487 |
| - 1.12094, -0.047620, -0.0083627, -0.10443, 0.098382, -0.0033818) |
488 |
| - |
489 |
| - if module_type is not None and coefficients is None: |
490 |
| - coefficients = _coefficients[module_type.lower()] |
491 |
| - elif module_type is None and coefficients is not None: |
492 |
| - pass |
493 |
| - elif module_type is None and coefficients is None: |
494 |
| - raise TypeError('No valid input provided, both module_type and ' + |
495 |
| - 'coefficients are None') |
496 |
| - else: |
497 |
| - raise TypeError('Cannot resolve input, must supply only one of ' + |
498 |
| - 'module_type and coefficients') |
499 |
| - |
500 |
| - # Evaluate Spectral Shift |
501 |
| - coeff = coefficients |
502 |
| - ama = airmass_absolute |
503 |
| - modifier = ( |
504 |
| - coeff[0] + coeff[1]*ama + coeff[2]*pw + coeff[3]*np.sqrt(ama) + |
505 |
| - coeff[4]*np.sqrt(pw) + coeff[5]*ama/np.sqrt(pw)) |
506 |
| - |
507 |
| - return modifier |
| 339 | +first_solar_spectral_correction = deprecated( |
| 340 | + since='0.10.0', |
| 341 | + alternative='pvlib.spectrum.spectral_factor_firstsolar' |
| 342 | +)(pvlib.spectrum.spectral_factor_firstsolar) |
508 | 343 |
|
509 | 344 |
|
510 | 345 | def bird_hulstrom80_aod_bb(aod380, aod500):
|
|
0 commit comments