[Thread Prev][Thread Next][Index]

Re: [ferret_users] Missing vector arrows



I have revised Ned Cokelet's poly_vector script that some people might like better (attached file polyvectors_scaled_arrows_5.jnl). A major difference is that the original script leaves the arrowheads the same length and just reduces the length of the vector tail for small magnitudes, which can result in hard-to-read triangular "vectors"; my revision scales the AREA of the entire vector, keeping the shape the same. The operation of the script is identical.

Another version (polyvectors_scaled_arrows_5.jnl) operates similarly except that it makes the vector tails just a line. This is something like the scattered_vectors script except, um, except, (not sure what the functional difference is, but it has the same operation as polyvectors_scaled_arrows_5.jnl, so you can switch between them on the fly).

Either version can be color-filled by some other quantity on the same grid or "transparent" on top of the background field.

For example of the output of these scripts, see:

version 5 for thick vectors:
http://www.pmel.noaa.gov/people/kessler/noumea/ORCA/orca-transport- harm-varellipse-plotvec-5c5-2060-fig-aaa.gif
http://www.pmel.noaa.gov/people/kessler/noumea/gliders/ mw9304_adcp_vectors1.gif

version 6 for line vectors:
http://www.pmel.noaa.gov/people/kessler/noumea/gliders/ mw9304_adcp_vectors1b.gif

If anyone improves these scripts or finds errors please post it to the list or let me know what you did.

Billy K

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
William S. Kessler
NOAA / Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115 USA

william.s.kessler@noaa.gov
Tel: 206-526-6221
Fax: 206-526-6744
Home page: http://www.pmel.noaa.gov/people/kessler/


Attachment: poly_vectors_scaled_arrows_5.jnl
Description: Binary data


Attachment: poly_vectors_scaled_arrows_6.jnl
Description: Binary data

On Nov 15, 2006, at 10:05 AM, Ansley Manke wrote:

Hi Jerome,
It looks like the algorithm for drawing the arrow part of the vectors breaks down, making the arrow lie along the vector "shaft" for some vectors. Why it seems to happen for some of the vectors in your plots is not clear. We'll have to take another look at that.

One workaround for you might be the polygon vector scripts, which are available for both rectilinear and curvilinear data. If you like the look of these, they use an entirely different method of drawing, and should not have the trouble you're seeing. They also have the advantage of the option to color the vectors according to some variable field if one wishes. Try running the script
yes? go poly_vector_demo
and see if you like the look. The demo uses a map projection to create curvilinear data, but you can use the poly_vectors.jnl script directly to plot curvilinear data; the script wants inputs containing the x and y coordinates of the vector tails in 2 dimensions which is exactly what we have in a curvilinear data set.
! say we have data with uwnd, vwnd, and curvilinear
! coordinate variables lon_array and lat_array

yes? use curvilinear_dat.nc

! make a vector plot as the "underlay" for the polygon command
! This sets up the plot scaling
yes? vector/nokey uwnd, vwnd, lon_array, lat_array

yes? go poly_vectors.jnl lon_array lat_array uwnd vwnd 5 "arrow"

! These lines are written by the poly_vectors.jnl script:
*** POLY_VECTORS: Issue commands such as follow to plot the vectors ***
*** POLYGON/OVER/NOLABEL/KEY/NOAXES/LINE PLT_X_ARROW, PLT_Y_ARROW, MY_VALUES[J=1:27118] ***
*** SET REGION SAVE ***

! Create a constant variable to color the plots with a single color
yes? let my_values = 1 + 0*ysequence(uwnd)

yes? poly/pal=blue/over/nolab/key/noax/line PLT_X_ARROW, PLT_Y_ARROW, my_values
Note that the polygon vector plots don't automatically skip some vectors for plot readability; the polygon script discusses sub- sampling if needed.



Jerome Fiechter wrote:
Hello Ferreters,

I just ran into a problem plotting vectors on a curvilinear grid where some, but not all, arrows at the end of the vectors are missing. Has anybody seen this before or knows how to fix it? Any help would be appreciated.

Thank you,

Jerome



<mime-attachment.gif>
-- ~> ~> ~> ~> ~> ~> ~> ~> ~> ~> ~> Ansley Manke, NOAA/PMEL ansley.b.manke@noaa.gov 7600 Sand Point Way NE, Seattle WA Phone 206-526-6246, FAX 206-526-6744


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement