Re: gsn_csm_pres_hgt for 1D data?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Apr 29 2014 - 12:58:34 MDT

Sha,

I'm responding back to ncl-talk, because we prefer that follow-up questions always go back to the list, and not to individual developers.

This particular function uses an internal function to calculate the height based on pressure. Since this calculation depends on coordinate arrays, this function then only allows 2D data that is represented by coordinate arrays. The function is called "gsn_geop_hgt", and you can see it inside the $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl script.

Once you start trying put 1D unstructured data on a plot, you will lose your tickmarks, unless you are putting the data over a map, which you are not doing.

To use gsn_csm_pres_hgt, you will need to regrid your data to a rectilinear grid (e.g. one with coordinate arrays).

Otherwise, you can use gsn_csm_contour to create the contours, which will cause your tickmarks to disappear. You can then overlay this contour plot on a "linear" plot to force the tickmarks to reappear, and then you can use tmYRMode/tmYRValues/tmYRLabels to label the right Y axis with height values. The problem is, you will need to provide the appropriate height values, given the pressure values.

You can see an example of overlaying a contour plot on a linear plot at:

http://www.ncl.ucar.edu/Applications/2Dvertcoord.shtml

Look at the first example on this page.

--Mary

On Apr 28, 2014, at 6:39 PM, Sha Feng <sfeng@mail.usf.edu> wrote:

> Hi Mary,
>
> May I ask what the relationship (equation) ncl uses for gsn_csm_pres_hgt to generate the height coordinate?
>
> I need to plot a vertical profile with pressure and height coordinates, so I am thinking to take advantage of this function. But it only works for 2d data. Could you please inform?
>
> Thanks,
> Sha

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Apr 29 12:58:45 2014

This archive was generated by hypermail 2.1.8 : Sun May 04 2014 - 12:38:56 MDT