Re: Making pressure-height plot with equally spaced pressure level

From: Jeff <jeffelf_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 05 2010 - 21:33:33 MST

Hi, Mary,

Thanks for reply. I tried your method but the result is not what I need.

When you use gsn_csm_pres_hgt to make plots of zonal mean of a
variable in a 3D data, it does not matter which pressure levels the
data include.

For example, if data1 contains 6 equally spaced levels on 1000, 800,
600, 400, 200, 0 mb and data2 contains 6 levels on 1000, 990, 950,
900, 700, 400, 0 mb, the axis in final plots will look the same. I
mean, the right axis of height is always equally spaced. So it is like
there is a pre-setup frame, and data are put into the frame.

However, using gsn_csm_contour, each level will occupy a row of same
width in the figure. Use the 6 levels example I mentioned above, the
distance between 1000 and 900 will be same as that between 900 and 0
mb.

Enclosed is a figure from gsn_csm_contour. The space between 800 and
600 in Y axis is larger than that between 600 and 400, because I have
more model layers (or more rows of data in the 2d variable I'm going
to plot) between 800 and 600 than between 600 and 400. But what I want
is equally spaced Y axis.

Although it may work, I don't want to interpolate the data to equally
spaced pressure levels since it may introduce some error.

Looking forward to your help. Thank you very much.
Yaosheng

On Tue, Jan 5, 2010 at 11:47 AM, Mary Haley <haley@ucar.edu> wrote:
>
> You are on the right track with the idea of setting up coordinates.  You can
> use the coordinate array feature if your coordinates are 1D.
>
> That is, you must have a 1D array of altitude values that has the same
> number of points as the leftmost dimension of your data array, and a 1D
> array of latitude values that has the same number of points as the rightmost
> dimension of your data array.
>
> If your data array is called "X", your altitude values "ALT", your latitude
> values "LAT", then you can set up the metadata for "X" so that you can plot
> it using gsn_csm_contour:
>
>
>  X!0 = "alt"   ; Name X's dimensions
>  X!1 = "lat"
>  X&alt = ALT  ; Using the names we just created,
>  X&lat = LAT ; attach the coordinate arrays to X
>
> Now, if you plot X:
>
>    plot = gsn_csm_contour(wks,X,res)
>
> it will see the coordinate arrays attached to X, and you should have the
> correct values on your X and Y axis.
>
> --Mary
>
> On Jan 4, 2010, at 10:34 AM, Jeff wrote:
>
>> Hi, Sir/Madam,
>>
>> I would like to make plots of zonal mean of some variable, that is, a
>> plot with altitude as Y-axis versus latitude as X-axis.
>> However, all examples I found on NCL website using equally spaced
>> height as Y-axis.
>> How can I use equally spaced pressure or sigma level as Y-axis?
>>
>> I also checked examples for general contour plots. They may serve
>> well. However, the example is too simple for me to follow. I have no
>> idea about how should I setup coordinates for the variable to plot so
>> that NCL can understand Y-axis is altitude and X-axis is latitude or
>> whatever coordinate. Is there a detailed example?
>>
>> Thank you very much.
>> Yaosheng Chen
>> _______________________________________________
>> 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
Received on Tue Jan 5 21:33:51 2010

This archive was generated by hypermail 2.1.8 : Wed Jan 06 2010 - 17:07:09 MST