twhiteaker

Raster Calculator Requires Cell Size and Extent with Trig Functions

Discussion created by twhiteaker on Mar 10, 2011
Latest reply on Mar 17, 2011 by Dan_Patterson
I'm reporting an issue and solution involving the Raster Calculator tool in ArcToolbox for ArcGIS 10.  Raster Calculator works fine until I include a trig function such as Cos().  When my expressions include a trig function, I get this error message upon execution:

ERROR 000539: Error running expression: rcexec() <type 'exceptions.RuntimeError'>: No CellSize and Extent set

A simple expression which produces this error is Cos(0)*"myraster".

To resolve the issue, I click Environments in the Raster Calculator window, and then set the Extent (under Processing Extent) and Cell Size (under Raster Analysis) to be "Same as layer myraster."  The tool then executes correctly, although it does warn me that the input and output datums don't match (even though they do appear to match).

I'm curious why using Cos() requires extents and cell sizes to be explicitly set.  But at least there's a workaround.

Outcomes