pvlib 0.10.5__py3-none-any.whl → 0.11.0a1__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.
- pvlib/__init__.py +1 -0
- pvlib/albedo.py +168 -0
- pvlib/data/ASTMG173.csv +2004 -0
- pvlib/iam.py +28 -28
- pvlib/iotools/__init__.py +0 -1
- pvlib/iotools/midc.py +15 -10
- pvlib/iotools/psm3.py +10 -25
- pvlib/iotools/srml.py +0 -61
- pvlib/irradiance.py +133 -95
- pvlib/location.py +13 -5
- pvlib/modelchain.py +2 -165
- pvlib/pvsystem.py +23 -63
- pvlib/shading.py +350 -0
- pvlib/spectrum/__init__.py +5 -0
- pvlib/spectrum/mismatch.py +572 -43
- pvlib/spectrum/spectrl2.py +8 -8
- pvlib/tests/iotools/test_psm3.py +0 -18
- pvlib/tests/iotools/test_srml.py +1 -43
- pvlib/tests/test_albedo.py +84 -0
- pvlib/tests/test_inverter.py +2 -2
- pvlib/tests/test_irradiance.py +35 -2
- pvlib/tests/test_location.py +26 -18
- pvlib/tests/test_modelchain.py +0 -57
- pvlib/tests/test_pvsystem.py +11 -39
- pvlib/tests/test_shading.py +167 -1
- pvlib/tests/test_singlediode.py +0 -19
- pvlib/tests/test_spectrum.py +283 -22
- pvlib/tests/test_temperature.py +7 -7
- pvlib/tests/test_tools.py +24 -0
- pvlib/tests/test_transformer.py +60 -0
- pvlib/tools.py +27 -0
- pvlib/transformer.py +117 -0
- {pvlib-0.10.5.dist-info → pvlib-0.11.0a1.dist-info}/METADATA +1 -1
- {pvlib-0.10.5.dist-info → pvlib-0.11.0a1.dist-info}/RECORD +38 -34
- {pvlib-0.10.5.dist-info → pvlib-0.11.0a1.dist-info}/WHEEL +1 -1
- pvlib/data/astm_g173_am15g.csv +0 -2003
- {pvlib-0.10.5.dist-info → pvlib-0.11.0a1.dist-info}/AUTHORS.md +0 -0
- {pvlib-0.10.5.dist-info → pvlib-0.11.0a1.dist-info}/LICENSE +0 -0
- {pvlib-0.10.5.dist-info → pvlib-0.11.0a1.dist-info}/top_level.txt +0 -0
pvlib/__init__.py
CHANGED
pvlib/albedo.py
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The ``albedo`` module contains functions for modeling albedo.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from pvlib.tools import sind
|
|
6
|
+
import numpy as np
|
|
7
|
+
import pandas as pd
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Sources of for the albedo values are provided in
|
|
11
|
+
# pvlib.irradiance.get_ground_diffuse.
|
|
12
|
+
SURFACE_ALBEDOS = {
|
|
13
|
+
'urban': 0.18,
|
|
14
|
+
'grass': 0.20,
|
|
15
|
+
'fresh grass': 0.26,
|
|
16
|
+
'soil': 0.17,
|
|
17
|
+
'sand': 0.40,
|
|
18
|
+
'snow': 0.65,
|
|
19
|
+
'fresh snow': 0.75,
|
|
20
|
+
'asphalt': 0.12,
|
|
21
|
+
'concrete': 0.30,
|
|
22
|
+
'aluminum': 0.85,
|
|
23
|
+
'copper': 0.74,
|
|
24
|
+
'fresh steel': 0.35,
|
|
25
|
+
'dirty steel': 0.08,
|
|
26
|
+
'sea': 0.06,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
WATER_COLOR_COEFFS = {
|
|
30
|
+
'clear_water_no_waves': 0.13,
|
|
31
|
+
'clear_water_ripples_up_to_2.5cm': 0.16,
|
|
32
|
+
'clear_water_ripples_larger_than_2.5cm_occasional_whitecaps': 0.23,
|
|
33
|
+
'clear_water_frequent_whitecaps': 0.3,
|
|
34
|
+
'green_water_ripples_up_to_2.5cm': 0.22,
|
|
35
|
+
'muddy_water_no_waves': 0.19
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
WATER_ROUGHNESS_COEFFS = {
|
|
39
|
+
'clear_water_no_waves': 0.29,
|
|
40
|
+
'clear_water_ripples_up_to_2.5cm': 0.7,
|
|
41
|
+
'clear_water_ripples_larger_than_2.5cm_occasional_whitecaps': 1.25,
|
|
42
|
+
'clear_water_frequent_whitecaps': 2,
|
|
43
|
+
'green_water_ripples_up_to_2.5cm': 0.7,
|
|
44
|
+
'muddy_water_no_waves': 0.29
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def inland_water_dvoracek(solar_elevation, surface_condition=None,
|
|
49
|
+
color_coeff=None, wave_roughness_coeff=None):
|
|
50
|
+
r"""
|
|
51
|
+
Estimation of albedo for inland water bodies.
|
|
52
|
+
|
|
53
|
+
The available surface conditions are for inland water bodies, e.g., lakes
|
|
54
|
+
and ponds. For ocean/open sea, see
|
|
55
|
+
:py:const:`pvlib.albedo.SURFACE_ALBEDOS`.
|
|
56
|
+
|
|
57
|
+
Parameters
|
|
58
|
+
----------
|
|
59
|
+
solar_elevation : numeric
|
|
60
|
+
Sun elevation angle. [degrees]
|
|
61
|
+
|
|
62
|
+
surface_condition : string, optional
|
|
63
|
+
If supplied, overrides ``color_coeff`` and ``wave_roughness_coeff``.
|
|
64
|
+
``surface_condition`` can be one of the following:
|
|
65
|
+
|
|
66
|
+
* ``'clear_water_no_waves'``
|
|
67
|
+
* ``'clear_water_ripples_up_to_2.5cm'``
|
|
68
|
+
* ``'clear_water_ripples_larger_than_2.5cm_occasional_whitecaps'``
|
|
69
|
+
* ``'clear_water_frequent_whitecaps'``
|
|
70
|
+
* ``'green_water_ripples_up_to_2.5cm'``
|
|
71
|
+
* ``'muddy_water_no_waves'``
|
|
72
|
+
|
|
73
|
+
color_coeff : float, optional
|
|
74
|
+
Water color coefficient. [-]
|
|
75
|
+
|
|
76
|
+
wave_roughness_coeff : float, optional
|
|
77
|
+
Water wave roughness coefficient. [-]
|
|
78
|
+
|
|
79
|
+
Returns
|
|
80
|
+
-------
|
|
81
|
+
albedo : numeric
|
|
82
|
+
Albedo for inland water bodies. [-]
|
|
83
|
+
|
|
84
|
+
Raises
|
|
85
|
+
------
|
|
86
|
+
ValueError
|
|
87
|
+
If neither of ``surface_condition`` nor a combination of
|
|
88
|
+
``color_coeff`` and ``wave_roughness_coeff`` are given.
|
|
89
|
+
If ``surface_condition`` and any of ``color_coeff`` or
|
|
90
|
+
``wave_roughness_coeff`` are given. These parameters are
|
|
91
|
+
mutually exclusive.
|
|
92
|
+
|
|
93
|
+
KeyError
|
|
94
|
+
If ``surface_condition`` is invalid.
|
|
95
|
+
|
|
96
|
+
Notes
|
|
97
|
+
-----
|
|
98
|
+
The equation for calculating the albedo :math:`\rho` is given by
|
|
99
|
+
|
|
100
|
+
.. math::
|
|
101
|
+
:label: albedo
|
|
102
|
+
|
|
103
|
+
\rho = c^{(r \cdot \sin(\alpha) + 1)}
|
|
104
|
+
|
|
105
|
+
Inputs to the model are the water color coefficient :math:`c` [-], the
|
|
106
|
+
water wave roughness coefficient :math:`r` [-] and the solar elevation
|
|
107
|
+
:math:`\alpha` [degrees]. Parameters are provided in [1]_ , and are coded
|
|
108
|
+
for convenience in :data:`~pvlib.albedo.WATER_COLOR_COEFFS` and
|
|
109
|
+
:data:`~pvlib.albedo.WATER_ROUGHNESS_COEFFS`. The values of these
|
|
110
|
+
coefficients are experimentally determined.
|
|
111
|
+
|
|
112
|
+
+------------------------+-------------------+-------------------------+
|
|
113
|
+
| Surface and condition | Color coefficient | Wave roughness |
|
|
114
|
+
| | (:math:`c`) | coefficient (:math:`r`) |
|
|
115
|
+
+========================+===================+=========================+
|
|
116
|
+
| Clear water, no waves | 0.13 | 0.29 |
|
|
117
|
+
+------------------------+-------------------+-------------------------+
|
|
118
|
+
| Clear water, ripples | 0.16 | 0.70 |
|
|
119
|
+
| up to 2.5 cm | | |
|
|
120
|
+
+------------------------+-------------------+-------------------------+
|
|
121
|
+
| Clear water, ripples | 0.23 | 1.25 |
|
|
122
|
+
| larger than 2.5 cm | | |
|
|
123
|
+
| (occasional whitecaps) | | |
|
|
124
|
+
+------------------------+-------------------+-------------------------+
|
|
125
|
+
| Clear water, | 0.30 | 2.00 |
|
|
126
|
+
| frequent whitecaps | | |
|
|
127
|
+
+------------------------+-------------------+-------------------------+
|
|
128
|
+
| Green water, ripples | 0.22 | 0.70 |
|
|
129
|
+
| up to 2.5cm | | |
|
|
130
|
+
+------------------------+-------------------+-------------------------+
|
|
131
|
+
| Muddy water, no waves | 0.19 | 0.29 |
|
|
132
|
+
+------------------------+-------------------+-------------------------+
|
|
133
|
+
|
|
134
|
+
References
|
|
135
|
+
----------
|
|
136
|
+
.. [1] Dvoracek M.J., Hannabas B. (1990). "Prediction of albedo for use in
|
|
137
|
+
evapotranspiration and irrigation scheduling." IN: Visions of the Future
|
|
138
|
+
American Society of Agricultural Engineers 04-90: 692-699.
|
|
139
|
+
"""
|
|
140
|
+
|
|
141
|
+
if surface_condition is not None and (
|
|
142
|
+
color_coeff is None and wave_roughness_coeff is None
|
|
143
|
+
):
|
|
144
|
+
# use surface_condition
|
|
145
|
+
color_coeff = WATER_COLOR_COEFFS[surface_condition]
|
|
146
|
+
wave_roughness_coeff = WATER_ROUGHNESS_COEFFS[surface_condition]
|
|
147
|
+
|
|
148
|
+
elif surface_condition is None and not (
|
|
149
|
+
color_coeff is None or wave_roughness_coeff is None
|
|
150
|
+
):
|
|
151
|
+
# use provided color_coeff and wave_roughness_coeff
|
|
152
|
+
pass
|
|
153
|
+
else:
|
|
154
|
+
raise ValueError(
|
|
155
|
+
"Either a `surface_condition` has to be chosen or"
|
|
156
|
+
" a combination of `color_coeff` and"
|
|
157
|
+
" `wave_roughness_coeff`.")
|
|
158
|
+
|
|
159
|
+
solar_elevation_positive = np.where(solar_elevation < 0, 0,
|
|
160
|
+
solar_elevation)
|
|
161
|
+
|
|
162
|
+
albedo = color_coeff ** (wave_roughness_coeff *
|
|
163
|
+
sind(solar_elevation_positive) + 1)
|
|
164
|
+
|
|
165
|
+
if isinstance(solar_elevation, pd.Series):
|
|
166
|
+
albedo = pd.Series(albedo, index=solar_elevation.index)
|
|
167
|
+
|
|
168
|
+
return albedo
|