Skip to content

Commit d8a8836

Browse files
committed
change sapm effective_irradiance to W/m2
1 parent 7057afc commit d8a8836

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

pvlib/pvsystem.py

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -404,21 +404,12 @@ def sapm(self, effective_irradiance, temp_cell, **kwargs):
404404
405405
Parameters
406406
----------
407-
poa_direct : Series
408-
The direct irradiance incident upon the module (W/m^2).
409-
410-
poa_diffuse : Series
411-
The diffuse irradiance incident on module.
407+
effective_irradiance : Series
408+
The effective irradiance incident upon the module (W/m^2).
412409
413410
temp_cell : Series
414411
The cell temperature (degrees C).
415412
416-
airmass_absolute : Series
417-
Absolute airmass.
418-
419-
aoi : Series
420-
Angle of incidence (degrees).
421-
422413
**kwargs
423414
See pvsystem.sapm for details
424415
@@ -505,7 +496,7 @@ def sapm_effective_irradiance(self, poa_direct, poa_diffuse,
505496
Returns
506497
-------
507498
effective_irradiance : numeric
508-
The SAPM effective irradiance.
499+
The SAPM effective irradiance in W/m^2.
509500
"""
510501
return sapm_effective_irradiance(
511502
poa_direct, poa_diffuse, airmass_absolute, aoi,
@@ -1649,7 +1640,7 @@ def _parse_raw_sam_df(csvdata):
16491640
return df
16501641

16511642

1652-
def sapm(effective_irradiance, temp_cell, module):
1643+
def sapm(effective_irradiance, temp_cell, module, reference_irradiance=1000):
16531644
'''
16541645
The Sandia PV Array Performance Model (SAPM) generates 5 points on a
16551646
PV module's I-V curve (Voc, Isc, Ix, Ixx, Vmp/Imp) according to
@@ -1658,7 +1649,7 @@ def sapm(effective_irradiance, temp_cell, module):
16581649
Parameters
16591650
----------
16601651
effective_irradiance : numeric
1661-
Effective irradiance (suns).
1652+
Effective irradiance (W/m^2).
16621653
16631654
temp_cell : numeric
16641655
The cell temperature (degrees C).
@@ -1667,6 +1658,9 @@ def sapm(effective_irradiance, temp_cell, module):
16671658
A dict, Series, or DataFrame defining the SAPM performance
16681659
parameters. See the notes section for more details.
16691660
1661+
reference_irradiance : float
1662+
Default 1000 W/m^2.
1663+
16701664
Returns
16711665
-------
16721666
A DataFrame with the columns:
@@ -1739,7 +1733,7 @@ def sapm(effective_irradiance, temp_cell, module):
17391733
kb = 1.38066e-23 # Boltzmann's constant in units of J/K
17401734

17411735
# avoid problem with integer input
1742-
Ee = np.array(effective_irradiance, dtype='float64')
1736+
Ee = np.array(effective_irradiance, dtype='float64') / reference_irradiance
17431737

17441738
# set up masking for 0, positive, and nan inputs
17451739
Ee_gt_0 = np.full_like(Ee, False, dtype='bool')
@@ -1986,7 +1980,7 @@ def sapm_aoi_loss(aoi, module, upper=None):
19861980

19871981

19881982
def sapm_effective_irradiance(poa_direct, poa_diffuse, airmass_absolute, aoi,
1989-
module, reference_irradiance=1000):
1983+
module):
19901984
"""
19911985
Calculates the SAPM effective irradiance using the SAPM spectral
19921986
loss and SAPM angle of incidence loss functions.
@@ -2010,21 +2004,16 @@ def sapm_effective_irradiance(poa_direct, poa_diffuse, airmass_absolute, aoi,
20102004
parameters. See the :py:func:`sapm` notes section for more
20112005
details.
20122006
2013-
reference_irradiance : numeric, default 1000
2014-
Reference irradiance by which to divide the input irradiance.
2015-
20162007
Returns
20172008
-------
20182009
effective_irradiance : numeric
2019-
The SAPM effective irradiance.
2010+
The SAPM effective irradiance in W/m^2.
20202011
"""
20212012

20222013
F1 = sapm_spectral_loss(airmass_absolute, module)
20232014
F2 = sapm_aoi_loss(aoi, module)
20242015

2025-
E0 = reference_irradiance
2026-
2027-
Ee = F1 * (poa_direct*F2 + module['FD']*poa_diffuse) / E0
2016+
Ee = F1 * (poa_direct*F2 + module['FD']*poa_diffuse)
20282017

20292018
return Ee
20302019

0 commit comments

Comments
 (0)