Re: Gap in contour plot

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 25 Aug 2009 14:40:54 -0600

As per Adam's comment:

When you use "gsn_csm_contour_map_ce", the underlying
code, by default, adds a cyclic [point]. When you
use "gsn_csm_contour" [no map], users must explicitly
specify that a cyclic point must be added.

      res_at_gsnAddCylic = True

Also, when NCL imports a variable

      x = f->X

Use printVarSummary to look at the variable.
Note that NCL imports a 'data object' (aka, a structure)
which includes all meta data [attributes and, if appropriate,
coordinate variables]. So, generally, you do not need to
explicitly create lat/lon arrays.

       x&lat, x&lon are the coordinates associated with 'x'

I you do want/need to do the following

    nlats = 48
    nlons = 96

    lat = latGau(nlats, "lat", "latitude", "degrees_north")
    lon = lonGlobeF(mlon, "lon", "longitude", "degrees_east")

http://www.ncl.ucar.edu/Document/Functions/Contributed/latGau.shtml
http://www.ncl.ucar.edu/Document/Functions/Contributed/lonGlobeF.shtml

====
What Debashish was talking about was a special case wher you
have data that (nominally) spans 0 to 360 and you want to plot,
say, -60 to 40. Then using lonFlip would be the way to go.

Brian Holland wrote:
> Hello,
>
> I am using gsn_csm_contour_map_ce to create a map, and then using
> gsn_csm_contour to overlay a set of contours on that map. This works
> fine, except that there is a gap in the resulting contours along the
> zero longitude line. Any idea how I can fix this problem? Below I am
> copying the code used to define the points the data will be mapped to
> for the contour plot. If needed I can post more of the code.
> Thanks!
> Brian Holland
>
>
>
>
> nlons = 96
> nlats = 48
>
> gau_info = new((/nlats,2/),float)
> gau_info = doubletofloat(gaus(nlats/2))
>
> lat = new((/nlats/),float)
> lat_at_long_name = "latitude"
> lat_at_units = "degrees_north"
> ;lat@_FillValue = "-9999."
> lat = gau_info(:,0)
>
> lon = new((/nlons/),float)
> lon_at_long_name = "longitude"
> lon_at_units = "degrees_east"
> ;lon@_FillValue = "-9999."
>
> do i = 0, nlons-1
> lon(i) = 360./(nlons)*i
> end do
>
>
>
> ********************************
> Brian Holland
> Graduate Student
> University of Oklahoma
> 5357 National Weather Center
> 972-897-4871
> bholland_at_ou.edu <mailto:bholland_at_ou.edu>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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 Aug 25 2009 - 14:40:54 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 02 2009 - 12:24:39 MDT