Hello Craig, thank you for your advice using WHERE!
I fortunately got rid of the zeros at Vx, Vy and Vz. However, I want
to get the respective coordinates at which the velocity components are
not zeros (Sx,Sy and Sz).
How can I do this?
thanks
Adhara
openr,q,'VOa.dat',/Get_Lun ;open files for reading
A=fltarr(6,90*360L) ;create arrays to hold data in files
readf,q,A ;read files into arrays
Free_Lun,q ;close files and clear logical unit assigned to each
file
Vx=fltarr(360,360,90) ;create 3 dimensional arrays to hold vector
data.
Vy=fltarr(360,360,90) ;the indices will be Vx(x,y,z)
Vz=fltarr(360,360,90)
factor = 0
For i = 0, 32399L Do Begin ;change here the number of records
ifneeded.
Vx(A(2,i)-1,A(1,i)-1,A(0,i)-1) = A(3,i)*10.0^factor
Vy(A(2,i)-1,A(1,i)-1,A(0,i)-1) = A(4,i)*10.0^factor
Vz(A(2,i)-1,A(1,i)-1,A(0,i)-1) = A(5,i)*10.0^factor
Endfor
Vxx=WHERE(Vx NE 0,count1)
Vyy=WHERE(Vy NE 0,count2)
Vzz=WHERE(Vz NE 0,count3)
sx=A[2,*]
sy=A[1,*]
sz=A[0,*]
;here is my question...how to define these arguments!!!!!
Sxx=where(Vxx NE 0)
Syy=where(Vyy)
Szz=where(Vzz)
end
Craig Markwardt <craigmnet@REMOVEcow.physics.wisc.edu> wrote in message news:<onbrkrrj28.fsf@cow.physics.wisc.edu>...
> adharac@hotmail.com (Adhara) writes:
>
>
>> Dear all,
>> I have a very large set of data in an array of 6 columns and 32400
>> rows. The columns are the coordinates x,y,z and the velocity
>> components Vx,Vy,Vz. There is a large number of these points that are
>> zero for vx, vy, vz. However, I my macro is plotting these points.
>> How can I avoid this?
>
>
> You probably want to use WHERE to select the non-zero points.
>
> Craig
|