AnsweredAssumed Answered

map algebra expression / raster calculator arcmap10

Question asked by max1987 on May 23, 2012
Latest reply on May 23, 2012 by max1987
hey folks,
i???ve got a problem concerning the raster-calculator-tool in arcmap 10. I hope someone can help me. excuse my poor english skills???
the situation:
- i model drainage-systems based on high-resolution lidar-dgm (1m).
- i want to thin-out the flow-accumulation-tool results
- therefore I want to eliminate all streams that have less then 50 cells and have no upstream connection (last are called 1st-order streams)
- i created a stream-link-raster (it tells the lenght of segment in the attribute-table-field COUNT) and a stream-order-raster (it gives each segment an order-number beginning with 1) [both tools are available in spatial analyst ??? hydrology-toolset]
- now i need a single-output-map-algebra-expression that says:

???if the stream order is 1 and the stream segment has 50 cells or less, then turn the cell into NoData. Otherwise, return the stream link ID.???

i tried to solve this problem using the raster calculator.
first things first: i???m absolutely not a pro in skripting/programming! Not even at this simple level???
i'm sure its only a little mistake, but i can???t find it by myself.
my code looks like this:

SetNull("str_ord_klein"  == 1  &  "StreamLink".COUNT <= 50, "StreamLink")

"str_ord_klein"  is the stream-order-raster
"StreamLink" is the stream-link-raster

the process starts but it is cancelled immediately saying this:

Executing: RasterCalculator SetNull("str_ord_klein"  == 1  &  "StreamLink".COUNT   <  50, "StreamLink") "D:\Daten\Studium\DIPLOMARBEIT\GIS\Hydrologie Modellierung\Rasterdaten\STREAM EDITED\stream_thinned"
Start Time: Wed May 23 13:35:00 2012
SetNull(Raster(r"str_ord_klein")  == 1  &  Raster(r"StreamLink").COUNT   <  50, Raster(r"StreamLink"))
ERROR 000539: Error running expression: rcexec() <type 'exceptions.AttributeError'>: 'Raster' object has no attribute 'COUNT'
Failed to execute (RasterCalculator).
Failed at Wed May 23 13:35:00 2012 (Elapsed Time: 0,00 seconds)

i would be very happy and grateful if someone could help me.
kind regards,