Jump to content

Our forum made possible by displaying online advertisements to our visitors.

Please consider supporting us by disabling your ads blocker.

  • Announcements

    • EmperoR

      Dear Guests   12/24/2016

      Welcome to the GIS-AREA. like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be a part of GIS-AREA by signing in or creating an account here. Once you have created your account and have introduced yourself to our community, you can start new topics, reply to others, subscribe interesting threads, get your customize profiles, make news friends, and others nice stuff. To make your stay as pleasant and constructive as possible, please don't forget to read through our pinned forum rules and board guidelines in each section before you do anything else.
Sign in to follow this  
adel.naseri

How i can replace "-NaN" pixels with the desired value?

Recommended Posts

adel.naseri    0

HI

I have masked water in an image and now i want to replace all masked pixels with a desired values..

 

how i can do this in ENVI Preferably or other Softwares?

 
thanks in advance
Edited by adel.naseri

Share this post


Link to post
Share on other sites
bejokaryo    0

we can use envi classic with band math.

for example given band1 (b1), masked value = 0, replace value with 10. use band math (b1 eq 0)*10.

then add the image with the non masked (b1 ne 0)*b1.

adding both image will combine masked and non masked images. you can also directly add both using formula ((b1 eq 0)*10 + b1).

eq means equal.

ne means not equal. just check envi help

Share this post


Link to post
Share on other sites
mamadouba    10

If the masked values are actually NAN in ENVI, and not 0, you can use the following expression (example replaces NAN with 999 and all other values are preserved):

 

(999 * finite(b1,/nan))+(finite(b1)*(b1 > (-1e+34)))

Share this post


Link to post
Share on other sites
sigologo    8

If the masked values are actually NAN in ENVI, and not 0, you can use the following expression (example replaces NAN with 999 and all other values are preserved):

 

(999 * finite(b1,/nan))+(finite(b1)*(b1 > (-1e+34)))

Yes Sr on Band Math.....

(0 * finite(b1, /nan))+(finite(b1)*(b1 > (-1e+34))).....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.