Re: Questions regarding gsn_csm_pres_hgt_vector

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Mon, 3 Mar 2008 16:04:15 -0700

Hi Erwan,

I believe you need to set the resource 'vcMapDirection' to False. By
default, vector directions
are mapped into the X/Y space of the plot. This is appropriate for
vectors drawn on a map, but
is often not correct for vectors drawn in other coordinate spaces.
This is especially true for vertical
pressure plots because the units and coordinate values of the x and y
axes are very different.
Probably we should consider changing the default of vcMapDirection
for functions like gsn_csm_pres_hgt_vector.

I think the vector direction is not uniform on your third plot
because the Y axis is irregularly spaced.

Setting vcMapDirection False disassociates the vector u/v coordinate
system from the x/y coordinate space.
See http://www.ncl.ucar.edu/Document/Graphics/Resources/
vc.shtml#vcMapDirection.

  -dave

On Mar 3, 2008, at 3:39 PM, Erwan Monier wrote:

> Hi Everyone,
>
> I have a few questions regarding the gsn_csm_pres_hgt_vector function:
> I created a small script (see below) to plot 3 examples (see
> attached plot). The first vector plot has a constant vertical
> component and a null horizontal component, the second is the
> reverse and the third has constant horizontal and vertical
> components (both equal to 1). The first two plots show constant
> vector field as defined while the third plot shows vectors changing
> direction with height. I don't understand the resulting third plot.
> My vector field is constant but the vector's directions vary. Can
> yoanyone explain why? Did I miss something? Is it related to the
> non-linear pressure axis? If so how come the first two plots are ok?
>
> Thank you,
> Erwan Monier
>
> ***********************************************************
> vect = new((/9,9/),float)
> lat = (/0,1,2,3,4,5,6,7,8/)
> lat_at_units = "degree_north"
> lev = (/10,9,8,7,6,5,4,3,2/)
> lev_at_units = "hPa"
> vect!0="lev"
> vect!1="lat"
> vect&lat = lat
> vect&lev = lev
> vect_null = vect
> do i=0,8
> do j=0,8
> vect(i,j) = 1
> vect_null(i,j) = 0
> end do
> end do
>
> wks = gsn_open_wks ("ps", "vector-example" )
> plot = new(3,graphic)
>
> res = True
> res_at_gsnDraw = False
> res_at_gsnFrame = False
> res_at_vcMinDistanceF = 0.02
> res_at_vcRefLengthF = 0.04
> res_at_lbLabelBarOn = False
>
> plot(0) = gsn_csm_pres_hgt_vector(wks,vect,vect_null,vect,res )
> plot(1) = gsn_csm_pres_hgt_vector(wks,vect,vect,vect_null,res )
> plot(2) = gsn_csm_pres_hgt_vector(wks,vect,vect,vect,res )
>
> resP = True
> resP_at_gsnPanelRowSpec = True
> gsn_panel(wks,plot,(/2,1/),resP)
>
> <vector-example.pdf>_______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 03 2008 - 16:04:15 MST

This archive was generated by hypermail 2.2.0 : Wed Mar 05 2008 - 00:45:46 MST