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

Home » Public Forums » archive » Displaying 3-D vector fields
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: Displaying 3-D vector fields [message #32824 is a reply to message #32726] Thu, 14 November 2002 11:52 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
> Okay I get it now Thank God ! I seem to be running into a memory
> problem in trying to display 18K vectors at a time though ? I don't
> get any indication of this, but it bombs after some number less than
> that number of vectors


18K... That's a lot, but hopefully not too many. You do realize that you
will not be viewing these in real time. What are your system spex?

I used the test program below to generate an array of 20K vector objects.
The array of objects and *one sample* of location and magnitude data
required about 31MB. Displaying this dataset using XOBJVIEW required about
50MB. IDLDE required around 70MB total as reported by windows task manager.

So it seems like you should be able to do this on a relatively new PC given
you manage your data. You probably can't just read in all of your data at
once. I would read in a single sample (or time step or whatever you want to
call it) at a time, plot it, then read in the next and plot, and so on.
Something like:

nvectors=18000
nsamples=1000

; create our data arrays
magnitudes=FLTARR(3,nvectors)
locations=FLTARR(3,nvectors)

; create the vector objects
vectors = OBJARR(nvectors)
for n=0, nvectors-1 do vectors[n] = OBJ_NEW('vector', color=[255,0,0])

for n=0, nsamples-1 do begin

; read in this samples data
readf, 1, magnitudes
readf, 2, locations

; update the vectors
for n=0, nvectors-1 do vectors[n] -> SetProperty, $
MAGNITUDE=magnitudes[*,n], LOCATION=locations[*,n]

; draw the scene
oWindow -> Draw, oView

; Grab the image in the window and write to file

endfor

; clean up
obj_destroy, vectors


This is just a start. I have left a lot of detail out and the readf
statements are wrong I'm sure but the general form is there.

This does bring up the question as to how you are going to 'view' this
visualization. with 18k vectors you are not going to be able to view the
entire scene and make anything out I don't think. And since you will not be
able to view this in real time you won't be able to "fly around" in the
vector field (on my well endowed PC it took maybe 1.5 minutes for XOBJVIEW
to draw the 20k vector scene).

If you want to try to view the entire scene then you can't just rely on the
length of the vector to present your information. One thought would be to
modify the vector object so that it's color is representative of it's
magnitude. Another option would be to script camera movement and do a fly
thru/around of the vector field.

But I suppose we should concentrate on getting something on the screen
first. :)

-Rick



start_mem=MEMORY(/current)

locations=FLTARR(3,20000)
magnitudes=RANDOMU(SYSTIME(/seconds),3,20000)

; create a regular grid of vectors 200x100 in the xz plane
for n=0, 199 do locations[0,n*100:(n*100)+99]=FINDGEN(100)
for n=0, 199 do locations[2,n*100:(n*100)+99]=n

vectors = objarr(20000)

for n=0, 19999 do vectors[n] = OBJ_NEW('vector', LOCATION=locations[*,n], $
MAGNITUDE=magnitudes(*,n), COLOR=[0,0,220])

;print,'Mem in MB:',(MEMORY(/highwater) - start_mem) / 1024. / 1024.

xobjview, vectors, /block

print,'Mem in MB:',(MEMORY(/highwater) - start_mem) / 1024. / 1024.

obj_destroy, vectors

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: use of 'obj_new' within another object definition
Next Topic: IdlGrPolygon - Intersection with planes and lines

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

Current Time: Thu Oct 09 21:16:14 PDT 2025

Total time taken to generate the page: 0.31407 seconds