X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08 Mar 2006 01:05 AM by  anon
Mask using band math
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
08 Mar 2006 01:05 AM
    How to mask DN value (eg: -9999 to 0) using band math?

    Deleted User



    New Member


    Posts:
    New Member


    --
    08 Mar 2006 01:05 AM
    The term "band math" always makes me think of RSI's second "flagship" product ENVI. If you are indeed an ENVI user, be aware that RSI's User Forum website has a separate forum for ENVI questions. I give here, though, a general solution for masking let's say a 2D signed 16-bit image band, where the user wishes to mask out all values between -9999 and 0: maskValue = 0 maskedImg2D = origImg2D maskedImg2D[where(maskedImg2D le 0)] = maskValue The above is probably the most traditional (or intuitive) way to mask. The below, probably more efficient, code would produce the same result: maskedImg2D = origImg2D > 0 That one line sets all values that are not gt 0 to 0, while leaving untouched all values that are already gt 0. James Jones
    You are not authorized to post a reply.