Skip to content

Commit 8ed1175

Browse files
committed
Modified for DF output
1 parent 9dbc91a commit 8ed1175

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

pvlib/irradiance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import numpy as np
44
import pvl_tools
55
import pandas as pd
6+
import pdb
67

78
def extraradiation(doy):
89
'''
@@ -123,8 +124,7 @@ def globalinplane(SurfTilt,SurfAz,AOI,DNI,In_Plane_SkyDiffuse, GR):
123124
Ediff = var.In_Plane_SkyDiffuse + var.GR
124125

125126

126-
127-
return E, Eb, Ediff
127+
return pd.DataFrame({'E':E,'Eb':Eb,'Ediff':Ediff})
128128

129129

130130

pvlib/pvsystem.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import pvl_tools
66
import scipy
7+
import urllib2
78
from scipy.special import lambertw
89

910

@@ -855,8 +856,8 @@ def sapm(Module,Eb,Ediff,Tcell,AM,AOI):
855856
AMcoeff=[var.Module['A4'],var.Module['A3'],var.Module['A2'],var.Module['A1'],var.Module['A0']]
856857
AOIcoeff=[var.Module['B5'],var.Module['B4'],var.Module['B3'],var.Module['B2'],var.Module['B1'],var.Module['B0']]
857858

858-
F1 = Np.polyval(AMcoeff,var.AM)
859-
F2 = Np.polyval(AOIcoeff,var.AOI)
859+
F1 = np.polyval(AMcoeff,var.AM)
860+
F2 = np.polyval(AOIcoeff,var.AOI)
860861
var.Ee= F1*((var.Eb*F2+var.Module['FD']*var.Ediff)/E0)
861862
#var['Ee']=F1*((var.Eb+var.Ediff)/E0)
862863
#print "Ee modifed, revert for main function"
@@ -872,9 +873,9 @@ def sapm(Module,Eb,Ediff,Tcell,AM,AOI):
872873
DFOut['Imp']=var.Module.ix['Impo']*((var.Module.ix['C0']*(var.Ee) + var.Module.ix['C1'] * (var.Ee ** 2)))*((1 + var.Module.ix['Aimp']*((var.Tcell - T0))))
873874
Bvoco=var.Module.ix['Bvoco'] + var.Module.ix['Mbvoc']*((1 - var.Ee))
874875
delta=var.Module.ix['N']*(k)*((var.Tcell + 273.15)) / q
875-
DFOut['Voc']=(var.Module.ix['Voco'] + var.Module.ix['#Series']*(delta)*(Np.log(var.Ee)) + Bvoco*((var.Tcell - T0)))
876+
DFOut['Voc']=(var.Module.ix['Voco'] + var.Module.ix['#Series']*(delta)*(np.log(var.Ee)) + Bvoco*((var.Tcell - T0)))
876877
Bvmpo=var.Module.ix['Bvmpo'] + var.Module.ix['Mbvmp']*((1 - var.Ee))
877-
DFOut['Vmp']=(var.Module.ix['Vmpo'] + var.Module.ix['C2']*(var.Module.ix['#Series'])*(delta)*(Np.log(var.Ee)) + var.Module.ix['C3']*(var.Module.ix['#Series'])*((delta*(Np.log(var.Ee))) ** 2) + Bvmpo*((var.Tcell - T0)))
878+
DFOut['Vmp']=(var.Module.ix['Vmpo'] + var.Module.ix['C2']*(var.Module.ix['#Series'])*(delta)*(np.log(var.Ee)) + var.Module.ix['C3']*(var.Module.ix['#Series'])*((delta*(np.log(var.Ee))) ** 2) + Bvmpo*((var.Tcell - T0)))
878879
DFOut['Vmp'][DFOut['Vmp']<0]=0
879880
DFOut['Pmp']=DFOut.Imp*DFOut.Vmp
880881
DFOut['Ix']=var.Module.ix['IXO'] * (var.Module.ix['C4']*(var.Ee) + var.Module.ix['C5']*((var.Ee) ** 2))*((1 + var.Module.ix['Aisc']*((var.Tcell - T0))))
@@ -992,7 +993,8 @@ def sapmcelltemp(E, Wspd, Tamb,modelt='Open_rack_cell_glassback',**kwargs):
992993

993994
Tcell=Tmodule + var.E / E0*(deltaT)
994995

995-
return Tcell, Tmodule
996+
return pd.DataFrame({'Tcell':Tcell,'Tmodule':Tmodule})
997+
996998
def singlediode(Module,IL,I0,Rs,Rsh,nNsVth,**kwargs):
997999
'''
9981000
Solve the single-diode model to obtain a photovoltaic IV curve

pvlib/solarposition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131

32-
def get_solarposition(time, location, method='pyephem', pressure=101325,
32+
def get_solarposition(time, location, method='spa', pressure=101325,
3333
temperature=12):
3434
"""
3535
A convenience wrapper for the solar position calculators.

0 commit comments

Comments
 (0)