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

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 16 2011 - 13:11:57 MST

Hi Madeleine,
If your pressure coordinate variable is ordered from top to bottom,
3,7,etc->970,993hPa, you need to specify your coordinate subscripting in
the same order. Thus: t_avgd({193:993},{5},{-60:60}), or simply:
t_avgd({193:},{5},{-60:60})
Adam

On 11/16/2011 12:56 PM, Madeleine Patterson wrote:
> 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
> <mailto: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
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 16 13:12:04 2011

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