array convol optimizationv slow now [message #67287] |
Mon, 13 July 2009 15:40  |
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  |
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  |
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.
|
|
|