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

Home » Public Forums » archive » array convol optimizationv slow now
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
array convol optimizationv slow now [message #67287] Mon, 13 July 2009 15:40 Go to next message
newerjazz is currently offline  newerjazz
Messages: 5
Registered: July 2009
Junior Member
Hi All,

I have an array of [2,100,000,000] corresponding to x, y and
100,000,000 particles. I need to render these particles as gasussian
spots at x, y locations

Currently, I run a for loop through each particle and render each
particle in this for loop; it takes forever.

I am thinking to create an array of zeroes. at each location where
there's particles, I increment the value by 1. Then use convol to draw
gaussian spot.

Any suggestion to implement this!

Thanks a lot!

newerjazz
Re: array [message #67325 is a reply to message #67287] Thu, 16 July 2009 12:20 Go to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
On Jul 16, 6:27 am, woods <coupecl...@yahoo.de> wrote:
> i want to create an arry with the same dimensions as my georeferenced
> image. my georeferenced image ist 5600x6500.
> can somebody hel me?
>
> thank you in advance

to make that array (of floats), use
array = fltarr(5600, 6500)

In general, use
size = size(ref_array)
array = fltarr(sz[1], sz[2])

see also dblarr, intarr, etc by typing
?dblarr
at the IDL prompt
chris
Re: array convol optimizationv slow now [message #67364 is a reply to message #67287] Tue, 14 July 2009 14:15 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Jul 13, 6:40 pm, newerjazz <shang...@gmail.com> wrote:
> Hi All,
>
> I have an array of [2,100,000,000] corresponding to x, y and
> 100,000,000 particles. I need to render these particles as gasussian
> spots at x, y locations
>
> Currently, I run a for loop through each particle and render each
> particle in this for loop; it takes forever.
>
> I am thinking to create an array of zeroes. at each location where
> there's particles, I increment the value by 1. Then use convol to draw
> gaussian spot.
>
> Any suggestion to implement this!
>
> Thanks a lot!
>
> newerjazz

You might want to try POINT_CONVOLVE:

http://web.astroconst.org/jbiu/jbiu-doc/math/point_convolve. html

Check out the various keywords... depending on your resolution, number
of dimensions, and number of points, different combinations will give
you the best optimization.

-Jeremy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: SIZE() vs. N_ELEMENTS()
Next Topic: uniq slow for loop

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

Current Time: Sat Oct 11 05:36:46 PDT 2025

Total time taken to generate the page: 1.11950 seconds