pvlib 0.9.4a1__py3-none-any.whl → 0.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. pvlib/__init__.py +3 -2
  2. pvlib/atmosphere.py +23 -173
  3. pvlib/bifacial/infinite_sheds.py +88 -277
  4. pvlib/bifacial/utils.py +270 -28
  5. pvlib/data/adr-library-cec-inverters-2019-03-05.csv +5009 -0
  6. pvlib/data/precise_iv_curves1.json +10251 -0
  7. pvlib/data/precise_iv_curves2.json +10251 -0
  8. pvlib/data/precise_iv_curves_parameter_sets1.csv +33 -0
  9. pvlib/data/precise_iv_curves_parameter_sets2.csv +33 -0
  10. pvlib/data/test_psm3_2017.csv +17521 -17521
  11. pvlib/data/test_psm3_2019_5min.csv +288 -288
  12. pvlib/data/test_read_psm3.csv +17522 -17522
  13. pvlib/data/test_read_pvgis_horizon.csv +49 -0
  14. pvlib/data/variables_style_rules.csv +3 -0
  15. pvlib/iam.py +207 -51
  16. pvlib/inverter.py +6 -1
  17. pvlib/iotools/__init__.py +7 -2
  18. pvlib/iotools/acis.py +516 -0
  19. pvlib/iotools/midc.py +4 -4
  20. pvlib/iotools/psm3.py +59 -42
  21. pvlib/iotools/pvgis.py +84 -28
  22. pvlib/iotools/sodapro.py +8 -6
  23. pvlib/iotools/srml.py +121 -18
  24. pvlib/iotools/surfrad.py +2 -2
  25. pvlib/iotools/tmy.py +146 -102
  26. pvlib/irradiance.py +270 -15
  27. pvlib/ivtools/sde.py +14 -20
  28. pvlib/ivtools/sdm.py +31 -20
  29. pvlib/ivtools/utils.py +127 -6
  30. pvlib/location.py +3 -2
  31. pvlib/modelchain.py +67 -70
  32. pvlib/pvarray.py +225 -0
  33. pvlib/pvsystem.py +169 -539
  34. pvlib/shading.py +43 -2
  35. pvlib/singlediode.py +216 -66
  36. pvlib/snow.py +36 -15
  37. pvlib/soiling.py +3 -3
  38. pvlib/spa.py +327 -368
  39. pvlib/spectrum/__init__.py +8 -2
  40. pvlib/spectrum/mismatch.py +335 -0
  41. pvlib/temperature.py +124 -13
  42. pvlib/tests/bifacial/test_infinite_sheds.py +44 -106
  43. pvlib/tests/bifacial/test_utils.py +102 -5
  44. pvlib/tests/conftest.py +0 -31
  45. pvlib/tests/iotools/test_acis.py +213 -0
  46. pvlib/tests/iotools/test_midc.py +6 -6
  47. pvlib/tests/iotools/test_psm3.py +7 -5
  48. pvlib/tests/iotools/test_pvgis.py +21 -14
  49. pvlib/tests/iotools/test_sodapro.py +1 -1
  50. pvlib/tests/iotools/test_srml.py +71 -6
  51. pvlib/tests/iotools/test_tmy.py +43 -8
  52. pvlib/tests/ivtools/test_sde.py +19 -17
  53. pvlib/tests/ivtools/test_sdm.py +9 -4
  54. pvlib/tests/ivtools/test_utils.py +96 -1
  55. pvlib/tests/test_atmosphere.py +8 -64
  56. pvlib/tests/test_clearsky.py +0 -1
  57. pvlib/tests/test_iam.py +74 -1
  58. pvlib/tests/test_irradiance.py +56 -2
  59. pvlib/tests/test_location.py +1 -1
  60. pvlib/tests/test_modelchain.py +33 -76
  61. pvlib/tests/test_pvarray.py +46 -0
  62. pvlib/tests/test_pvsystem.py +366 -201
  63. pvlib/tests/test_shading.py +35 -0
  64. pvlib/tests/test_singlediode.py +306 -29
  65. pvlib/tests/test_snow.py +84 -1
  66. pvlib/tests/test_soiling.py +8 -7
  67. pvlib/tests/test_solarposition.py +7 -7
  68. pvlib/tests/test_spa.py +6 -7
  69. pvlib/tests/test_spectrum.py +145 -1
  70. pvlib/tests/test_temperature.py +29 -11
  71. pvlib/tests/test_tools.py +41 -0
  72. pvlib/tests/test_tracking.py +0 -149
  73. pvlib/tools.py +49 -25
  74. pvlib/tracking.py +1 -269
  75. pvlib-0.10.0.dist-info/AUTHORS.md +35 -0
  76. {pvlib-0.9.4a1.dist-info → pvlib-0.10.0.dist-info}/LICENSE +5 -2
  77. {pvlib-0.9.4a1.dist-info → pvlib-0.10.0.dist-info}/METADATA +3 -13
  78. {pvlib-0.9.4a1.dist-info → pvlib-0.10.0.dist-info}/RECORD +80 -75
  79. {pvlib-0.9.4a1.dist-info → pvlib-0.10.0.dist-info}/WHEEL +1 -1
  80. pvlib/data/adr-library-2013-10-01.csv +0 -1762
  81. pvlib/forecast.py +0 -1211
  82. pvlib/iotools/ecmwf_macc.py +0 -312
  83. pvlib/tests/iotools/test_ecmwf_macc.py +0 -162
  84. pvlib/tests/test_forecast.py +0 -228
  85. pvlib-0.9.4a1.dist-info/AUTHORS.md +0 -32
  86. {pvlib-0.9.4a1.dist-info → pvlib-0.10.0.dist-info}/top_level.txt +0 -0
