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

Home » Public Forums » archive » vector magnitude
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
vector magnitude [message #39463] Mon, 24 May 2004 20:38 Go to next message
heoa is currently offline  heoa
Messages: 9
Registered: May 2004
Junior Member
Hi!
I would like to use GRID3 in my program. For that, I have to use an
array "F" that includes the values associated with a location in the
space. I don't have this F array yet. I have to calculate it, as the
square root of the summation of the velocity components to the square
power each.

- Can IDL do this calculations or should I do them in a different
software and bring them ready into IDL?

Thank you!
Elias
Re: vector magnitude [message #39561 is a reply to message #39463] Mon, 24 May 2004 23:55 Go to previous message
Chris Lee is currently offline  Chris Lee
Messages: 101
Registered: August 2003
Senior Member
In article <e920fce6.0405241938.6e4dd6d6@posting.google.com>, "elias"
<heoa@hotmail.com> wrote:


> Hi!
> I would like to use GRID3 in my program. For that, I have to use an
> array "F" that includes the values associated with a location in the
> space. I don't have this F array yet. I have to calculate it, as the
> square root of the summation of the velocity components to the square
> power each.
> - Can IDL do this calculations or should I do them in a different
> software and bring them ready into IDL? Thank you!
> Elias

Hi,

If you want to calculate the square of a variable

square=variable^2

will do it, for your velocity amplitude (which is what you are
calculating...)

amp=sqrt(u^2+v^2+w^2)

should 'work'. u,v,w are the velocity vectors, they should be the same
size and shape (for your sanity, if nothing else).

How you get the velocity data into your program is up to you, at some
point you'll need to READF it in, unless it's in a format supported by
IDL (NetCDF, CDF,HDF,HDF5 etc...) then you should use the library
functions to read the data.

Then it's

data_3d=grid3(x,y,z,amp)

and your 3d dataset is made

Chris.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL and C-
Next Topic: IDL reader for matlab .mat files

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

Current Time: Sat Oct 11 21:17:47 PDT 2025

Total time taken to generate the page: 0.23825 seconds