problem defining vectors [message #39470] |
Mon, 24 May 2004 14:09  |
heoa
Messages: 9 Registered: May 2004
|
Junior Member |
|
|
Dear experts,
I have a file with 6 columns and 5,000 records.
Each of these records contain spatial coordinates (x,y,z) and vector
components (vx,vy,vz). The coordinates are from a Cubic space,
however, not all the points inside this cube are in the array. How
can I build the arrays so that they can have the same size? I thought
about inserting zeros in between.
Cube space
x=50
y=50
z=50
the program that I wrote looks like this: I think the second line is
not good!
thank you and best regards,
elias
file=DIALOG_PICKFILE(FILTER=['*.dat'])
array=fltarr(6,50*50L*50L)
Openr,1,file
readF,1,array
x=array[2,*]
y=array[1,*]
z=array[0,*]
u=array[3,*]
v=array[4,*]
w=array[5,*]
close,1
end
|
|
|
Re: problem defining vectors [message #39524 is a reply to message #39470] |
Tue, 25 May 2004 15:43  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
elias writes:
> Thank you for all your advice, I have one more question:
>
> I want to combine xplot3D with flow3....IDL won't let me as I am doing
> it.... How can I fix that?
>
> xplot3D,flow3, /OVERPLOT
Oh, my goodness. You are trying to go from the
frying pan into the fire!
This particular transformation can't be done. They
are in two completely different graphics systems. They
do not overlap in any way, shape, or form.
If you like XPLOT3D and want to go in the direction
of object graphics, then you should consider the
SREAMLINE procedure. But I really don't think this
newsgroup has the bandwidth to help much in this
direction. :-(
I'd recommend getting ahold of Ronn Kling's book,
Power Graphics, if you want to learn more about
object graphics. I think you might find the normal
IDL documentation quite daunting.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: problem defining vectors [message #39527 is a reply to message #39470] |
Tue, 25 May 2004 15:30  |
heoa
Messages: 9 Registered: May 2004
|
Junior Member |
|
|
Thank you for all your advice, I have one more question:
I want to combine xplot3D with flow3....IDL won't let me as I am doing
it.... How can I fix that?
xplot3D,flow3, /OVERPLOT
Thnaks,
Elias
|
|
|
Re: problem defining vectors [message #39560 is a reply to message #39470] |
Tue, 25 May 2004 00:09  |
Chris Lee
Messages: 101 Registered: August 2003
|
Senior Member |
|
|
In article <e920fce6.0405241309.637e4067@posting.google.com>, "elias"
<heoa@hotmail.com> wrote:
> Dear experts,
> I have a file with 6 columns and 5,000 records. Each of these records
> contain spatial coordinates (x,y,z) and vector components (vx,vy,vz).
> The coordinates are from a Cubic space, however, not all the points
> inside this cube are in the array. How can I build the arrays so that
> they can have the same size? I thought about inserting zeros in between.
> Cube space
> x=50
> y=50
> z=50
> the program that I wrote looks like this: I think the second line is
> not good!
> thank you and best regards,
> elias
> file=DIALOG_PICKFILE(FILTER=['*.dat'])
> array=fltarr(6,50*50L*50L)
> Openr,1,file
> readF,1,array
> x=array[2,*]
> y=array[1,*]
> z=array[0,*]
> u=array[3,*]
> v=array[4,*]
> w=array[5,*]
> close,1
> end
Aha, reading the newsgroup backward is...interesting.
The second line is not good because your reading in 50*50*50 groups of 6
values, which is 125000, not 5000.
What you probably want is
file=DIALOG_PICKFILE(FILTER=['*.dat'])
array=fltarr(6,5000L)
Openr,1,file
readF,1,array
x=array[2,*]
y=array[1,*]
z=array[0,*]
u=array[3,*]
v=array[4,*]
w=array[5,*]
close,1
amp=sqrt(u^2+v^2+w^2)
amp=reform(amp) ;for luck :)
x=reform(x)
y=reform(y)
z=reform(z)
data_3d=grid3(x,y,z,amp,ngrid=50)
end
now you have a 3d data set. Check the keywords for GRID3 for anything you
need, NGRID=50 makes the 3d dataset 50x50x50, as requested, you might
also want START=[x0,y0,z0] and DELTA=[dx,dy,dz] to determine the ranges
in x,y and z (range is delta*ngrid+start I guess)
Chris.
|
|
|