problem with formula

Post any questions, ideas, or topics related to Jython and Python scripting.
User avatar
tomw
Posts: 296
Joined: Tue Dec 23, 2008 3:40 pm

Re: problem with formula

Post by tomw »

Here's what I did (in the Jython shell....), which produce a result (I had to change the scaling)...

Code: Select all

# Generated from Jython Shell history (2015-03-02 18:15:16Z)
iwp=selectData()
t11=selectData()
t67=selectData()
iwt=newUnit(iwp, "iwpt", "degK")
from visad.python.JPythonMethods import exp
b=mask(t11,'gt',233.0)
c=5.678+(.0006*iwt)-(.0369*t11)+(.252*(t67-t11))
d=1./(1.+exp(-c))
e=d*b
pan=buildWindow()
lay=pan[0].createLayer("Color-Shaded Plan View",e)
Attachments
kris2.png
User avatar
kbedka1
Posts: 428
Joined: Wed Jan 28, 2009 7:27 pm

Re: problem with formula

Post by kbedka1 »

Got it to work now, here's my formula:

def HIWC_PROB(iwp,T11,T67):
from visad.python.JPythonMethods import exp;
b=mask(T11,'lt',233,1);
c=(.0252*(T67-T11))-(.0369*T11)+5.678+(.0006*newUnit(iwp,"noiwp","degK"));
d=1/(1+exp(-c));
e=d*b;
return e;
Post Reply