0

I have Longitude, Latitude and Elevation data in a .ascii file. I know my file contains the correct data as I can plot many other types of maps fine.

I would like to create a slope map. I have done this by defining a 3x3 rolling window over my elevation grid and applying differential maths to each pixel - Credit to this extremely helpful post https://stackoverflow.com/a/56882214 which gets me most of the way there. I appear to be running into an issue where the code fails and periodic gaps form.

Slope map from one dataset Slope map from different dataset

I get the warnings: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. When turning a generated list into an array. Generator code credit to https://stackoverflow.com/a/48216770/8410622.

I also get the warning: MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3. Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading']. This will become an error two minor releases later. plt.pcolormesh(xs, ys, slopes_angle, cmap='nipy_spectral', vmin=min, vmax=max, shading='flat').

Any suggestions would be great.

0 Answers0