Getting orographical orientation with Python

Hello, good morning to everyone,

I am currently working with a 2D Numpy array that contains the altitudes of a geographical area.

I am performing a meteorological experiment, where, for each grid point, I want to consider only a filtered set of neighboring grid points according to their orographical orientation.

For example, in the case of precipitation, if I am considering a grid point which falls into the northern side of a mountain, I do not want to take into account precipitation data of neighboring grid points that fall into the southern side of the mountain, because the climatology in that side will not be comparable to the one in the northern side.

For this reason I would like to find a Python tool that performs the calculation of the geographical orientation. I have found a Python package named “richdem” that contains a function called “TerrainAttribute” that seems to perform this calculation.

However, I would like to know if there exist other ways (libraries, functions) to get this geographical orientation.

Regards,

Joan

I would start by finding the gradient of the field at each point with numpy.gradient. This will give you the steepness and sign of the slope in the north-south and the east-west direction. From this you can calculate the direction of the slope at each point and use that to filter by only certain directions.

1 Like

Good morning Matt,

Many thanks for your comments, it seems to be a good approximation to perform the slope orientation filtering.