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

Home » Public Forums » archive » Gradient idl
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 idl [message #90559 is a reply to message #90558] Tue, 10 March 2015 09:13 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Tuesday, March 10, 2015 at 11:00:30 AM UTC-5, siumt...@gmail.com wrote:
> On Tuesday, March 10, 2015 at 1:12:31 AM UTC-4, siumt...@gmail.com wrote:
>> Hello all,
>>
>> How can calculate gradient a 2-Dimensional scalar field with missing data.
>>
>>
>>
>> Best regards
>
> do you mean to calculate gradient of a scalar function (2ddata) can be solved this way
>
> kernel = [ [-1,0,1],[-1,0,1]]
> result = CONVOL(2Ddata, kernel,/NAN)

No, you'll need two separate convolutions, one for the x-component of the gradient and one for the y-component:

result_x = CONVOL(Data, [-1,0,1], /NAN)
result_y = CONVOL(Data, TRANSPOSE([-1,0,1]), /NAN)

See the CONVOL help page for details about edge options, etc.

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to prevent NaNs
Next Topic: Google Earth Curtain Plot

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

Current Time: Wed Oct 08 19:34:02 PDT 2025

Total time taken to generate the page: 0.00703 seconds