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

Home » Public Forums » archive » 3D velocity vectors
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
3D velocity vectors [message #39038] Mon, 12 April 2004 12:53
adharac is currently offline  adharac
Messages: 23
Registered: April 2004
Junior Member
I have a serious problem.
I am plotting velocity vectors in 3D. The values that I have are very
small in comparison to the scaling system. The output that I am
getting from the code I wrote, does not show the vectors! Only small
dots....I thought it was because of the values that I have. So, I
decided to use a factor, but I cannot increase it too much because it
will not run. Finally, I decided to multiply every value in Fortran,
and then bring my data into IDL. It does not work either!!
Do you think my problem is that my xr, xy, xz is very large compared
to the values of vx, vy, vz? But, vx, vy, vz are velocity components
and the ranges correspond to location of those vectors in 3D. My goal
is mainly to show the flow paths with this vectors. How do you think
I can fix my macro?


Thank you in advance,
Adhara

openr,q,'vel3.out',/Get_Lun ;open files for reading
openr,r,'vel2.out',/Get_Lun
openr,s,'vel3.out',/Get_Lun

;header=' '
;for i = 1, 5 do readf,q,header ;read header stuff in file VOa.dat

A=fltarr(6,90*360L) ;create arrays to hold data in files
B=fltarr(6,90*360L) ; 'L' indicates use of a long integer
C=fltarr(6,90*360L)

readf,q,A ;read files into arrays
readf,r,B
readf,s,C

Free_Lun,q ;close files and clear logical unit assigned to each
file
Free_Lun,r
Free_Lun,s

Vx=fltarr(90,360,360) ;create 3 dimensional arrays to hold vector
data.
Vy=fltarr(90,360,360) ;the indices will be Vx(x,y,z)
Vz=fltarr(90,360,360)

factor = 7

For i = 0, 32399L Do Begin ;change here the number of records if
needed.

;use a -1 to adjust the values from the files to fit IDL array
subscripts
;use a factor to scale the vector value to something more visible on
the plot

Vx(A(0,i)-1,A(1,i)-1,A(2,i)-1) = A(3,i)*10.0^factor
Vx(B(0,i)-1,B(1,i)-1,B(2,i)-1) = B(3,i)*10.0^factor
Vx(C(0,i)-1,C(1,i)-1,C(2,i)-1) = C(3,i)*10.0^factor

Vy(A(0,i)-1,A(1,i)-1,A(2,i)-1) = A(4,i)*10.0^factor
Vy(B(0,i)-1,B(1,i)-1,B(2,i)-1) = B(4,i)*10.0^factor
Vy(C(0,i)-1,C(1,i)-1,C(2,i)-1) = C(4,i)*10.0^factor

Vz(A(0,i)-1,A(1,i)-1,A(2,i)-1) = A(5,i)*10.0^factor
Vz(B(0,i)-1,B(1,i)-1,B(2,i)-1) = B(5,i)*10.0^factor
Vz(C(0,i)-1,C(1,i)-1,C(2,i)-1) = C(5,i)*10.0^factor

Endfor

vol = FLTARR(360, 360, 90)
WINDOW, XSIZE = 390, YSIZE = 400

CREATE_VIEW, XMAX = 360, YMAX = 360, ZMAX = 100


Scale3, xr=[0,89], yr=[0,359], zr = [0,359] ;create 3D scaling
system

Flow3, Vx, Vy, Vz


End
[Message index]
 
Read Message
Previous Topic: satellite orbit computation in IDL
Next Topic: Re: resizing image

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

Current Time: Thu Oct 09 21:53:44 PDT 2025

Total time taken to generate the page: 0.64117 seconds