I noticed that the rvt.vis.sky_illumination function was not taking well into account the np.nan values no matter which argument of no_data is chosen. This looks to be because np.maximum which is used in the function is propagating NaN values. np.fmax can be substituted to avoid this issue.
Here is the concerned part if it helps:
for i_dir, direction in enumerate(pyramid[0]["shift"]):
dir_rad = np.radians(direction)
# reset maximum at each iteration (direction)
max_slope = np.zeros(pyramid[n_levels]["dem"].shape, dtype=np.float32) - 1000
for i_level in reversed(range(n_levels + 1)):
height = pyramid[i_level]["dem"]
move = pyramid[i_level]["shift"]
# ... and to the search radius
for i_rad, radius in enumerate(move[direction]["distance"]):
# get shift index from move dictionary
shift_indx = move[direction]["shift"][i_rad]
# estimate the slope
_ = np.maximum((np.roll(height, shift_indx, axis=(0, 1)) - height) / radius, 0.) # <----- replace with np.fmax
# compare to the previous max slope and keep the larges
max_slope = np.maximum(max_slope, _) # <----- replace with np.fmax
I noticed that the
rvt.vis.sky_illuminationfunction was not taking well into account thenp.nanvalues no matter which argument ofno_datais chosen. This looks to be becausenp.maximumwhich is used in the function is propagating NaN values.np.fmaxcan be substituted to avoid this issue.Here is the concerned part if it helps: