@@ -315,7 +315,9 @@ def fit_pvsyst_iec61853_sandia(effective_irradiance, temp_cell,
315
315
cells_in_series , EgRef = 1.121 ,
316
316
alpha_sc = None , beta_mp = None ,
317
317
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 ):
319
321
"""
320
322
Estimate parameters for the PVsyst module performance model using
321
323
IEC 61853-1 matrix measurements.
@@ -357,6 +359,14 @@ def fit_pvsyst_iec61853_sandia(effective_irradiance, temp_cell,
357
359
Irradiance threshold below which values are excluded when estimating
358
360
shunt resistance parameter values. May be useful for modules
359
361
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]
360
370
361
371
Returns
362
372
-------
@@ -409,8 +419,10 @@ def fit_pvsyst_iec61853_sandia(effective_irradiance, temp_cell,
409
419
except ImportError :
410
420
raise ImportError ('fit_pvsyst_iec61853_sandia requires statsmodels' )
411
421
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 )
414
426
415
427
if alpha_sc is None :
416
428
i_sc_ref = float (i_sc [is_g_stc & is_t_stc ])
0 commit comments