LUE likes NumPy

We have added support for translating NumPy arrays to LUE arrays and back to the LUE Python package. This opens up the possibility to mix code using LUE with other packages, like GDAL, Geopandas, h5py, NumPy, Pandas, and SciPy. Care must be taken though, that LUE operations execute asynchronously, and operations from the other package do not, which may lead to surprising results.

In this post I will illustrate the new from_numpy and to_numpy operations with a simple use-case. Let's assume we want to create a map of the province of Utrecht, showing an indication of the relief and of the hydrological network.

Obtain: - altitude -> AHN - river network -> MERIT-HYDRO, reproject to NL projection of AHN

Calculate / set - altitude angle -> how high the sun is on the sky surface: 45 degrees - azimuth angle -> compass direction (0: north, 180: south): 315: north-west - slope -> calculate with LUE - aspect -> calculate with LUE

shaded relief = 255 * ((cos(90 - altitude) * cos(slope)) + (sin(90 - altitude) * sin(slope) * cos(azimuth – aspect)))

Turn this into a separate LUE operation?