Re: Vector representation of data. [message #83672] |
Fri, 29 March 2013 14:18  |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Wednesday, March 27, 2013 8:04:24 AM UTC-6, dave poreh wrote:
> Folks
>
> Hi,
>
> I have data like x,y, z and z shows my intensity data (x and y are like coordinates). My data has low value in one corner and i was thinking maybe I could show the data like vectors; length of vector should show ||z|| and direction toward the lowest point in my 2D data (x-y). Can someone give me an idea about how could I do that please?
>
> Cheers,
>
> Dave
Hi Dave,
You should be able to use the VECTOR function to create the actual vector plot. You just need to compute the "U" and "V" components of the vectors, along with the X and Y locations. Then it is just:
v = VECTOR(U, V, X, Y)
The trick will be computing your angles, perhaps by computing some sort of "gradient" along your data? If you could get ||Z|| and angle Theta on a 2D grid, then you could just use:
U = ||Z|| cos(Theta)
V = ||Z|| sin(Theta).
Hope this helps a bit.
Cheers,
Chris
ExelisVIS
|
|
|
Re: Vector representation of data. [message #83809 is a reply to message #83672] |
Fri, 29 March 2013 16:38   |
Phillip Bitzer
Messages: 223 Registered: June 2006
|
Senior Member |
|
|
Building off Chris's advice...
Assuming (y0,x0) is the "low point", then something like
ang = ATAN(y-y0, x-x0)
partvelvec, z*COS(ang), z*SIN(ang), x, y
should do the trick. This uses partvelvec from the astro library, http://idlastro.gsfc.nasa.gov/ftp/pro/plot/partvelvec.pro
You'll have to be careful with which way the vector points, if that's important.
|
|
|
Re: Vector representation of data. [message #83852 is a reply to message #83809] |
Thu, 04 April 2013 00:27  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Friday, March 29, 2013 3:38:01 PM UTC-8, Phillip Bitzer wrote:
> Building off Chris's advice...
>
>
>
> Assuming (y0,x0) is the "low point", then something like
>
>
>
> ang = ATAN(y-y0, x-x0)
>
> partvelvec, z*COS(ang), z*SIN(ang), x, y
>
>
>
> should do the trick. This uses partvelvec from the astro library, http://idlastro.gsfc.nasa.gov/ftp/pro/plot/partvelvec.pro
>
>
>
> You'll have to be careful with which way the vector points, if that's important.
Thanks guys, I am using partvelvec now and looks like it is working:)
Cheers,
Dave
|
|
|