r-barnes / richdem

High-performance Terrain and Hydrology Analysis
GNU General Public License v3.0
272 stars 70 forks source link

Have to flip the calculated aspect vertically #36

Open AnsArn opened 4 years ago

AnsArn commented 4 years ago

Until now, I calculated the aspect of a digital elevation model with the following command:

gdaldem aspect -of NETCDF $DEM_TIF $OUTPUT_netCDF.nc

When I calculate the aspect with richdem within Python:

import richdem as rd
aspect = rd.TerrainAttribute(rd.LoadGDAL($DEM_TIF), attrib = 'aspect')

I have to flip the array vertically (with numpy.flipud(aspect)) to store the aspect as netCDF and have the same results as with gdaldem. Could you help me to identify what might be the reason. I want to calculate the aspect with richdem, because for some DEMs I get NaNs for some pixels with gdaldem.