pvlib/__init__.py CHANGED
@@ -1,10 +1,12 @@
1
1
  from pvlib.version import __version__ # noqa: F401
2
2
 
3
3
  from pvlib import ( # noqa: F401
4
+ # list spectrum first so it's available for atmosphere & pvsystem (GH 1628)
5
+ spectrum,
6
+
4
7
  atmosphere,
5
8
  bifacial,
6
9
  clearsky,
7
- # forecast
8
10
  iam,
9
11
  inverter,
10
12
  iotools,
@@ -20,7 +22,6 @@ from pvlib import ( # noqa: F401
20
22
  soiling,
21
23
  solarposition,
22
24
  spa,
23
- spectrum,
24
25
  temperature,
25
26
  tools,
26
27
  tracking,
pvlib/atmosphere.py CHANGED
@@ -3,11 +3,11 @@ The ``atmosphere`` module contains methods to calculate relative and
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')
@@ -158,9 +158,11 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):
158
158
  * 'gueymard1993' - See reference [4] -
159
159
  requires apparent sun zenith
160
160
  * 'young1994' - See reference [5] -
161
- requries true sun zenith
161
+ requires true sun zenith
162
162
  * 'pickering2002' - See reference [6] -
163
163
  requires apparent sun zenith
164
+ * 'gueymard2003' - See references [7] and [8] -
165
+ requires apparent sun zenith
164
166
 
165
167
  Returns
166
168
  -------
@@ -196,7 +198,17 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):
196
198
 
197
199
  .. [6] Keith A. Pickering. "The Ancient Star Catalog". DIO 12:1, 20,
198
200
 
199
- .. [7] Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein, "Global
201
+ .. [7] C. Gueymard, "Direct solar transmittance and irradiance
202
+ predictions with broadband models. Part I: detailed theoretical
203
+ performance assessment". Solar Energy, vol 74, pp. 355-379, 2003.
204
+ :doi:`10.1016/S0038-092X(03)00195-6`
205
+
206
+ .. [8] C. Gueymard (2019). Clear-Sky Radiation Models and Aerosol Effects.
207
+ In: Polo, J., Martín-Pomares, L., Sanfilippo, A. (eds) Solar Resources
208
+ Mapping. Green Energy and Technology. Springer, Cham.
209
+ :doi:`10.1007/978-3-319-97484-2_5`
210
+
211
+ .. [9] Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein, "Global
200
212
  Horizontal Irradiance Clear Sky Models: Implementation and Analysis"
201
213
  Sandia Report, (2012).
