I'm trying to write a script that will, in part, calculate statistics for a raster layer in an Arcmap mxd, but when I run the script I get an "invalid parameter" error (Error 000840), saying that the value isn't a Mosaic Layer, Mosaic Catalog, or Raster Catalog. The Calculate Statistics tool in the toolbox works fine for a single raster, so I'm not sure how to fix this. Relevant code block:
import arcpy
inRaster = arcpy.GetParameterAsText(0)
arcpy.CalculateStatistics_management(inRaster, "1", "1", "-9999")
Any suggestions?