Hello, a question about an expression in anisotropic_sky.py, since the intent is not obvious from the code alone.
The reflected shortwave from sunlit building surfaces is:
sunlit_surface = ((albedo * (radI * np.cos(solar_altitude * deg2rad)) + (radD * 0.5)) / np.pi)
The parentheses close after the direct-beam term, so albedo scales only radI * cos(alt); the diffuse part radD * 0.5 enters unscaled. The companion line for shaded surfaces does apply albedo to the same diffuse term:
shaded_surface = ((albedo * radD * 0.5) / np.pi)
Reading the two together, the intended form might be:
sunlit_surface = (albedo * (radI * np.cos(solar_altitude * deg2rad) + radD * 0.5)) / np.pi
With a wall albedo of 0.2 the current expression makes the diffuse contribution to the sunlit-surface reflection five times larger than the shaded-surface treatment would suggest. It only touches the sunlit-patch reflection term, so the overall effect is bounded, but it is systematic whenever the sun is up.
Is the current form intended? If there is a physical basis for reflecting the diffuse component without the albedo factor on sunlit surfaces, a short comment in the code would settle it for future readers. If it is a typo, a one-line PR is no problem.
Hello, a question about an expression in
anisotropic_sky.py, since the intent is not obvious from the code alone.The reflected shortwave from sunlit building surfaces is:
The parentheses close after the direct-beam term, so
albedoscales onlyradI * cos(alt); the diffuse partradD * 0.5enters unscaled. The companion line for shaded surfaces does apply albedo to the same diffuse term:Reading the two together, the intended form might be:
With a wall albedo of 0.2 the current expression makes the diffuse contribution to the sunlit-surface reflection five times larger than the shaded-surface treatment would suggest. It only touches the sunlit-patch reflection term, so the overall effect is bounded, but it is systematic whenever the sun is up.
Is the current form intended? If there is a physical basis for reflecting the diffuse component without the albedo factor on sunlit surfaces, a short comment in the code would settle it for future readers. If it is a typo, a one-line PR is no problem.