Skip to content

Commit df724bc

Browse files
committed
add irrad/temp tolerance parameters
1 parent f91884c commit df724bc

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

pvlib/ivtools/sdm/pvsyst.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ def fit_pvsyst_iec61853_sandia(effective_irradiance, temp_cell,
315315
cells_in_series, EgRef=1.121,
316316
alpha_sc=None, beta_mp=None,
317317
r_sh_coeff=0.12, R_s=None,
318-
min_Rsh_irradiance=None):
318+
min_Rsh_irradiance=None,
319+
irradiance_tolerance=20,
320+
temperature_tolerance=1):
319321
"""
320322
Estimate parameters for the PVsyst module performance model using
321323
IEC 61853-1 matrix measurements.
@@ -357,6 +359,14 @@ def fit_pvsyst_iec61853_sandia(effective_irradiance, temp_cell,
357359
Irradiance threshold below which values are excluded when estimating
358360
shunt resistance parameter values. May be useful for modules
359361
with problematic low-light measurements. [W/m²]
362+
irradiance_tolerance : float, default 20
363+
Tolerance for irradiance variation around the STC value.
364+
The default value corresponds to a +/- 2% interval around the STC
365+
value of 1000 W/m². [W/m²]
366+
temperature_tolerance : float, default 1
367+
Tolerance for temperature variation around the STC value.
368+
The default value corresponds to a +/- 1 degree interval around the STC
369+
value of 25 degrees. [C]
360370
361371
Returns
362372
-------
@@ -409,8 +419,10 @@ def fit_pvsyst_iec61853_sandia(effective_irradiance, temp_cell,
409419
except ImportError:
410420
raise ImportError('fit_pvsyst_iec61853_sandia requires statsmodels')
411421

412-
is_g_stc = effective_irradiance == 1000
413-
is_t_stc = temp_cell == 25
422+
is_g_stc = np.isclose(effective_irradiance, 1000, rtol=0,
423+
atol=irradiance_tolerance)
424+
is_t_stc = np.isclose(temp_cell, 25, rtol=0,
425+
atol=temperature_tolerance)
414426

415427
if alpha_sc is None:
416428
i_sc_ref = float(i_sc[is_g_stc & is_t_stc])

0 commit comments

Comments
 (0)