On Nov 6, 12:55 am, Tyler <hayes.ty...@gmail.com> wrote:
> Hello All:
>
> I am attempting to plot some GPS station velocity vectors over some
> existing data on a map. I found the MSVELOVECT procedure which seems
> to do what I want. However, I am struggling to understand how to use
> it. In particular, how to set up the velocity vectors, U & V.
>
> The data I have is:
>
> 1) GPS station LON/LAT values
> 2) East magnitude of velocity
> 3) North magnitude of velocity
>
> The program requires the velocity data be in 2-D, but I am unsure what
> the first dimension value is or the second dimension. Does anyone know
> how to use this?
>
> I have provided below a snippet of how I tried to set up the data by
> fooling it with a data vector for U & V, but it was smarter than me.
>
> Or am I using the wrong program altogether?
>
> Any help is greatly appreciated.
>
> Cheers,
>
> t.
>
> IF (zc EQ 0) THEN BEGIN
> U = FLTARR(long(NV), 1, /NO)
> V = FLTARR(long(NV), 1, /NO)
> X = FLTARR(long(NV), /NO)
> Y = FLTARR(long(NV), /NO)
>
> ;; Northern Section
> ;; East Velocity
> U(0,0) = -2.44
> U(1,0) = -1.82
>
> ;; North velocity
> V(0,0) = 2.66
> V(1,0) = 2.11
>
> ;; GPS Station Lon
> X(0) = -123.8352
> X(1) = -123.0747
>
> ;; GPS Station Lat
> Y(0) = 39.7769
> Y(1) = 38.9952
> ;; Overplot the GPS data
> MSVELOVECT, U, V, X, Y, COLOR = !P.COLOR, /OVERPLOT
> ENDIF
Firstly, IDL will always 'hide' trailing dimensions of size 1, so
> U = FLTARR(long(NV), 1, /NO)
won't work, you'll have to come up with something slyer to fool it.
Have a look at J. D. Smith's dimension juggling tutorial on David
Fanning's website:
http://www.dfanning.com/tips/rebin_magic.html
Next, I don't think you'll get away without true two-dimensional U & V
arrays anyway.
The way this programme seems to work is this:
***
MapXSize = 200
MapYSize = 100
; Four imaginary station locations and their
; respective velocity recordings:
; Location 1: (2, 10), Velocity: ( 3i + 4j)
; Location 2: (180, 6), Velocity: (-12i + 5j)
; Location 3: (10, 88), Velocity: ( 8i - 6j)
; Location 4: (190, 90), Velocity: (-10i - 24j)
x_locations = [2, 180, 10, 190]
y_locations = [10, 6, 88, 90]
East_Vectors = [3, -12, 8, -10]
North_Vectors = [4, 5, -6, -24]
; Locations of East_Vectors in grid:
U = FLTARR (MapXSize, MapYSize)
U [x_locations, y_locations] = East_Vectors
; Location of North_Vectors in grid:
V = FLTARR (MapXSize, MapYSize)
V [x_locations, y_locations] = North_Vectors
; Set length to long enough to make arrows visible in plot window
VELOVECT, U, V, TITLE = 'VELOVECT', LENGTH = 30
WINDOW, /FREE
MSVELOVECT, U, V, TITLE = 'MSVELOVECT', LENGTH = 30
***
Note that I'm using the version of MSVELOVECT from here:
http://cow.physics.wisc.edu/~craigm/idl/archive/msg01196.htm l
and it crashes with an out-of-subscript error in one of its FOR loops.
If you have a more recent version, it might work better; VELOVECT
seems to work just fine for me though.
> Or am I using the wrong program altogether?
You'll have to decide that one for yourself ;-)
One problem you'll have is that if you have 7 significant digits in
your LAT & LON, you'll need HUGE, sparse arrays, unless you can fudge
it a bit. Also, even by setting MISSING = Something and DOTS = 0, I
haven't spotted a way to prevent your map being overlayed with a mess
of speckles. I'm sure it can be done though.
Hope this gets you under way at least,
Chris
|