Re: labelbar errors in a032?

From: Mary Haley (haley AT ucar.edu)
Date: Tue Jan 18 2005 - 08:47:23 MST

  • Next message: Benjamin Lamptey: "Plots"

    On Tue, 18 Jan 2005, David B. Reusch wrote:

    > hello,
    >
    > I am seeing a number of new (to me) errors with labelbars:
    > 1) if I set lbLabelAlignment to "BoxCenters", the last label
    > appears as "Label_x", where "x" is the cardinality-1 of
    > the last label (Label_9 if 10 boxes are present). also,
    > contrary to the web page, BoxCenters does not appear to
    > be the default (InteriorEdges is).

    Hi Dave,

    It sounds like you may be using the "gsn" functions, which I think set
    the "lbLabelAlignment" resource to "InteriorEdges". This is the more
    commonly used value for this resource setting.

    Once you change this to "BoxCenters", this means you need to provide
    one more label. Since NCL only knows about the label values for the
    interior edges (because it bases this information on the contour
    levels, and there are only as many interior edges as there are contour
    levels), then whenever you set this resource to something that
    requires more labels, you have to provide this label via the
    "lbLabelStrings" resource.

    See example 5 at:

        http://www.cgd.ucar.edu/csm/support/CSM_Graphics/eosdis.shtml

    It shows how to set this resource to "BoxCenters", and then how to
    also set "lbLabelStrings".

    > 2) similarly, if I use "ExternalEdges", the last TWO labels
    > are in this format.

    This is the same situation as 1), except now you need to provide two
    additional labels.

    > 3) trying to use cnLabelBarEndLabelsOn=True results in a
    > fatal error in $NCARG_ROOT/lib/ncarg/nclex/gsun/gsun_code.ncl
    > at or near line 1062. more specifically:
    > fatal:A bad value was passed to stringtolong, input strings
    > must contain numeric digits, replacing with missing value
    > fatal:The result of the conditional expression yields a
    > missing value. NCL can not determine branch, see ismissing function
    > and I wonder if this is related to (1) and (2)?

    I'm not sure. If you set this resource, I believe the end labels are
    just labeled with the min and max values of the data. In this case,
    you don't need to do anything with the lbLabelAlignment resource.
    It maybe choking if you are trying to set both resources. Please see
    example 10 at:

         http://www.cgd.ucar.edu/csm/support/CSM_Graphics/labelbar.shtml

    for a sample of how "cnLabelBarEndLabelsOn" works.

    > this is all under a032 on OS 10.3.7. I just switched to this
    > version from a031. not sure if any of the above was happening
    > in the prior release since I wasn't looking at these features.
    >
    > switching to a032 has also created a new, spurious warning
    > message for me. I am using LambertConformal as my projection
    > and setting gsnMaskLambertConformal=True -- but I always get
    > a warning "mask_lambert_conformal: warning: you are using a
    > projection other than LambertConformal. Unexpected results
    > will likely occur". but I *am* using LambertConformal!

    This is a bug that's been fixed. All you need to do is
    edit the files

         $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
         $NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_csm.ncl

    and change the line:

              lower_case(iproj).ne."LambertConformal")) then
    to:
              lower_case(iproj).ne."lambertconformal")) then

    > the script itself is generating a set of gsn_csm_contour_map
    > plots in a panel. it and the data are available on request.
    >
    > thanks,
    > dave

    Hopefully this answers some of your questions. If you have more, feel
    free to email me separately.

    --Mary
    haley@ucar.edu

    > ----------
    > Department of Geosciences
    > 517 Deike Building
    > Penn State University
    > University Park, PA 16802
    > _______________________________________________
    > ncl-talk mailing list
    > ncl-talk@ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    >
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Tue Jan 18 2005 - 08:54:34 MST