[Thread Prev][Thread Next][Index]
Re: poly-vector in hammer projection
Hi everyone,
Boyin Huang worked out a way to run his script which calls the mp_hammer
projection
and overlays vectors using the mp_poly_vectors.jnl script. The working
script is
below, e0.jnl He askes a couple of good questions which I'll try to
answer.
> The attached script e0.jnl works fine though I still
> can not understand fully why:
>
> (1) What should we use? "set grid uwnd" or "go mp_grid
> uwnd". What's the difference?
>
> The later does not work in this mp_poly_vector
> call, but fine in "vector u, v, x_page, y_page".
The scripts mp_poly_vectors.jnl, and also mp_graticule.jnl, reset some
of the
variables that were defined by the earlier call to mp_hammer. For example,
mp_poly_vectors.jnl cancels mp_x and mp_y and then redefines those
variables.
If you look at mp_grid.jnl, (yes? go/help mp_grid.jnl) it sets the
variables mp_x
and mp_y. When these are reset by mp_poly_vectors, they are no longer
useable
by mp_graticule or other scripts.
So, when running mp_poly_vector.jnl or mp_graticule.jnl we can either
use SET GRID,
or re-run the set-up steps mp_hammer, and mp_grid after the call to
mp_poly_vectors.
> (2) Why do I have to use "go mp_hammer 156 41" in
> poly_vector, but fine to use "go mp_hammer" in
> "vector u, v, x_page, y_page"
This is due to the same thing. If you call mp_hammer without the arguments,
then mp_central_meridian and mp_standard_parallel are set automatically
by mp_hammer.jnl, and they depend on mp_x and mp_y.
yes? USE coads_climatology
yes? SET REGION/X=131:181/Y=21:61/L=5
yes? go mp_hammer
yes? show var
Created by DEFINE VARIABLE:
>>> Definitions that replace any file variable of same name:
MP_X = X
MP_CENTRAL_MERIDIAN = (MP_X[I=@MAX] + MP_X[I=@MIN])/2
MP_Y = Y
MP_STANDARD_PARALLEL = (MP_Y[J=@MAX] + MP_Y[J=@MIN])/2
Then when you run mp_poly_vectors.jnl, mp_x and mp_y are changed and then
the meridian and parallel variables will have different values. If you
call mp_hammer
with specific scalar values then they do not depend on mp_x and mp_y.
Thank you for reporting all of this, and for creating an example using
the coads_climatology
data. I'll see what we can do to improve the documentation so it's
easier to understand the
interactions between these complex scripts!
Ansley
--------------------------------------------
!e0.jnl
SE coads_climatology
SET REGION/X=131:181/Y=21:61/L=5
go mp_hammer 156 41
SET GRID uwnd
!GO mp_grid uwnd
GO mp_aspect
FILL/NOAXIS/NOKEY/PAL=inverse_grayscale/TITLE="Winds Colored by Pressure" slp, x_page,y_page
GO mp_fland 20 black
LET x_vec = X[GX=uwnd,X=131:181] + 0*Y[GY=uwnd,Y=21:61]
LET y_vec = 0*X[GX=uwnd,X=131:181] + Y[GY=uwnd,Y=21:61]
LET u_vec = uwnd[X=131:181,Y=21:61,L=5]
LET v_vec = vwnd[X=131:181,Y=21:61,L=5]
GO mp_poly_vectors x_vec y_vec u_vec v_vec 3 "arrow"
stat mp_x_arrow
stat mp_y_arrow
list mp_x_arrow
list mp_y_arrow
LET press = YSEQUENCE(slp[X=131:181,Y=21:61,L=5])
POLYGON/OVER/NOAX/NOLAB/KEY/LINE/PAL=rainbow mp_x_arrow, mp_y_arrow, press
GO mp_graticule 131 181 12.5 21 61 10 1
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement