Re: how to create a pressure-height-vector plot?

From: Madeleine Patterson <madeleine.patterson77_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 16 2011 - 12:56:34 MST

Hi Mary,

This seems to have done the trick:

omegaAve = avg(omega_avgd(:,:,:)) ; used for scaling
uAve = avg(u_avgd(:,:,:))
scale = fabs(uAve/omegaAve)
omegascale = omega_avgd*scale ; now scale
copy_VarCoords(omega_avgd, omegascale) ; copy coordinate
variables

lev_p =
(/3,7,14,24,37,53,70,85,100,118,140,164,193,227,266,314,369,434,510,600,697,788,867,930,970,993/)
lev_p@units = "hPa"
t_avgd!0 = "lev"
t_avgd&lev = lev_p

- however I specify a range of pressures (for variables (lev,lat,lon)

plot = gsn_csm_pres_hgt_vector(wks,t_avgd({993:193},{5},{-60:60})\
                                  , u_avgd({993:193},{5},{-60:60})\
                                  ,omegascale({993:193},{5},{-60:60})\
                                  ,res)

but the plot still plots at pressures outside that range, i.e. it's
plotting from 993 to 3 (although the y axis labels are all nice and even
i.e. 1000, 950, 900... etc.)

There's obviously something I'm not specifying correctly... any ideas?

Thank you!

Madeleine

On Wed, Nov 16, 2011 at 11:08 AM, Mary Haley <haley@ucar.edu> wrote:

> Madeleine,
>
> What does your variable currently look like? Please do a
>
> printVarSummary(x)
>
> where "x" is your variable name. Does it already have coordinate arrays?
>
> If not, look at h_lat_1.ncl on the pressure/height page. It shows how to
> add coordinate arrays to the "psi" variable.
> [You can ignore the vinth2p and zonal_mpsi calls on that page.]
>
> Note that to do this, you must have 1D arrays for the coordinate arrays
> that you want to attach to your variable, and they
> must be the same length as the dimension that you're attaching it to.
>
> If you have 2D pressure/longitude values, then this is a different
> situation.
>
> --Mary
>
> On Nov 15, 2011, at 8:42 PM, Madeleine Patterson wrote:
>
> Hi,
>
> I would like a bit of advice on how to create a pressure-longitude plot...
>
> I am writing a script based on the pressure-height-vector plots given at
> http://www.ncl.ucar.edu/Applications/Scripts/vector_5.ncl and
> http://www.ncl.ucar.edu/Applications/Scripts/h_lat_7.ncl, but my model
> output is already in pressure levels (no need to convert from hybrid
> sigma-pressure levels with vinth2p() ), and I haven't output 3D pressure
> from my simulations...
>
> So I am trying to figure out how to use the pressure levels that T (or RH
> etc.) is already output at... and how exactly to use this information to
> construct the leftmost dimension of the 'data' argument that function
> requires? i.e.
>
> *data*
>
> The two-dimensional data to contour. The leftmost dimension must contain a
> one-dimensional coordinate array of pressure values, and the values must be
> in the correct units. This is determined by examining the "units" attribute
> of the coordinate variable. Some accepted units are "hpa", "hPa", "Pa",
> "pa", "mb", "millibars", etc. If the units attribute doesn't exist or has
> the wrong value, an error will be issued.
> Can it be done?
>
> Thanks for your advice.
>
> Madeleine
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
Received on Wed Nov 16 12:56:37 2011

This archive was generated by hypermail 2.1.8 : Thu Nov 17 2011 - 11:50:12 MST