Closed brentwilder closed 2 months ago
Thanks for getting this started @brentwilder
From a software design perspective - What do you think about this pseudo code:
def dozier_2022(...):
# New logic
def dozier_and_frew_1992(..):
# Old logic
def viewf(...)
# old common code
for angle in angles:
# horizon angles
hcos = horizon(angle, dem, spacing)
azimuth = d2r(angle)
if method == 'dozier_2022':
dozier_2022()
elif method == 'dozier_and_frew_1990':
dozier_and_frew_1990()
else:
raise("Unknown sky view factor method given")
ind = intgrnd > 0
svf[ind] = svf[ind] + intgrnd[ind]
# Compute final arrays
svf = svf / len(angles)
tcf = (1 + cos_slope)/2 - svf
return svf, tcf
This keeps common components and has less duplicated lines.
@jomey ,yep I agree it makes sense too in case there is an updated method as well. Can be plugged in quite easily in this way. I believe everything is ready now!
These equations are more accurate than the 1990 method, as they also account for the slope obscuring the horizon. This change as I have typed up here should still work nicely with this current branch of parallelizing the code.