[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IDV #PKQ-297414]: Laplacian formula "lap(S)" fails. An apparently equivalent version created locally doesn't.



> Full Name: Dave Dempsey
> Email Address: address@hidden
> Organization: San Francisco State University
> Package Version: 4.1 build date:2013-08-02 18:38 UTC
> Operating System: Mac OS X
> Hardware: Java: home: 
> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home version: 
> 1.6.0_51 j3d:1.5.2 fcs (build4)
> Description of problem: Creating display: Contour Plan View
> TypeError: div() takes exactly 1 argument (2 given)
> org.python.core.PyException
> 
> I'm calculating the Laplacian of 500 mb heights from the NAM model (just to 
> see if I can do it). To do this, I created a new formula, called "Laplacian 
> operator", and put it in the Grids group. It is defined simply as "lap(S)". 
> The formula "lap(S)" is defined in the Java formula library.
> 
> Applying the new formula to a NAM 500 mb height field and trying to plot 
> contours of it produced the error message above.
> 
> For reference: lap(S) is defined in the Jython library as 
> div(ur(grads),vr(grads)), where grads = grad(S) and S is a scalar field.
> 
> In turn, div is defined as add(ddx(ur(V), ddy(vr(V)), where V is a vector 
> field.
> 
> Then, I tried creating my own Laplacian operator formula. It bypasses the 
> "div" formula and calculates the Laplacian from
> a scalar field directly, although it appears to use the same formula as 
> lap(S) and
> 
> add(ddx(ur(grad(S))),ddy(vr(grad(S))))
> 
> Unlike lap(S), this works.
> 
> So, why would lap(S) fail where my algorithmically equivalent version 
> succeeds?

Dave,
    I think your equivalent version is corrected. The problem with the original 
lap(S) is that it should call div(grads) or add(.....).   I will fix it now.


Yuan
> 
> I've attached a bundle that creates a plot using the successful version of 
> the Laplacian operator (called "Laplacian operator" in the Grids group of 
> forumulas).
> 
> -- Dave
> 
> 
> 
> 
> 
> ******************
> Stack trace:
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File "<string>", line 208, in lap
> TypeError: div() takes exactly 1 argument (2 given)
> 
> 
> 


Ticket Details
===================
Ticket ID: PKQ-297414
Department: Support IDV
Priority: Normal
Status: Open


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.