@@ -294,12 +294,12 @@ def calcparams_desoto(poa_global, temp_cell, alpha_isc, module_parameters,
294
294
database. The module_parameters dict must contain the
295
295
following 5 fields:
296
296
297
- * A_ref - modified diode ideality factor parameter at
297
+ * a_ref - modified diode ideality factor parameter at
298
298
reference conditions (units of eV), a_ref can be calculated
299
299
from the usual diode ideality factor (n),
300
300
number of cells in series (Ns),
301
301
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)
303
303
in amperes at reference conditions. This value is referred to
304
304
as Iph in some literature.
305
305
* I_o_ref - diode reverse saturation current in amperes,
@@ -447,8 +447,8 @@ def calcparams_desoto(poa_global, temp_cell, alpha_isc, module_parameters,
447
447
'''
448
448
449
449
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 ' ]
452
452
I0_ref = module_parameters ['I_o_ref' ]
453
453
Rsh_ref = module_parameters ['R_sh_ref' ]
454
454
Rs_ref = module_parameters ['R_s' ]
@@ -472,13 +472,13 @@ def calcparams_desoto(poa_global, temp_cell, alpha_isc, module_parameters,
472
472
473
473
def retrieve_sam (name = None , samfile = None ):
474
474
'''
475
- Retrieve lastest module and inverter info from SAM website.
475
+ Retrieve latest module and inverter info from SAM website.
476
476
477
477
This function will retrieve either:
478
478
479
479
* CEC module database
480
480
* Sandia Module database
481
- * Sandia Inverter database
481
+ * CEC Inverter database
482
482
483
483
and return it as a pandas dataframe.
484
484
@@ -489,7 +489,8 @@ def retrieve_sam(name=None, samfile=None):
489
489
Name can be one of:
490
490
491
491
* 'CECMod' - returns the CEC module database
492
- * 'SandiaInverter' - returns the Sandia Inverter database
492
+ * 'CECInverter' - returns the CEC Inverter database
493
+ * 'SandiaInverter' - returns the CEC Inverter database (CEC is only current inverter db available; tag kept for backwards compatibility)
493
494
* 'SandiaMod' - returns the Sandia Module database
494
495
495
496
samfile : String
@@ -503,14 +504,14 @@ def retrieve_sam(name=None, samfile=None):
503
504
Returns
504
505
-------
505
506
A DataFrame containing all the elements of the desired database.
506
- Each column representa a module or inverter, and a specific dataset
507
- can be retreived by the command
507
+ Each column represents a module or inverter, and a specific dataset
508
+ can be retrieved by the command
508
509
509
510
Examples
510
511
--------
511
512
512
513
>>> from pvlib import pvsystem
513
- >>> invdb = pvsystem.retrieve_sam(name='SandiaInverter ')
514
+ >>> invdb = pvsystem.retrieve_sam(name='CECInverter ')
514
515
>>> inverter = invdb.AE_Solar_Energy__AE6_0__277V__277V__CEC_2012_
515
516
>>> inverter
516
517
Vac 277.000000
@@ -534,11 +535,11 @@ def retrieve_sam(name=None, samfile=None):
534
535
name = name .lower ()
535
536
536
537
if name == 'cecmod' :
537
- url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec-modules-2014-1-14 .csv'
538
+ url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec-modules-2015-6-30 .csv'
538
539
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'
540
+ url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-sandia-modules-2015-6-30 .csv'
541
+ elif name in [ 'cecinverter' , ' sandiainverter']: # Allowing either, to provide for old code, while aligning with current expectations
542
+ url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec -inverters-2015-6-30 .csv'
542
543
elif samfile is None :
543
544
raise ValueError ('invalid name {}' .format (name ))
544
545
@@ -561,13 +562,22 @@ def retrieve_sam(name=None, samfile=None):
561
562
562
563
563
564
def _parse_raw_sam_df (csvdata ):
564
- df = pd .read_csv (csvdata , index_col = 0 )
565
+ df = pd .read_csv (csvdata , index_col = 0 , skiprows = [1 ,2 ])
566
+ colnames = df .columns .values .tolist ()
567
+ parsedcolnames = []
568
+ for cn in colnames :
569
+ parsedcolnames .append (cn .replace (' ' , '_' ))
570
+
571
+ df .columns = parsedcolnames
572
+
565
573
parsedindex = []
566
574
for index in df .index :
567
575
parsedindex .append (index .replace (' ' , '_' ).replace ('-' , '_' )
568
576
.replace ('.' , '_' ).replace ('(' , '_' )
569
577
.replace (')' , '_' ).replace ('[' , '_' )
570
- .replace (']' , '_' ).replace (':' , '_' ))
578
+ .replace (']' , '_' ).replace (':' , '_' )
579
+ .replace ('+' , '_' ).replace ('/' , '_' )
580
+ .replace ('"' , '_' ).replace (',' , '_' ))
571
581
572
582
df .index = parsedindex
573
583
df = df .transpose ()
@@ -635,7 +645,7 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
635
645
reference condition (1/C)
636
646
Aimp Maximum power current temperature coefficient at
637
647
reference condition (1/C)
638
- Bvoc Open circuit voltage temperature coefficient at
648
+ Bvoco Open circuit voltage temperature coefficient at
639
649
reference condition (V/C)
640
650
Mbvoc Coefficient providing the irradiance dependence for the BetaVoc
641
651
temperature coefficient at reference irradiance (V/C)
@@ -644,7 +654,7 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
644
654
Mbvmp Coefficient providing the irradiance dependence for the
645
655
BetaVmp temperature coefficient at reference irradiance (V/C)
646
656
N Empirically determined "diode factor" (dimensionless)
647
- #Series Number of cells in series in a module's cell string(s)
657
+ Cells_in_Series Number of cells in series in a module's cell string(s)
648
658
IXO Ix at reference conditions
649
659
IXXO Ixx at reference conditions
650
660
FD Fraction of diffuse irradiance used by module
@@ -693,12 +703,12 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
693
703
(1 + module ['Aimp' ]* (temp_cell - T0 )) )
694
704
695
705
dfout ['v_oc' ] = (( module ['Voco' ] +
696
- module ['#Series ' ]* delta * np .log (Ee ) + Bvoco * (temp_cell - T0 ) )
706
+ module ['Cells_in_Series ' ]* delta * np .log (Ee ) + Bvoco * (temp_cell - T0 ) )
697
707
.clip_lower (0 ))
698
708
699
709
dfout ['v_mp' ] = ( module ['Vmpo' ] +
700
- module ['C2' ]* module ['#Series ' ]* delta * np .log (Ee ) +
701
- module ['C3' ]* module ['#Series ' ]* ((delta * np .log (Ee )) ** 2 ) +
710
+ module ['C2' ]* module ['Cells_in_Series ' ]* delta * np .log (Ee ) +
711
+ module ['C3' ]* module ['Cells_in_Series ' ]* ((delta * np .log (Ee )) ** 2 ) +
702
712
Bvmpo * (temp_cell - T0 ) ).clip_lower (0 )
703
713
704
714
dfout ['p_mp' ] = dfout ['i_mp' ] * dfout ['v_mp' ]
0 commit comments