ERROR 000539 in Raster Calculator with JPEG 2000

1031
1
Jump to solution
10-08-2021 07:22 AM
Labels (2)
BeckB
by
New Contributor III

I'm using ArcGIS Pro 2.8.3. I'm trying to do a calculation with the Raster Calculator tool for files in the JPEG 2000 format, but when I try running my code, I receive the error message 

Failed: error ERROR 000539: Traceback (most recent call last):

File "<expression>", line 1, in <module>

File "<string>", line 5, in rcexec_DC684390_0C54_4F14_9EBF_B34DF3F2E1B1

TypeError: unsupported operand type(s) for /: 'str' and 'int'

My code is:

 

2.5*((("B08a"/10000)-("B04a"/10000))/((("B08a"/10000)+(6*("B04a"/10000))-(7.5*("B02a"/10000)))+1))

 

where B08a, B04a, and B02a are all rasters in the JPEG2000 format.

Any advice on why I might be getting this error or how to fix it would be greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

"B08a" is a string

B08a  is a variable name

z = 2.5 * ((B08a/10000 - B04a/10000) / ((B08a/10000 + 6*(B04a/10000)) - (7.5 * B02a/10000)) + 1)

... sort of retired...

View solution in original post

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

"B08a" is a string

B08a  is a variable name

z = 2.5 * ((B08a/10000 - B04a/10000) / ((B08a/10000 + 6*(B04a/10000)) - (7.5 * B02a/10000)) + 1)

... sort of retired...
0 Kudos