Jump to content

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


adel.naseri

Recommended Posts

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

Link to comment
Share on other sites

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))).....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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

Disable-Adblock.png

 

If you enjoy our contents, support us by Disable ads Blocker or add GIS-area to your ads blocker whitelist