Re: Plotting Constant Fields

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 10 2012 - 10:16:58 MST

It depends on what you mean by "avoid it". You will be unable to plot a field with constant data. If you just want to get rid of the warning, then you can turn off all warning messages by putting the following near the top of your script:

 err = NhlGetErrorObjectId()
  setvalues err
    "errLevel" : "Fatal" ; only report Fatal errors
  end setvalues

Otherwise, if you just want to skip plotting for this data, then before you plot, you can check that the min and max of the data are not equal to each other.

  if(min(data).ne.max(data)) then
     plot = gsn_csm_....
  end if

--Mary

On Jan 10, 2012, at 4:26 AM, Paul Scorer wrote:

> Greetings!
>
> Is it possible to avoid the warning message below when plotting a
> constant scalar field? I am using gsn_csm_contour_map() if that is
> significant.
>
> warning:ContourPlotInitialize: scalar field is constant; ContourPlot not possible:[errno=1102]
>
>
> Cheers
>
> PaulS
>
> _______________________________________________
> 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 10 10:17:08 2012

This archive was generated by hypermail 2.1.8 : Wed Jan 18 2012 - 09:21:55 MST