About... Prerequisites Examples Home Bugs Download Manual Links

Example 7

    from Numeric import arange, pi, exp, NewAxis
    from pyclimate.diffoperators import HGRADIENT
    
    x = arange(  0., 360., 2.5) * pi/180.
    y = arange(-90.,  90., 2.5) * pi/180.
    
    # Get the gradient of z(x,y)=x*exp[-(x^2+y^2)] 
    x2, y2 = x*x, y*y
    z = x * exp(-x2[NewAxis,:]-y2[:,NewAxis])
    hgrad=HGRADIENT(y, x, asdegrees=0, PBlon=0)
    gx, gy = hgrad.hgradient(z)
    



Contact the
Webmaster