[gradsusr] OpenGrads/Grads: Cannot plot colorbar, no shading information

Adams, Jennifer M. (GSFC-610.2)[ADNET SYSTEMS INC] jennifer.m.adams at nasa.gov
Mon Feb 25 09:33:48 EST 2019


Hi, Tim –
The reason you are getting the “Cannot plot colorbar, no shading information” error message is because the color bar scripts rely on the output from ‘q shades’ to get the colors and levels for the color bar; if you have not drawn a 2D plot with gxout shaded or grfill then the result from ‘q shades’ is “None” and the color bar script quits. (Aside: If you draw a 2D line contour plot, you can get the contour levels and colors with ‘q contours’.) The buffer where the info returned by ‘q shades’ and ‘q contours’ is stored gets reset with ‘clear’ or overwritten if you draw a new 2D contour/shaded/grfill plot. But that buffer does not change if you restrict the dimension environment to 1 dimension varying and overlay a line plot – i.e. it doesn’t reset with every ‘display’. Just be careful to keep track of when you are displaying a 2D plot that will return something meaningful for ‘q shades’ so the color bar script will work as expected. I think this is why you find it works if you expand your lat/lon domain.

--Jennifer

--
Jennifer Miletta Adams
ADNET Systems, Inc.
NASA/GSFC, Code 610.2
Building 32, Room S159
(301) 614-6070


From: gradsusr <gradsusr-bounces at gradsusr.org> on behalf of Tim Van Damme <tim at stormcell.be>
Organization: Stormcell
Reply-To: "tim at stormcell.be" <tim at stormcell.be>, GrADS Users Forum <gradsusr at gradsusr.org>
Date: Saturday, February 23, 2019 at 9:01 AM
To: "tim at stormcell.be" <tim at stormcell.be>, 'GrADS Users Forum' <gradsusr at gradsusr.org>
Subject: Re: [gradsusr] OpenGrads/Grads: Cannot plot colorbar, no shading information

UPDATE: when I leave the mpvals but enlarge the set lon set lat it seems to work fine…


Met vriendelijke groeten,

Tim Van Damme
tim at stormcell.be<mailto:tim at stormcell.be>

From: gradsusr [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Tim Van Damme
Sent: 23 February 2019 11:50
To: gradsusr at gradsusr.org
Subject: [gradsusr] OpenGrads/Grads: Cannot plot colorbar, no shading information

Hello all,

Lately I am experiencing some issues with plotting GFS data on charts. I used the cbarn.gs from the old opengrads version and the newer version as well as cbar cbarb cbarc etc… It all comes down to the same error: Cannot plot colorbar, no shading information

Once I start plotting a timeseries some of them go well and get the colorbar, others don’t. I have been searching for an explanation but couldn’t come up with one. I have it on the 0.25 0.50 and 1 degree GFS data. I have it for some charts, others don’t seem to have the issue. For example the Cape and Cinh charts do struggle with it, the temperature, dewpoint and low level shear don’t.

An example is below. It is the script that is started through a .bat file that plots the cape 180mb  data. Maybe someone of you guys might find the error?

**

function main(args)

* Parse the arguments: date, hour
  if (args = '')
  prompt 'Enter forecast date (example, 20110717) --> '
  pull date
  prompt 'Enter forecast hour (example, 00 or 06 or 12 or 18) --> '
  pull hour
  else
  date = subwrd(args,1)
  hour  = subwrd(args,2)
  endif

'reinit'
'sdfopen https://nomads.ncep.noaa.gov:9090/dods/gfs_0p25/gfs'date'/gfs_0p25_'hour'z'
SAY 180Cape

* Get info from the descriptor file
'q ctlinfo'
_ctl = result
_undef = getctl(undef)
_tdef = getctl(tdef)
_zdef = getctl(zdef)

maps = 66

* Get the Time axis info
tsize = subwrd(_tdef,2)
_t1 = 1       ;* 2nd half of timeseries
_t2 = 45
tsize = _t2 - _t1 + 1
'set t '_t1' '_t2
'q dims'
times  = sublin(result,5)
_time1 = subwrd(times,6)
_time2 = subwrd(times,8)
_tdim = _time1' '_time2

tincr = subwrd(_tdef,5)
_tdef = 'tdef 'tsize' linear '_time1' 'tincr

huh = subwrd(_tdef,4)

****************************************
* 180-0mb Caoe
****************************************

  i = 3
  while ( i<maps )

* Set up a few preliminary characteristics
setmap(1)
'set rgb 16 0 100 254'
'set rgb 17 0 150 254'
'set rgb 18 0 200 254'
'set rgb 19 0 230 240'
'set rgb 20 0 230 160'
'set rgb 21 0 230 120'
'set rgb 21 0 230 80'
'set rgb 22 0 240 40'
'set rgb 23 0 250 0'
'set rgb 24 254 254 0'
'set rgb 25 254 225 0'
'set rgb 26 254 200 0'
'set rgb 27 254 175 0'
'set rgb 28 254 150 0'
'set rgb 29 230 125 0'
'set rgb 30 230 100 0'
'set rgb 31 220 75 30'
'set rgb 32 200 50 30'
'set rgb 33 180 25 30'
'set rgb 34 170 0 30'
'set rgb 35 180 0 50'
'set rgb 36 200 0 100'
'set rgb 37 254 0 150'
'set rgb 38 254 0 200'
'set rgb 39 254 0 254'
'set rgb 40 254 90 254'
'set rgb 41 255 150 255'

'set t 'i


'set gxout shaded'
'set csmooth on'
'set clevs  0 200 400 600 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 3200 3400 3600 3800 4000'
'set ccols  16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41'
'd cape180_0mb'

'cbarn'

'query time'
time = subwrd(result,3)
day = subwrd(result,6)
fcsttime = substr(time,1,13)
fcstday = substr(day,1,3)

'q dims'
times  = sublin(result,5)
hub = subwrd(times,6)


'set strsiz 0.12'
'set string 0 r 3 90' ; 'draw string 9.3 6 Cape in Joules/kg'
'set string 0 r 3 0' ; 'draw string 8.7 8.4 Valid: 'fcstday' 'fcsttime
'set string 0 l 3 0' ; 'draw string 0.1 0.1 Data: NOAA NCEP GFS 0.25 - WWW.STORMCELL.BE<http://WWW.STORMCELL.BE>'
'set string 2 r 3 0' ; 'draw string 8.7 0.1 GFS Run: 'huh

* Draw Labels at the top of the page
'set string 0 r 11 0'
'set strsiz 0.12'
'set string 4 l 3 0' ; 'draw string 0.1 8.4 180-0mb above ground cape'
'gxprint bel_180cape'i'.png x1000 y844 -f overlay.png'

i = i+1
endwhile

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* END OF MAIN SCRIPT
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

**


Met vriendelijke groeten,

Tim Van Damme
+32 499 61 25 61
tim at stormcell.be<mailto:tim at stormcell.be>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20190225/996f2f3c/attachment-0001.html>


More information about the gradsusr mailing list