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

Home » Public Forums » archive » Re: locate particles on a grid
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: locate particles on a grid [message #80158] Mon, 14 May 2012 16:30 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Monday, May 14, 2012 4:35:29 PM UTC-4, aman wrote:
> I wrote a code in IDL to locate 10,000 particles over a grid of
> size : 512 x 512 using Kernel statistics, in particular Gaussian. This
> program has 3 FOR loops with an exponential calculation. It is really
> taking a long time to get me an output. Two days have already been
> over and this code is still running. I am not sure if IDL is good for
> this array size and 512x512 iterations.
>
> My question is whether it is IDL problem or my code problem. I
> discussed it with other students and they suggested me to do this work
> in FORTRAN. But I am still not very sure about this, as many
> astronomers use IDL for their research.

Next time, put some PRINT statements so that you have some progress information.

I imagine you are looping over X and Y. Don't do that. Precompute X and Y as 2D arrays, and only loop over the 10000 count. IDL just as happily evaluates EXP(-X^2-Y^2) where X and Y are 2D arrays as when X and Y are scalars.

This goes with the philosophy of doing a lot of operations per FOR loop iteration.

Craig
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: time-series monthly averages rainfall
Next Topic: unable to allocate memory

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

Current Time: Wed Oct 08 15:38:06 PDT 2025

Total time taken to generate the page: 0.00469 seconds