NGSETI error and vector plots and vcMinMagnitudeF

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Tue, 04 Nov 2008 13:11:05 -0700

This is a low priority request to improve error messaging from NCL
vector (wind arrow) plots under the following error condition.

When all vectors are accidentally suppressed, NCL prints this
undocumented error message, followed by several other strange
messages, then halts:

  ERROR 2 IN NGSETI - Parameter value out of range for CT

I recently found this difficult to debug, but finally boiled it down
to the following. The resource vcMinMagnitudeF is used with vector
plots to suppress small arrows and show only the larger ones. See
attached demo script, and change vcMinMagnitudeF from 15 to 45 to
see the error.

When vcMinMagnitudeF is greater than the largest vector within the
plot frame, all arrows are suppressed. Apparently this is
interpreted internally as a "zero field" error, rather than just a
blank vector plot, resulting in the non-obvious messages.

To further complicate diagnosis, the message "zero field" is plotted
in large font across the plot. But a check of the vector data finds
that it is all non-zero. In my own case, "zero field" was printed
in white over a white background because of color map issues, of
course rendering the message invisible.

So I suggest some error message improvements along these lines:

1. In a zero field condition, print "zero field", or better "zero
vector field" to the console, in addition to the plot overlay.

2. If vcMinMagnitudeF is greater than zero, then print a
supplemental message similar to:

   "All vectors were suppressed, vcMinMagnitudeF = 45.0,
   try a smaller value."

3. Make this error use standard NCL error reporting, where the
execution "stack" is displayed like for other NCL errors. For each
calling level, show the function name and the error line number.

My version info: ncl.ppc.5.0.1 pre-release binary
File date = 2008-may-07 (may have been changed from earlier)

uname -a = Darwin mac56.cdc.noaa.gov 9.5.0 Darwin Kernel
   Version 9.5.0: Wed Sep 3 11:31:44 PDT 2008;
   root:xnu-1228.7.58~1/RELEASE_PPC Power Macintosh
   powerpc PowerMac7,3 Darwin

Thanks for your consideration.

Dave Allured
CU/CIRES Climate Diagnostics Center (CDC)
http://cires.colorado.edu/science/centers/cdc/
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
http://www.cdc.noaa.gov/

; vector_3.ncl -- NCL example program
; Modified 2008-nov-04 to demo error problems when plotting.

; Data file available at: http://www.ncl.ucar.edu/Applications/Data/

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

begin
  a = addfile("uv300.nc","r") ; open data file
  u = a->U(1,:,:) ; read in zonal [u] and meridional [v] winds
  v = a->V(1,:,:)

  wks = gsn_open_wks("x11","vector") ; open plot file or window

  res = True
  res_at_vcRefMagnitudeF = 50.0 ; reference vector magnitude
  res_at_vcRefLengthF = 0.06 ; plot length of ref. vector
  res_at_vcMinDistanceF = 0.05 ; thin out the vectors

  res_at_vcMinMagnitudeF = 15.0 ; blank vectors below this magnitude;
                                        ; 45 causes zero field error

  plot = gsn_csm_vector_map_ce(wks,u,v,res) ; make plot
end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Nov 04 2008 - 13:11:05 MST

This archive was generated by hypermail 2.2.0 : Fri Nov 07 2008 - 13:41:15 MST