MATLAB_PV_LIB icon indicating copy to clipboard operation
MATLAB_PV_LIB copied to clipboard

pvl_singleaxis produces NaN surface tilt angles near solar noon

Open DanRiley opened this issue 6 years ago • 0 comments
trafficstars

pvl_singleaxis can produce NaN results for the surface tilt angle when the tilt is 0. Error stems from the following line: SurfTilt = 90 - acosd(dividend./divisor);

When divisor is 0, the division by 0 produces NaN.

Possible fixes could be setting divisor to a very small number (eps) when it is 0, or simply setting SurfTilt to 0 any time that divisor is 0.

DanRiley avatar Nov 29 '18 22:11 DanRiley