Multiply raster by Numpy derived float value

المشرف العام

Administrator
طاقم الإدارة
So I have a python script that uses numpy to calculate the mean of a field, then I try to use that mean value in a raster multiplication as follows:

na = arcpy.da.TableToNumPyArray("%SCRATCHWORKSPACE%\\rc_instruments_sr_noNULL2", "ratio") dMeanRatio = numpy.mean(na["ratio"]) outCorrectedSR = Raster(outSimulated) * dMeanRatioThis gives an error of:

TypeError: expected a raster or layer nameThis error is not referring to "Raster(outSimulated)" because I've replaced dMeanRatio with a hard-coded value and the script runs just fine. So my question is, how do I convert the dMeanRatio into a value that is acceptable to the raster multiplication?



أكثر...
 
أعلى