Skip to content

Commit 67963c4

Browse files
committed
adapt to changed keys from pvlib perez function
pvlib/pvlib-python#2627
1 parent ff6c4d6 commit 67963c4

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

pvfactors/irradiance/utils.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,18 @@ def perez_diffuse_luminance(timestamps, surface_tilt, surface_azimuth,
114114
# Calculate diffuse luminance
115115
luminance = pd.DataFrame(
116116
np.array([
117-
components['horizon'] / vf_perez['vf_horizon'],
118-
components['circumsolar'] / vf_perez['vf_circumsolar'],
119-
components['isotropic'] / vf_perez['vf_isotropic']
117+
components['poa_horizon'] / vf_perez['vf_horizon'],
118+
components['poa_circumsolar'] / vf_perez['vf_circumsolar'],
119+
components['poa_isotropic'] / vf_perez['vf_isotropic']
120120
]).T,
121121
index=df_inputs.index,
122122
columns=['luminance_horizon', 'luminance_circumsolar',
123123
'luminance_isotropic']
124124
)
125-
luminance.loc[components['sky_diffuse'] == 0, :] = 0.
126-
127-
# Format components column names
128-
components = components.rename(columns={'isotropic': 'poa_isotropic',
129-
'circumsolar': 'poa_circumsolar',
130-
'horizon': 'poa_horizon'})
125+
luminance.loc[components['poa_sky_diffuse'] == 0, :] = 0.
131126

132127
df_inputs = pd.concat([df_inputs, components, vf_perez, luminance],
133128
axis=1, join='outer')
134-
df_inputs = df_inputs.rename(columns={'sky_diffuse': 'poa_total_diffuse'})
135129

136130
# Adjust the circumsolar luminance when it hits the back surface
137131
if df_inputs_back_surface.shape[0] > 0:

0 commit comments

Comments
 (0)