X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08 Dec 2010 09:22 AM by  anon
Band math expression
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
08 Dec 2010 09:22 AM
    Hi Forum: I am having a problem with a function. this is expression to calculate TDVI (transformed difference vegetaion index) and the value should be between -1 and 1 but I am getting all values >0 and beyond 1. the below is my band math equation. FUNCTION td1,b1,b2 tdvi = 1.5* ((float(b1)-float(b2))/(float(b1*b1)+b2+0.5)^0.5) RETURN,tdvi END To understand better the situation here is the equation in excel, this works well though. =1.5*(B3-A3)/SQRT(B3*B3+A3+0.5) Please suggest, how to fix the equation? Thanks in advance

    Deleted User



    New Member


    Posts:
    New Member


    --
    09 Dec 2010 01:21 AM
    Maybe try (1.5*(float(b1)-float(b2)))/((float(b1*b1)+float(b2)+0.5)^0.5)
    You are not authorized to post a reply.