Skip to content

Commit 6907b6c

Browse files
Uwe KrienUwe Krien
Uwe Krien
authored and
Uwe Krien
committed
creating basic function to calculate DNI from GHI and DHI
1 parent 76d89c3 commit 6907b6c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

pvlib/irradiance.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,3 +1945,34 @@ def _get_dirint_coeffs():
19451945
[0.743440, 0.592190, 0.603060, 0.316930, 0.794390]]
19461946

19471947
return coeffs[1:, 1:, :, :]
1948+
1949+
1950+
def dni(ghi, dhi, zenith):
1951+
"""
1952+
Determine DNI from GHI and DHI.
1953+
1954+
Parameters
1955+
----------
1956+
ghi : array-like
1957+
Global horizontal irradiance in W/m^2.
1958+
1959+
dhi : array-like
1960+
Diffuse horizontal irradiance in W/m^2.
1961+
1962+
zenith : array-like
1963+
True (not refraction-corrected) zenith angles in decimal
1964+
degrees. If Z is a vector it must be of the same size as all
1965+
other vector inputs. Z must be >=0 and <=180.
1966+
1967+
Returns
1968+
-------
1969+
dni : array-like
1970+
The modeled direct normal irradiance in W/m^2
1971+
1972+
Notes
1973+
-----
1974+
Something
1975+
"""
1976+
tmp_dni = (ghi - dhi) / tools.cosd(zenith)
1977+
1978+
return tmp_dni

0 commit comments

Comments
 (0)