2

I have a raster calculator expression:

Power("dataset.tif",1.5)

where dataset is float, and has some negative values.

When I run this expression in raster calculator, all of the negative values within the dataset have an output of 'nodata'.

How can I overcome this issue?

2
  • 1
    What do you want to see? The answer you have IS correct?
    – FelixIP
    Jul 7, 2016 at 21:40
  • Raising a negative number to a non-integer power is "complex"... ;)
    – user2856
    Jul 8, 2016 at 2:20

2 Answers 2

1

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?

-1

I can't find this in Esri doc, but this blog suggests that the ** operator means "to the power of" so "dataset.tif" ** 1.5 may get you what you want.

1
  • No, "dataset.tif" ** 1.5 will get exactly the same result as Power("dataset.tif", 1.5)
    – user2856
    Jul 8, 2016 at 2:23

Your Answer

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

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