Skip to content

Commit 828af99

Browse files
committed
Updated pointers to current SAM files, updated column names, and added replace chars for equipment names [Issue 75]
1 parent 8f8422c commit 828af99

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

pvlib/pvsystem.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,12 @@ def calcparams_desoto(poa_global, temp_cell, alpha_isc, module_parameters,
294294
database. The module_parameters dict must contain the
295295
following 5 fields:
296296
297-
* A_ref - modified diode ideality factor parameter at
297+
* a_ref - modified diode ideality factor parameter at
298298
reference conditions (units of eV), a_ref can be calculated
299299
from the usual diode ideality factor (n),
300300
number of cells in series (Ns),
301301
and cell temperature (Tcell) per equation (2) in [1].
302-
* I_l_ref - Light-generated current (or photocurrent)
302+
* I_L_ref - Light-generated current (or photocurrent)
303303
in amperes at reference conditions. This value is referred to
304304
as Iph in some literature.
305305
* I_o_ref - diode reverse saturation current in amperes,
@@ -447,8 +447,8 @@ def calcparams_desoto(poa_global, temp_cell, alpha_isc, module_parameters,
447447
'''
448448

449449
M = np.max(M, 0)
450-
a_ref = module_parameters['A_ref']
451-
IL_ref = module_parameters['I_l_ref']
450+
a_ref = module_parameters['a_ref']
451+
IL_ref = module_parameters['I_L_ref']
452452
I0_ref = module_parameters['I_o_ref']
453453
Rsh_ref = module_parameters['R_sh_ref']
454454
Rs_ref = module_parameters['R_s']
@@ -534,11 +534,11 @@ def retrieve_sam(name=None, samfile=None):
534534
name = name.lower()
535535

536536
if name == 'cecmod':
537-
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec-modules-2014-1-14.csv'
537+
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec-modules-2015-6-30.csv'
538538
elif name == 'sandiamod':
539-
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-sandia-modules-2014-1-14.csv'
540-
elif name == 'sandiainverter':
541-
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-sandia-inverters-2014-1-14.csv'
539+
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-sandia-modules-2015-6-30.csv'
540+
elif name == 'sandiainverter': # Still only one current inverter set, so left it as sandia, to avoid breaking old code
541+
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec-inverters-2015-6-30.csv'
542542
elif samfile is None:
543543
raise ValueError('invalid name {}'.format(name))
544544

@@ -561,13 +561,15 @@ def retrieve_sam(name=None, samfile=None):
561561

562562

563563
def _parse_raw_sam_df(csvdata):
564-
df = pd.read_csv(csvdata, index_col=0)
564+
df = pd.read_csv(csvdata, index_col=0, skiprows=[1,2])
565565
parsedindex = []
566566
for index in df.index:
567567
parsedindex.append(index.replace(' ', '_').replace('-', '_')
568568
.replace('.', '_').replace('(', '_')
569569
.replace(')', '_').replace('[', '_')
570-
.replace(']', '_').replace(':', '_'))
570+
.replace(']', '_').replace(':', '_')
571+
.replace('+', '_').replace('/', '_')
572+
.replace('"', '_').replace(',', '_'))
571573

572574
df.index = parsedindex
573575
df = df.transpose()
@@ -635,7 +637,7 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
635637
reference condition (1/C)
636638
Aimp Maximum power current temperature coefficient at
637639
reference condition (1/C)
638-
Bvoc Open circuit voltage temperature coefficient at
640+
Bvoco Open circuit voltage temperature coefficient at
639641
reference condition (V/C)
640642
Mbvoc Coefficient providing the irradiance dependence for the BetaVoc
641643
temperature coefficient at reference irradiance (V/C)
@@ -644,7 +646,7 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
644646
Mbvmp Coefficient providing the irradiance dependence for the
645647
BetaVmp temperature coefficient at reference irradiance (V/C)
646648
N Empirically determined "diode factor" (dimensionless)
647-
#Series Number of cells in series in a module's cell string(s)
649+
Cells in Series Number of cells in series in a module's cell string(s)
648650
IXO Ix at reference conditions
649651
IXXO Ixx at reference conditions
650652
FD Fraction of diffuse irradiance used by module
@@ -693,12 +695,12 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
693695
(1 + module['Aimp']*(temp_cell - T0)) )
694696

695697
dfout['v_oc'] = (( module['Voco'] +
696-
module['#Series']*delta*np.log(Ee) + Bvoco*(temp_cell - T0) )
698+
module['Cells in Series']*delta*np.log(Ee) + Bvoco*(temp_cell - T0) )
697699
.clip_lower(0))
698700

699701
dfout['v_mp'] = ( module['Vmpo'] +
700-
module['C2']*module['#Series']*delta*np.log(Ee) +
701-
module['C3']*module['#Series']*((delta*np.log(Ee)) ** 2) +
702+
module['C2']*module['Cells in Series']*delta*np.log(Ee) +
703+
module['C3']*module['Cells in Series']*((delta*np.log(Ee)) ** 2) +
702704
Bvmpo*(temp_cell - T0) ).clip_lower(0)
703705

704706
dfout['p_mp'] = dfout['i_mp'] * dfout['v_mp']

pvlib/test/test_pvsystem.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def test_calcparams_desoto():
117117
cecmodule = sam_data['cecmod'].Example_Module
118118
pvsystem.calcparams_desoto(irrad_data['ghi'],
119119
temp_cell=25,
120-
alpha_isc=cecmodule['Alpha_sc'],
120+
alpha_isc=cecmodule['alpha_sc'],
121121
module_parameters=cecmodule,
122122
EgRef=1.121,
123123
dEgdT=-0.0002677)
@@ -133,7 +133,7 @@ def test_singlediode_series():
133133
IL, I0, Rs, Rsh, nNsVth = pvsystem.calcparams_desoto(
134134
irrad_data['ghi'],
135135
temp_cell=25,
136-
alpha_isc=cecmodule['Alpha_sc'],
136+
alpha_isc=cecmodule['alpha_sc'],
137137
module_parameters=cecmodule,
138138
EgRef=1.121,
139139
dEgdT=-0.0002677)
@@ -198,5 +198,5 @@ def test_snlinverter_float():
198198
pdcs = idcs * vdcs
199199

200200
pacs = pvsystem.snlinverter(inverters[testinv], vdcs, pdcs)
201-
assert_almost_equals(pacs, 132.004308, 5)
201+
assert_almost_equals(pacs, 132.004278, 5)
202202

0 commit comments

Comments
 (0)