2

I am trying to do conditional statement in ENVI to calculate multiband image:

result = (b1)^2 - (b2)^2
if (b1 eq 0) or (b2 eq 0)
result * 0
else
result * (result gt 0.0)

Is there a way to combine the statements in Band Math? Or I have to write in IDL?

2

A bit late, but this expression would work using ENVI Band Math:

(b1^2 - b2^2) * ((b1 NE 0) AND (b2 NE 0))

HTH.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.