1

I would like to compute the expression displayed in the image with the Raster Calculator tool by using the slope (degrees) derived from the SRTM 30m DEM data. However, it results in NoData values for some of the pixels. The problematic part of the formula that is responsible for the NoData values it seems to be the part surrounded by the red box. This is happening to pixels that have negative sinθ values. In particular, when I solely calculate the sin of the slope raster the output is correct and contains both positive and negative values. However, when I use the power of 0.8 the negatives sinθ values lead to NoData values.

P.S. None of my DEM and thus slope pixels have NoData values. I also try to convert my slope raster to unsigned bit and then try the calculations again (without using the Float() function), but still the NoData values were there. The Power() function does not work as well. enter image description here

2
  • Do you have the Spatial Analyst extension available? If so, what happens when you use the Slope tool?
    – Stu Smith
    May 3, 2021 at 15:15
  • Dear @StuSmith I have the Spatial Analyst extension checked. When I use the slope tool everything seems to work right. The output is from 0 to 74.653 degrees. I saw somewhere in Stack Exchange that: "According to the Python help file: If both x and y are finite, x is negative, and y is not an integer then pow(x, y) is undefined, and raises ValueError. May be this is the source of your error? The x needs to be a positive integer if you want y to be a double?" As such, it might be the case that what I want to do i simpossible on ArcMap May 3, 2021 at 15:19

1 Answer 1

0

According to the Python help file: If both x and y are finite, x is negative, and y is not an integer then Power(x, y) is undefined, and results to NoData. As such, the x needs to be a positive integer if you want y to be a double.

Examples that I tried:

Power(Sin("%Slope_degrees_clipped (2)%"), 1.5) --> results in NoData values when the sinθ is negative and y is float/double

Power(Sin("%Slope_degrees_clipped (2)%"), 1.5) --> works fine when the sinθ is positive and y is float/double

Power(Sin("%Slope_degrees_clipped (2)%"), 2) --> works fine when sinθ is negative and y is integer.

I also tried it on Python and QGIS but still it does not work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.