@@ -537,7 +537,7 @@ def retrieve_sam(name=None, samfile=None):
537
537
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec-modules-2015-6-30.csv'
538
538
elif name == 'sandiamod' :
539
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
540
+ elif name in [ 'cecinverter' , ' sandiainverter'] : # Allowing either, to provide for old code, while aligning with current expectations
541
541
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec-inverters-2015-6-30.csv'
542
542
elif samfile is None :
543
543
raise ValueError ('invalid name {}' .format (name ))
@@ -562,6 +562,13 @@ def retrieve_sam(name=None, samfile=None):
562
562
563
563
def _parse_raw_sam_df (csvdata ):
564
564
df = pd .read_csv (csvdata , index_col = 0 , skiprows = [1 ,2 ])
565
+ colnames = df .columns .values .tolist ()
566
+ parsedcolnames = []
567
+ for cn in colnames :
568
+ parsedcolnames .append (cn .replace (' ' , '_' ))
569
+
570
+ df .columns = parsedcolnames
571
+
565
572
parsedindex = []
566
573
for index in df .index :
567
574
parsedindex .append (index .replace (' ' , '_' ).replace ('-' , '_' )
@@ -646,7 +653,7 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
646
653
Mbvmp Coefficient providing the irradiance dependence for the
647
654
BetaVmp temperature coefficient at reference irradiance (V/C)
648
655
N Empirically determined "diode factor" (dimensionless)
649
- Cells in Series Number of cells in series in a module's cell string(s)
656
+ Cells_in_Series Number of cells in series in a module's cell string(s)
650
657
IXO Ix at reference conditions
651
658
IXXO Ixx at reference conditions
652
659
FD Fraction of diffuse irradiance used by module
@@ -695,12 +702,12 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
695
702
(1 + module ['Aimp' ]* (temp_cell - T0 )) )
696
703
697
704
dfout ['v_oc' ] = (( module ['Voco' ] +
698
- module ['Cells in Series ' ]* delta * np .log (Ee ) + Bvoco * (temp_cell - T0 ) )
705
+ module ['Cells_in_Series ' ]* delta * np .log (Ee ) + Bvoco * (temp_cell - T0 ) )
699
706
.clip_lower (0 ))
700
707
701
708
dfout ['v_mp' ] = ( module ['Vmpo' ] +
702
- module ['C2' ]* module ['Cells in Series ' ]* delta * np .log (Ee ) +
703
- module ['C3' ]* module ['Cells in Series ' ]* ((delta * np .log (Ee )) ** 2 ) +
709
+ module ['C2' ]* module ['Cells_in_Series ' ]* delta * np .log (Ee ) +
710
+ module ['C3' ]* module ['Cells_in_Series ' ]* ((delta * np .log (Ee )) ** 2 ) +
704
711
Bvmpo * (temp_cell - T0 ) ).clip_lower (0 )
705
712
706
713
dfout ['p_mp' ] = dfout ['i_mp' ] * dfout ['v_mp' ]
0 commit comments