comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Gradient of two dimensional field
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Gradient of two dimensional field [message #8298 is a reply to message #8200] Wed, 19 February 1997 00:00 Go to previous messageGo to previous message
brian.jackel is currently offline  brian.jackel
Messages: 23
Registered: May 1996
Junior Member
In article <330B44DD.647C@cdc.noaa.gov> Andy Loughe <afl@cdc.noaa.gov> writes:
> Wilpert_Martin wrote:

>> we want to determine the electrical field from a given potential,
>> i.e. we have to calculate the gradient of a two dimensional array.
>>
>> Has anybody a idl-pvwave procedure to do this task?

> I would think that the shift function (used twice)
> could be used to do this.

Or even just

dx= a(1:*,*) - a
dy= a(*,1:*) - a

or

dx= a(1:n-1,*) - a(0:n-2,*)
dy= a(*,1:m-1) - a(*,0:m-2)

if "a" has dimensions of (n,m). When doing it the first way IDL takes
care of the different array sizes, with no perceptible performance hit.
The second way is perhaps a bit easier to read. Is this what you (the
original poster) were after?

Brian Jackel
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Printing array on one line
Next Topic: using GET_KBRD

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 01:18:24 PDT 2025

Total time taken to generate the page: 0.72308 seconds