202
214
  '''
@@ -229,6 +241,9 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):
229
241
  elif 'gueymard1993' == model:
230
242
  am = (1.0 / (np.cos(zenith_rad) +
231
243
  0.00176759*(z)*((94.37515 - z) ** - 1.21563)))
244
+ elif 'gueymard2003' == model:
245
+ am = (1.0 / (np.cos(zenith_rad) +
246
+ 0.48353*(z**0.095846)/(96.741 - z)**1.754))
232
247
  else:
233
248
  raise ValueError('%s is not a valid model for relativeairmass', model)
234
249
 
@@ -321,175 +336,10 @@ def gueymard94_pw(temp_air, relative_humidity):
321
336
  return pw
322
337
 
323
338
 
324
- def first_solar_spectral_correction(pw, airmass_absolute,
325
- module_type=None, coefficients=None,
326
- min_pw=0.1, max_pw=8):
327
- r"""
328
- Spectral mismatch modifier based on precipitable water and absolute
329
- (pressure-adjusted) airmass.
330
-
331
- Estimates a spectral mismatch modifier :math:`M` representing the effect on
332
- module short circuit current of variation in the spectral
333
- irradiance. :math:`M` is estimated from absolute (pressure currected) air
334
- mass, :math:`AM_a`, and precipitable water, :math:`Pw`, using the following
335
- function:
336
-
337
- .. math::
338
-
339
- M = c_1 + c_2 AM_a + c_3 Pw + c_4 AM_a^{0.5}
340
- + c_5 Pw^{0.5} + c_6 \frac{AM_a} {Pw^{0.5}}
341
-
342
- Default coefficients are determined for several cell types with
343
- known quantum efficiency curves, by using the Simple Model of the
344
- Atmospheric Radiative Transfer of Sunshine (SMARTS) [1]_. Using
345
- SMARTS, spectrums are simulated with all combinations of AMa and
346
- Pw where:
347
-
348
- * :math:`0.5 \textrm{cm} <= Pw <= 5 \textrm{cm}`
349
- * :math:`1.0 <= AM_a <= 5.0`
350
- * Spectral range is limited to that of CMP11 (280 nm to 2800 nm)
351
- * spectrum simulated on a plane normal to the sun
352
- * All other parameters fixed at G173 standard
353
-
354
- From these simulated spectra, M is calculated using the known
355
- quantum efficiency curves. Multiple linear regression is then
356
- applied to fit Eq. 1 to determine the coefficients for each module.
357
-
358
- Based on the PVLIB Matlab function ``pvl_FSspeccorr`` by Mitchell
359
- Lee and Alex Panchula of First Solar, 2016 [2]_.
360
-
361
- Parameters
362
- ----------
363
- pw : array-like
364
- atmospheric precipitable water. [cm]
365
-
366
- airmass_absolute : array-like
367
- absolute (pressure-adjusted) airmass. [unitless]
368
-
369
- min_pw : float, default 0.1
370
- minimum atmospheric precipitable water. Any pw value lower than min_pw
371
- is set to min_pw to avoid model divergence. [cm]
372
-
373
- max_pw : float, default 8
374
- maximum atmospheric precipitable water. Any pw value higher than max_pw
375
- is set to NaN to avoid model divergence. [cm]
376
-
377
- module_type : None or string, default None
378
- a string specifying a cell type. Values of 'cdte', 'monosi', 'xsi',
379
- 'multisi', and 'polysi' (can be lower or upper case). If provided,
380
- module_type selects default coefficients for the following modules:
381
-
382
- * 'cdte' - First Solar Series 4-2 CdTe module.
383
- * 'monosi', 'xsi' - First Solar TetraSun module.
384
- * 'multisi', 'polysi' - anonymous multi-crystalline silicon module.
385
- * 'cigs' - anonymous copper indium gallium selenide module.
386
- * 'asi' - anonymous amorphous silicon module.
387
-
388
- The module used to calculate the spectral correction
389
- coefficients corresponds to the Multi-crystalline silicon
390
- Manufacturer 2 Model C from [3]_. The spectral response (SR) of CIGS
391
- and a-Si modules used to derive coefficients can be found in [4]_
392
-
393
- coefficients : None or array-like, default None
394
- Allows for entry of user-defined spectral correction
395
- coefficients. Coefficients must be of length 6. Derivation of
396
- coefficients requires use of SMARTS and PV module quantum
397
- efficiency curve. Useful for modeling PV module types which are
398
- not included as defaults, or to fine tune the spectral
399
- correction to a particular PV module. Note that the parameters for
400
- modules with very similar quantum efficiency should be similar,
401
- in most cases limiting the need for module specific coefficients.
402
-
403
- Returns
404
- -------
405
- modifier: array-like
406
- spectral mismatch factor (unitless) which is can be multiplied
407
- with broadband irradiance reaching a module's cells to estimate
408
- effective irradiance, i.e., the irradiance that is converted to
409
- electrical current.
410
-
411
- References
412
- ----------
413
- .. [1] Gueymard, Christian. SMARTS2: a simple model of the atmospheric
414
- radiative transfer of sunshine: algorithms and performance
415
- assessment. Cocoa, FL: Florida Solar Energy Center, 1995.
416
- .. [2] Lee, Mitchell, and Panchula, Alex. "Spectral Correction for
417
- Photovoltaic Module Performance Based on Air Mass and Precipitable
418
- Water." IEEE Photovoltaic Specialists Conference, Portland, 2016
419
- .. [3] Marion, William F., et al. User's Manual for Data for Validating
420
- Models for PV Module Performance. National Renewable Energy
421
- Laboratory, 2014. http://www.nrel.gov/docs/fy14osti/61610.pdf
422
- .. [4] Schweiger, M. and Hermann, W, Influence of Spectral Effects
423
- on Energy Yield of Different PV Modules: Comparison of Pwat and
424
- MMF Approach, TUV Rheinland Energy GmbH report 21237296.003,
425
- January 2017
426
- """
427
-
428
- # --- Screen Input Data ---
429
-
430
- # *** Pw ***
431
- # Replace Pw Values below 0.1 cm with 0.1 cm to prevent model from
432
- # diverging"
433
- pw = np.atleast_1d(pw)
434
- pw = pw.astype('float64')
435
- if np.min(pw) < min_pw:
436
- pw = np.maximum(pw, min_pw)
437
- warn(f'Exceptionally low pw values replaced with {min_pw} cm to '
438
- 'prevent model divergence')
439
-
440
- # Warn user about Pw data that is exceptionally high
441
- if np.max(pw) > max_pw:
442
- pw[pw > max_pw] = np.nan
443
- warn('Exceptionally high pw values replaced by np.nan: '
444
- 'check input data.')
445
-
446
- # *** AMa ***
447
- # Replace Extremely High AM with AM 10 to prevent model divergence
448
- # AM > 10 will only occur very close to sunset
449
- if np.max(airmass_absolute) > 10:
450
- airmass_absolute = np.minimum(airmass_absolute, 10)
451
-
452
- # Warn user about AMa data that is exceptionally low
453
- if np.min(airmass_absolute) < 0.58:
454
- warn('Exceptionally low air mass: ' +
455
- 'model not intended for extra-terrestrial use')
456
- # pvl_absoluteairmass(1,pvl_alt2pres(4340)) = 0.58 Elevation of
457
- # Mina Pirquita, Argentian = 4340 m. Highest elevation city with
458
- # population over 50,000.
459
-
460
- _coefficients = {}
461
- _coefficients['cdte'] = (
462
- 0.86273, -0.038948, -0.012506, 0.098871, 0.084658, -0.0042948)
463
- _coefficients['monosi'] = (
464
- 0.85914, -0.020880, -0.0058853, 0.12029, 0.026814, -0.0017810)
465
- _coefficients['xsi'] = _coefficients['monosi']
466
- _coefficients['polysi'] = (
467
- 0.84090, -0.027539, -0.0079224, 0.13570, 0.038024, -0.0021218)
468
- _coefficients['multisi'] = _coefficients['polysi']
469
- _coefficients['cigs'] = (
470
- 0.85252, -0.022314, -0.0047216, 0.13666, 0.013342, -0.0008945)
471
- _coefficients['asi'] = (
472
- 1.12094, -0.047620, -0.0083627, -0.10443, 0.098382, -0.0033818)
473
-
474
- if module_type is not None and coefficients is None:
475
- coefficients = _coefficients[module_type.lower()]
476
- elif module_type is None and coefficients is not None:
477
- pass
478
- elif module_type is None and coefficients is None:
479
- raise TypeError('No valid input provided, both module_type and ' +
480
- 'coefficients are None')
481
- else:
482
- raise TypeError('Cannot resolve input, must supply only one of ' +
483
- 'module_type and coefficients')
484
-
485
- # Evaluate Spectral Shift
486
- coeff = coefficients
487
- ama = airmass_absolute
488
- modifier = (
489
- coeff[0] + coeff[1]*ama + coeff[2]*pw + coeff[3]*np.sqrt(ama) +
490
- coeff[4]*np.sqrt(pw) + coeff[5]*ama/np.sqrt(pw))
491
-
492
- 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)
493
343
 
494
344
 
495
345
  def bird_hulstrom80_aod_bb(aod380, aod500):