pvlib 0.11.0a1__py3-none-any.whl → 0.11.2__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/_deprecation.py +73 -0
- pvlib/atmosphere.py +236 -1
- pvlib/bifacial/__init__.py +4 -4
- pvlib/bifacial/loss_models.py +163 -0
- pvlib/clearsky.py +53 -51
- pvlib/data/pvgis_tmy_meta.json +32 -93
- pvlib/data/pvgis_tmy_test.csv +8761 -0
- pvlib/data/tmy_45.000_8.000_2005_2023.csv +8789 -0
- pvlib/data/tmy_45.000_8.000_2005_2023.epw +8768 -0
- pvlib/data/tmy_45.000_8.000_2005_2023.json +1 -0
- pvlib/data/tmy_45.000_8.000_2005_2023.txt +8761 -0
- pvlib/data/tmy_45.000_8.000_userhorizon.json +1 -1
- pvlib/iam.py +4 -4
- pvlib/iotools/midc.py +1 -1
- pvlib/iotools/pvgis.py +39 -13
- pvlib/irradiance.py +237 -173
- pvlib/ivtools/sdm.py +75 -52
- pvlib/location.py +5 -5
- pvlib/modelchain.py +1 -1
- pvlib/pvsystem.py +134 -86
- pvlib/shading.py +8 -8
- pvlib/singlediode.py +1 -1
- pvlib/solarposition.py +101 -80
- pvlib/spa.py +28 -24
- pvlib/spectrum/__init__.py +9 -4
- pvlib/spectrum/irradiance.py +273 -0
- pvlib/spectrum/mismatch.py +118 -508
- pvlib/spectrum/response.py +280 -0
- pvlib/spectrum/spectrl2.py +18 -17
- pvlib/temperature.py +49 -3
- pvlib/tests/bifacial/test_losses_models.py +54 -0
- pvlib/tests/iotools/test_pvgis.py +58 -12
- pvlib/tests/ivtools/test_sdm.py +23 -1
- pvlib/tests/spectrum/__init__.py +0 -0
- pvlib/tests/spectrum/conftest.py +40 -0
- pvlib/tests/spectrum/test_irradiance.py +138 -0
- pvlib/tests/{test_spectrum.py → spectrum/test_mismatch.py} +32 -306
- pvlib/tests/spectrum/test_response.py +124 -0
- pvlib/tests/spectrum/test_spectrl2.py +72 -0
- pvlib/tests/test__deprecation.py +97 -0
- pvlib/tests/test_atmosphere.py +218 -0
- pvlib/tests/test_clearsky.py +44 -26
- pvlib/tests/test_conftest.py +0 -44
- pvlib/tests/test_irradiance.py +62 -16
- pvlib/tests/test_pvsystem.py +17 -1
- pvlib/tests/test_solarposition.py +117 -36
- pvlib/tests/test_spa.py +30 -1
- pvlib/tools.py +26 -2
- pvlib/tracking.py +53 -47
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.2.dist-info}/METADATA +34 -31
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.2.dist-info}/RECORD +55 -47
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.2.dist-info}/WHEEL +1 -1
- pvlib/data/aod550_tcwv_20121101_test.nc +0 -0
- pvlib/data/pvgis_tmy_test.dat +0 -8761
- pvlib/data/tmy_45.000_8.000_2005_2016.csv +0 -8789
- pvlib/data/tmy_45.000_8.000_2005_2016.epw +0 -8768
- pvlib/data/tmy_45.000_8.000_2005_2016.json +0 -1
- pvlib/data/tmy_45.000_8.000_2005_2016.txt +0 -8761
- pvlib/data/variables_style_rules.csv +0 -55
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.2.dist-info}/AUTHORS.md +0 -0
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.2.dist-info}/LICENSE +0 -0
- {pvlib-0.11.0a1.dist-info → pvlib-0.11.2.dist-info}/top_level.txt +0 -0
pvlib/ivtools/sdm.py
CHANGED
|
@@ -120,52 +120,55 @@ def fit_cec_sam(celltype, v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc,
|
|
|
120
120
|
|
|
121
121
|
def fit_desoto(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc, cells_in_series,
|
|
122
122
|
EgRef=1.121, dEgdT=-0.0002677, temp_ref=25, irrad_ref=1000,
|
|
123
|
-
root_kwargs={}):
|
|
123
|
+
init_guess={}, root_kwargs={}):
|
|
124
124
|
"""
|
|
125
125
|
Calculates the parameters for the De Soto single diode model.
|
|
126
126
|
|
|
127
|
-
This procedure (described in [1]_)
|
|
128
|
-
|
|
127
|
+
This procedure (described in [1]_) fits the De Soto model [2]_ using
|
|
128
|
+
common specifications given by manufacturers in the
|
|
129
129
|
datasheets of PV modules.
|
|
130
130
|
|
|
131
|
-
The solution is found using
|
|
132
|
-
with the
|
|
133
|
-
No restriction is put on the fit variables,
|
|
131
|
+
The solution is found using :py:func:`scipy.optimize.root`,
|
|
132
|
+
with the default solver method 'hybr'.
|
|
133
|
+
No restriction is put on the fit variables, e.g. series
|
|
134
134
|
or shunt resistance could go negative. Nevertheless, if it happens,
|
|
135
|
-
check carefully the inputs and their units
|
|
136
|
-
often given in %/K in manufacturers datasheets
|
|
137
|
-
in A/K and V/K here.
|
|
135
|
+
check carefully the inputs and their units. For example, ``alpha_sc`` and
|
|
136
|
+
``beta_voc`` are often given in %/K in manufacturers datasheets but should
|
|
137
|
+
be given in A/K and V/K here.
|
|
138
138
|
|
|
139
139
|
The parameters returned by this function can be used by
|
|
140
|
-
:py:func:`pvlib.pvsystem.calcparams_desoto` to calculate
|
|
141
|
-
different irradiance and cell temperature.
|
|
140
|
+
:py:func:`pvlib.pvsystem.calcparams_desoto` to calculate single diode
|
|
141
|
+
equation parameters at different irradiance and cell temperature.
|
|
142
142
|
|
|
143
143
|
Parameters
|
|
144
144
|
----------
|
|
145
145
|
v_mp: float
|
|
146
|
-
Module voltage at the maximum-power point at reference conditions [V]
|
|
146
|
+
Module voltage at the maximum-power point at reference conditions. [V]
|
|
147
147
|
i_mp: float
|
|
148
|
-
Module current at the maximum-power point at reference conditions [A]
|
|
148
|
+
Module current at the maximum-power point at reference conditions. [A]
|
|
149
149
|
v_oc: float
|
|
150
|
-
Open-circuit voltage at reference conditions [V]
|
|
150
|
+
Open-circuit voltage at reference conditions. [V]
|
|
151
151
|
i_sc: float
|
|
152
|
-
Short-circuit current at reference conditions [A]
|
|
152
|
+
Short-circuit current at reference conditions. [A]
|
|
153
153
|
alpha_sc: float
|
|
154
|
-
The short-circuit current (i_sc) temperature coefficient of the
|
|
155
|
-
module [A/K]
|
|
154
|
+
The short-circuit current (``i_sc``) temperature coefficient of the
|
|
155
|
+
module. [A/K]
|
|
156
156
|
beta_voc: float
|
|
157
|
-
The open-circuit voltage (v_oc) temperature coefficient of the
|
|
158
|
-
module [V/K]
|
|
157
|
+
The open-circuit voltage (``v_oc``) temperature coefficient of the
|
|
158
|
+
module. [V/K]
|
|
159
159
|
cells_in_series: integer
|
|
160
160
|
Number of cell in the module.
|
|
161
161
|
EgRef: float, default 1.121 eV - value for silicon
|
|
162
|
-
Energy of bandgap of semi-conductor used [eV]
|
|
162
|
+
Energy of bandgap of semi-conductor used. [eV]
|
|
163
163
|
dEgdT: float, default -0.0002677 - value for silicon
|
|
164
|
-
Variation of bandgap according to temperature [
|
|
164
|
+
Variation of bandgap according to temperature. [1/K]
|
|
165
165
|
temp_ref: float, default 25
|
|
166
|
-
Reference temperature condition [C]
|
|
166
|
+
Reference temperature condition. [C]
|
|
167
167
|
irrad_ref: float, default 1000
|
|
168
|
-
Reference irradiance condition [
|
|
168
|
+
Reference irradiance condition. [Wm⁻²]
|
|
169
|
+
init_guess: dict, optional
|
|
170
|
+
Initial values for optimization. Keys can be `'Rsh_0'`, `'a_0'`,
|
|
171
|
+
`'IL_0'`, `'Io_0'`, `'Rs_0'`.
|
|
169
172
|
root_kwargs : dictionary, optional
|
|
170
173
|
Dictionary of arguments to pass onto scipy.optimize.root()
|
|
171
174
|
|
|
@@ -173,13 +176,13 @@ def fit_desoto(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc, cells_in_series,
|
|
|
173
176
|
-------
|
|
174
177
|
dict with the following elements:
|
|
175
178
|
I_L_ref: float
|
|
176
|
-
Light-generated current at reference conditions [A]
|
|
179
|
+
Light-generated current at reference conditions. [A]
|
|
177
180
|
I_o_ref: float
|
|
178
|
-
Diode saturation current at reference conditions [A]
|
|
181
|
+
Diode saturation current at reference conditions. [A]
|
|
179
182
|
R_s: float
|
|
180
|
-
Series resistance [ohm]
|
|
183
|
+
Series resistance. [ohm]
|
|
181
184
|
R_sh_ref: float
|
|
182
|
-
Shunt resistance at reference conditions [ohm].
|
|
185
|
+
Shunt resistance at reference conditions. [ohm].
|
|
183
186
|
a_ref: float
|
|
184
187
|
Modified ideality factor at reference conditions.
|
|
185
188
|
The product of the usual diode ideality factor (n, unitless),
|
|
@@ -187,15 +190,15 @@ def fit_desoto(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc, cells_in_series,
|
|
|
187
190
|
specified effective irradiance and cell temperature.
|
|
188
191
|
alpha_sc: float
|
|
189
192
|
The short-circuit current (i_sc) temperature coefficient of the
|
|
190
|
-
module [A/K]
|
|
193
|
+
module. [A/K]
|
|
191
194
|
EgRef: float
|
|
192
|
-
Energy of bandgap of semi-conductor used [eV]
|
|
195
|
+
Energy of bandgap of semi-conductor used. [eV]
|
|
193
196
|
dEgdT: float
|
|
194
|
-
Variation of bandgap according to temperature [
|
|
197
|
+
Variation of bandgap according to temperature. [1/K]
|
|
195
198
|
irrad_ref: float
|
|
196
|
-
Reference irradiance condition [
|
|
199
|
+
Reference irradiance condition. [Wm⁻²]
|
|
197
200
|
temp_ref: float
|
|
198
|
-
Reference temperature condition [C]
|
|
201
|
+
Reference temperature condition. [C]
|
|
199
202
|
|
|
200
203
|
scipy.optimize.OptimizeResult
|
|
201
204
|
Optimization result of scipy.optimize.root().
|
|
@@ -203,9 +206,12 @@ def fit_desoto(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc, cells_in_series,
|
|
|
203
206
|
|
|
204
207
|
References
|
|
205
208
|
----------
|
|
206
|
-
.. [1]
|
|
209
|
+
.. [1] J. A Duffie, W. A Beckman, "Solar Engineering of Thermal Processes",
|
|
210
|
+
4th ed., Wiley, 2013. :doi:`10.1002/9781118671603`
|
|
211
|
+
.. [2] W. De Soto et al., "Improvement and validation of a model for
|
|
207
212
|
photovoltaic array performance", Solar Energy, vol 80, pp. 78-88,
|
|
208
213
|
2006. :doi:`10.1016/j.solener.2005.06.010`
|
|
214
|
+
|
|
209
215
|
"""
|
|
210
216
|
|
|
211
217
|
# Constants
|
|
@@ -213,14 +219,24 @@ def fit_desoto(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc, cells_in_series,
|
|
|
213
219
|
Tref = temp_ref + 273.15 # [K]
|
|
214
220
|
|
|
215
221
|
# initial guesses of variables for computing convergence:
|
|
216
|
-
#
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
IL_0 = i_sc
|
|
220
|
-
|
|
221
|
-
|
|
222
|
+
# Default values are taken from [1], p753
|
|
223
|
+
init_guess_keys = ['IL_0', 'Io_0', 'Rs_0', 'Rsh_0', 'a_0'] # order matters
|
|
224
|
+
init = {key: None for key in init_guess_keys}
|
|
225
|
+
init['IL_0'] = i_sc
|
|
226
|
+
init['a_0'] = 1.5*k*Tref*cells_in_series
|
|
227
|
+
init['Io_0'] = i_sc * np.exp(-v_oc/init['a_0'])
|
|
228
|
+
init['Rs_0'] = (init['a_0']*np.log1p((init['IL_0'] - i_mp)/init['Io_0'])
|
|
229
|
+
- v_mp) / i_mp
|
|
230
|
+
init['Rsh_0'] = 100.0
|
|
231
|
+
# overwrite if optional init_guess is provided
|
|
232
|
+
for key in init_guess:
|
|
233
|
+
if key in init_guess_keys:
|
|
234
|
+
init[key] = init_guess[key]
|
|
235
|
+
else:
|
|
236
|
+
raise ValueError(f"'{key}' is not a valid name;"
|
|
237
|
+
f" allowed values are {init_guess_keys}")
|
|
222
238
|
# params_i : initial values vector
|
|
223
|
-
params_i = np.array([
|
|
239
|
+
params_i = np.array([init[k] for k in init_guess_keys])
|
|
224
240
|
|
|
225
241
|
# specs of module
|
|
226
242
|
specs = (i_sc, v_oc, i_mp, v_mp, beta_voc, alpha_sc, EgRef, dEgdT,
|
|
@@ -546,27 +562,34 @@ def fit_desoto_sandia(ivcurves, specs, const=None, maxiter=5, eps1=1.e-3):
|
|
|
546
562
|
-------
|
|
547
563
|
dict
|
|
548
564
|
I_L_ref : float
|
|
549
|
-
|
|
565
|
+
Light current at STC [A]
|
|
550
566
|
I_o_ref : float
|
|
551
|
-
|
|
567
|
+
Dark current at STC [A]
|
|
552
568
|
EgRef : float
|
|
553
|
-
|
|
569
|
+
Effective band gap at STC [eV]
|
|
554
570
|
R_s : float
|
|
555
|
-
|
|
571
|
+
Series resistance at STC [ohm]
|
|
556
572
|
R_sh_ref : float
|
|
557
|
-
|
|
573
|
+
Shunt resistance at STC [ohm]
|
|
558
574
|
cells_in_series : int
|
|
559
|
-
|
|
575
|
+
Number of cells in series
|
|
560
576
|
iph : array
|
|
561
|
-
|
|
577
|
+
Light current for each IV curve [A]
|
|
562
578
|
io : array
|
|
563
|
-
|
|
579
|
+
Dark current for each IV curve [A]
|
|
564
580
|
rs : array
|
|
565
|
-
|
|
581
|
+
Series resistance for each IV curve [ohm]
|
|
566
582
|
rsh : array
|
|
567
|
-
|
|
583
|
+
Shunt resistance for each IV curve [ohm]
|
|
584
|
+
a_ref : float
|
|
585
|
+
The product of the usual diode ideality factor (n, unitless),
|
|
586
|
+
number of cells in series (Ns), and cell thermal voltage at
|
|
587
|
+
reference conditions, in units of V.
|
|
588
|
+
dEgdT : float
|
|
589
|
+
The temperature dependence of the energy bandgap (Eg) at reference
|
|
590
|
+
conditions [1/K].
|
|
568
591
|
u : array
|
|
569
|
-
|
|
592
|
+
Boolean for each IV curve indicating that the parameter values
|
|
570
593
|
are deemed reasonable by the private function ``_filter_params``
|
|
571
594
|
|
|
572
595
|
Notes
|
|
@@ -855,7 +878,7 @@ def _extract_sdm_params(ee, tc, iph, io, rs, rsh, n, u, specs, const,
|
|
|
855
878
|
params['R_sh_exp'] = R_sh_exp
|
|
856
879
|
|
|
857
880
|
elif model == 'desoto':
|
|
858
|
-
dEgdT = 0.0002677
|
|
881
|
+
dEgdT = -0.0002677
|
|
859
882
|
x_for_io = const['q'] / const['k'] * (
|
|
860
883
|
1. / tok - 1. / tck[u] + dEgdT * (tc[u] - const['T0']) / tck[u])
|
|
861
884
|
|
pvlib/location.py
CHANGED
|
@@ -101,7 +101,8 @@ class Location:
|
|
|
101
101
|
Parameters
|
|
102
102
|
----------
|
|
103
103
|
tmy_metadata : dict
|
|
104
|
-
Returned from
|
|
104
|
+
Returned from :py:func:`~pvlib.iotools.read_tmy2` or
|
|
105
|
+
:py:func:`~pvlib.iotools.read_tmy3`
|
|
105
106
|
tmy_data : DataFrame, optional
|
|
106
107
|
Optionally attach the TMY data to this object.
|
|
107
108
|
|
|
@@ -145,14 +146,13 @@ class Location:
|
|
|
145
146
|
Parameters
|
|
146
147
|
----------
|
|
147
148
|
metadata : dict
|
|
148
|
-
Returned from
|
|
149
|
+
Returned from :py:func:`~pvlib.iotools.read_epw`
|
|
149
150
|
data : DataFrame, optional
|
|
150
151
|
Optionally attach the epw data to this object.
|
|
151
152
|
|
|
152
153
|
Returns
|
|
153
154
|
-------
|
|
154
|
-
Location
|
|
155
|
-
called this method from).
|
|
155
|
+
Location
|
|
156
156
|
"""
|
|
157
157
|
|
|
158
158
|
latitude = metadata['latitude']
|
|
@@ -282,7 +282,7 @@ class Location:
|
|
|
282
282
|
"""
|
|
283
283
|
Calculate the relative and absolute airmass.
|
|
284
284
|
|
|
285
|
-
Automatically chooses zenith or
|
|
285
|
+
Automatically chooses zenith or apparent zenith
|
|
286
286
|
depending on the selected model.
|
|
287
287
|
|
|
288
288
|
Parameters
|
pvlib/modelchain.py
CHANGED
|
@@ -1474,7 +1474,7 @@ class ModelChain:
|
|
|
1474
1474
|
data : DataFrame, or tuple or list of DataFrame
|
|
1475
1475
|
Contains plane-of-array irradiance data. Required column names
|
|
1476
1476
|
include ``'poa_global'``, ``'poa_direct'`` and ``'poa_diffuse'``.
|
|
1477
|
-
Columns with weather-related data are
|
|
1477
|
+
Columns with weather-related data are assigned to the
|
|
1478
1478
|
``weather`` attribute. If columns for ``'temp_air'`` and
|
|
1479
1479
|
``'wind_speed'`` are not provided, air temperature of 20 C and wind
|
|
1480
1480
|
speed of 0 m/s are assumed.
|