X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 06 Aug 2009 11:55 AM by  anon
Data type overflow using Band Math
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
06 Aug 2009 11:55 AM
    Hi everybody, first of all sorry for mi English ;) I'm working with DN and I want to use this expression:  1.017*DN -4.180 for band 1.  I've thougth to use this: byte( 1.017*b1-4.180) but I have the problem that if DN is, for example, 2, using that expresion it becames                 -2 --> 253, and  want that the minimun value was 0 I've read ENVI help but I have no idea how to solve this. Thanks    

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    07 Aug 2009 11:31 AM
    Try using IDL's BYTSCL to rescale the result in the parentheses to byte values.  For example: ENVI> x=lindgen(10) ENVI> print, x            0           1           2           3           4           5           6           7           8           9 ENVI> print, bytscl(1.017*x-4.180)    0  28  56  85 113 142 170 199 227 255 So you could use: bytscl(1.017*b1-4.180)
    You are not authorized to post a reply.