[gradsusr] Cannot Contour Grid - all undefined values error

Jennifer M Adams jadams21 at gmu.edu
Wed Jun 7 19:10:38 EDT 2017


Support for GRIB2 Product Definition Template 12 has been in GrADS for a while, but this may be the first time anyone has tried to look at (or asked for help with) a file that contains a PDT=12 record — I don’t have any other samples in my archives. 

I checked the source code for version 2.1.1.b0 and it appears that ensemble grib2 codes are required in order to match a record with a PDT = 1, 2, 11, or 12. This is different from version 2.0.1 (the one Wesley was testing with) — in this older version, if the E dimension size is 1, the grib2 ensemble codes are not checked at all, no matching necessary. I got stricter about matching ensemble metadata starting with version 2.1.a2, when the -u option for gribmap was re-introduced. This feature did not make it into the ChangeLog or the documentation. That clears up the mystery of why it only worked for Wesley.

Now … for PDT=2 or 12, the EDEF entry must contain a code (197 in this case) that identifies the type of derived forecast (a product derived from all ensemble members). Code table 4.7 (http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table4-7.shtml) says that a code value of 197 means the record contains a Climate Percentile (percentile values from a climate distribution). I think it’s safe to say that this is an obscure use of GRIB2 metadata. 

Bill, even though you are a novice, you managed to provide me with a sample of PDT 12 that I didn’t have before, you gave us experts a chance to clarify the requirements for grib2 ensemble metadata, and you revealed some gaps in the documentation that need to be fixed. You should be very proud. 

All the rest of you lurkers who got this far in the thread should take note and not be afraid to ask questions! 
Cheers,
Jennifer


> On Jun 7, 2017, at 4:58 PM, William Rasch - NOAA Federal <william.rasch at noaa.gov> wrote:
> 
> Yep, that did it!!!
> 
> Thanks for all your help folks!
> 
> Bill
> 
> 
> On Wed, Jun 7, 2017 at 12:22 PM, Wesley Ebisuzaki - NOAA Federal <wesley.ebisuzaki at noaa.gov> wrote:
> Bill,
> 
> Can you try the latest version of GrADS, v2.1.1.b0?
> 
> bash-4.1$ ~/grads-2.1.1.b0/bin/gribmap -v -i junk.ctl 
> gribmap: scanning GRIB2 file: pctile.2017060600.000_to_024hrs.grib2 
> 1.1: lev1=1,0 var=0,1,8,4 ens=197 valid at 2017-06-07-00:00 (t=1)  MATCH 
> 2.1: lev1=103,2 var=0,0,0,0 ens=197 valid at 2017-06-07-00:00 (t=1)  MATCH 
> 3.1: lev1=103,10 var=0,2,1,0 ens=197 valid at 2017-06-07-00:00 (t=1)  MATCH 
> gribmap: Writing out the GRIB2 index file (version 3)
> 
> Seems that Jennifer has been adding support for grib2 PDT=12 (derived forecasts
> based on all ensemble members).
> 
> Wesley
> 
> 
> On Wed, Jun 7, 2017 at 2:37 PM, William Rasch - NOAA Federal <william.rasch at noaa.gov> wrote:
> Wesley,
> 
> Can't say it enough, thanks again for helping.
> 
> When I start Grads here is what is says:
> 
> So I guess Version 2.1.a3.p4
> 
> Grid Analysis and Display System (GrADS) Version 2.1.a3.p4
> Copyright (C) 1988-2015 by the Institute for Global Environment and Society (IGES)
> GrADS comes with ABSOLUTELY NO WARRANTY
> See file COPYRIGHT for more information
> 
> Config: v2.1.a3.p4 little-endian readline grib2 netcdf hdf4-sds hdf5 opendap-grids,stn geotiff shapefile cairo
> Issue 'q config' command for more detailed configuration information
> GX Package Initialization: Size = 11 8.5
> Running in Batch mode
> 
> 
> 
> On Wed, Jun 7, 2017 at 10:42 AM, Wesley Ebisuzaki - NOAA Federal <wesley.ebisuzaki at noaa.gov> wrote:
> Jennifer, Bill,
> 
> This is very strange:
> 
> > gribmap -v -i pctile.2017060700.000_to_024hrs.grib2.ctl
> gribmap: scanning GRIB2 file: pctile.2017060700.000_to_024hrs.grib2
> 1.1: lev1=1,0 var=0,1,8,4 ens=197
> 2.1: lev1=103,2 var=0,0,0,0 ens=197
> 3.1: lev1=103,10 var=0,2,1,0 ens=197
> gribmap: Writing out the GRIB2 index file (version 3)
> 
> Why does gribmap say the file has "ens=197"?  This is not
> an ensemble file.  I don't get "ens=197" and I get a match.
> 
> Bill what version of GrADS are you using?
> 
> Wesley
> 
> 
> 
> On Wed, Jun 7, 2017 at 12:01 PM, William Rasch - NOAA Federal <william.rasch at noaa.gov> wrote:
> Jennifer/Wesley,
> 
> The level of support you both are providing is crazy great, so thanks.  Ugh!  But I'm still having issues!  Really strange.
> 
> So here is my latest,
> 
> I do the g2ctl on the grib2 file that I downloaded.  I then did a cat command on that control file...below...there are some lines different, not sure they are significant?  In the control file there is ENDVARS, Jennifer, yours has ENDEDEF for one.
> 
> > g2ctl pctile.2017060700.000_to_024hrs.grib2 > pctile.2017060700.000_to_024hrs.grib2.ctl
> > cat pctile.2017060700.000_to_024hrs.grib2.ctl
> dset ^pctile.2017060700.000_to_024hrs.grib2
> index ^pctile.2017060700.000_to_024hrs.grib2.idx
> undef 9.999E+20
> title pctile.2017060700.000_to_024hrs.grib2
> * produced by g2ctl v0.1.1
> * command line options: pctile.2017060700.000_to_024hrs.grib2
> * griddef=1:0:(131 x 66):grid_template=0:winds(N/S): lat-lon grid:(131 x 66) units 1e-06 input WE:SN output WE:SN res 48 lat 10.000000 to 75.000000 by 1.000000 lon 180.000000 to 310.000000 by 1.000000 #points=8646:winds(N/S)
> 
> dtype grib2
> ydef 66 linear 10.000000 1
> xdef 131 linear 180.000000 1.000000
> tdef 1 linear 00Z08jun2017 1mo
> zdef 1 linear 1 1
> vars 3
> APCPsfc   0,1,0   0,1,8,4 ** surface Total Precipitation [kg/m^2]
> TMP2m   0,103,2   0,0,0,0 ** 2 m above ground Temperature [K]
> WIND10m   0,103,10   0,2,1,0 ** 10 m above ground Wind Speed [m/s]
> ENDVARS
> 
> So now I do the index command and don't get any matches...
> 
> > gribmap -v -i pctile.2017060700.000_to_024hrs.grib2.ctl
> gribmap: scanning GRIB2 file: pctile.2017060700.000_to_024hrs.grib2
> 1.1: lev1=1,0 var=0,1,8,4 ens=197
> 2.1: lev1=103,2 var=0,0,0,0 ens=197
> 3.1: lev1=103,10 var=0,2,1,0 ens=197
> gribmap: Writing out the GRIB2 index file (version 3)
> 
> When I then do a:
> > grads -l
> > open pctile.2017060700.000_to_024hrs.grib2.ctl
> > d tmp2m
> 
> I get the UNDEFINED ERROR!!!
> 
> Ugh!
> 
> Thanks so much if you have ANY other ideas!
> 
> Bill
> 
> 
> 
> 
> 
> On Tue, Jun 6, 2017 at 2:03 PM, Jennifer M Adams <jadams21 at gmu.edu> wrote:
> 
>> On Jun 6, 2017, at 4:07 PM, William Rasch - NOAA Federal <william.rasch at noaa.gov> wrote:
>> 
>> Hi Jennifer,
>> 
>> I don't know what my descriptor file is.
> 
> It is the output from g2ctl. It is a text file that organizes metadata in a format that GrADS (and humans) can easily understand. I copied it into a file (I named it pctile.2017060500.000_to_024hrs.grib2.ctl) like this: 
> 
> > g2ctl pctile.2017060500.000_to_024hrs.grib2 > pctile.2017060500.000_to_024hrs.grib2.ctl
> 
> And here is what is in it:
> 
> dset ^pctile.2017060500.000_to_024hrs.grib2
> index ^pctile.2017060500.000_to_024hrs.grib2.idx
> undef 9.999E+20
> title pctile.2017060500.000_to_024hrs.grib2
> * produced by g2ctl v0.1.1
> * command line options: pctile.2017060500.000_to_024hrs.grib2
> * griddef=1:0:(131 x 66):grid_template=0:winds(N/S): lat-lon grid:(131 x 66) units 1e-06 input WE:SN output WE:SN res 48 lat 10.000000 to 75.000000 by 1.000000 lon 180.000000 to 310.000000 by 1.000000 #points=8646:winds(N/S)
> dtype grib2
> ydef 66 linear 10.000000 1
> xdef 131 linear 180.000000 1.000000
> tdef 1 linear 00Z06jun2017 1mo
> zdef 1 linear 1 1
> vars 3
> APCPsfc   0,1,0   0,1,8,4 ** surface Total Precipitation [kg/m^2]
> TMP2m   0,103,2   0,0,0,0 ** 2 m above ground Temperature [K]
> WIND10m   0,103,10   0,2,1,0 ** 10 m above ground Wind Speed [m/s]
> ENDVARS
> EDEF 1
> E197 1  00Z06jun2017 197
> ENDEDEF
> 
> 
> Then I ran gribmap on it, like this:
> 
> >  gribmap -v -i pctile.2017060500.000_to_024hrs.grib2.ctl
> gribmap: scanning GRIB2 file: pctile.2017060500.000_to_024hrs.grib2 
> 1.1: lev1=1,0 var=0,1,8,4 ens=197 valid at 2017-06-06-00:00 (t=1)  MATCH 
> 2.1: lev1=103,2 var=0,0,0,0 ens=197 valid at 2017-06-06-00:00 (t=1)  MATCH 
> 3.1: lev1=103,10 var=0,2,1,0 ens=197 valid at 2017-06-06-00:00 (t=1)  MATCH 
> gribmap: Writing out the GRIB2 index file (version 3)
> 
> 
> I could open this file with GrADS and display tmp2m:
> <pctile.2017060500.000_to_024hrs.grib2.png>
> 
> 
> 
>> 
>> 
>> Bill
>> 
>> 
>> On Tue, Jun 6, 2017 at 8:50 AM, Jennifer M Adams <jadams21 at gmu.edu> wrote:
>> There is no need to apologize for being a novice. You may find this doc page on how GrADS deals with GRIB data useful:
>> http://cola.gmu.edu/grads/gadoc/grib.html
>> Please see more comments inline.
>> 
>> 
>> > On Jun 6, 2017, at 11:34 AM, William Rasch - NOAA Federal <william.rasch at noaa.gov> wrote:
>> > I grabbed one of the files, only one, then cat'ed that to the efi.master
>> 
>> I would haved run g2ctl on just the one file, before cat’ing it to efi.master.
>> 
>> >
>> > Ran:  g2ctl  efi.master.ctl
>> >
>> > Then, did a gribmap -v efi.master.ctl
>> >
>> > It then prompted me the "descriptor file", and I entered:  efi.master.ctl
>> >
>> > The feedback from that was this:
>> 
>> In general, it would be better to send the actual text instead of an image of it.
>> 
>> >
>> > <image.png>
>> It doesn’t look you got a MATCH for any of the records in your file.
>> What is in your descriptor file?
>> 
>> —Jennifer
>> 
>> >
>> > I then tried to display tmp2m and got the same error.
>> >
>> > Thanks for any additional help and again, sorry for my incompetence with this.
>> >
>> > Bill
>> >
>> > On Mon, Jun 5, 2017 at 6:20 PM, Jennifer M Adams <jadams21 at gmu.edu> wrote:
>> > Hi, Bill -
>> > I find that the g2ctl output often needs a few tweaks to get evertyhing right and some variables need a fourth grib code in the units field in order to match properly. You also appear to be concatenating files with different time stamps and this may be confusing the issue. Try setting up your descriptor with only one file, and run gribmap in verbose mode (with the -v) and look at what is matching/not matching. If records don’t match what’s in your descriptor, gribmap will show you what the entry should contain. Once you are matching all the records in one file, then add the templating for multiple time steps. If it’s still not working please send your descriptor and the gribmap verbose output.
>> > —Jennifer
>> >
>> >
>> >
>> > On Jun 5, 2017, at 11:33 AM, William Rasch - NOAA Federal <william.rasch at noaa.gov> wrote:
>> >
>> > > Hi,
>> > >
>> > > I have what would seem to be a very simple data-set and "variable" I'm trying to plot wiht GrADS.
>> > >
>> > > The grib files are located here...
>> > >
>> > > ftp://ftp.cdc.noaa.gov/Public/gbates/reforecast2/efi_grib2/pctile.2017060500.000_to_024hrs.grib2
>> > >
>> > > I am simply downloading several of these files, then do this:
>> > >
>> > > cat * > efi.master
>> > > g2ctl efi.master > efi.master.ctl
>> > > gribmap -i efi.master.ctl
>> > >
>> > > I'm simply trying to plot either:
>> > >
>> > > temp2m
>> > > wind10m
>> > > apcpsfc
>> > >
>> > > When I try to display the data, I get the error:
>> > >
>> > > Cannot Contour Grid - all undefined values
>> > >
>> > > Thanks for any help....
>> > >
>> > > Bill
>> > > _______________________________________________
>> > > gradsusr mailing list
>> > > gradsusr at gradsusr.org
>> > > http://gradsusr.org/mailman/listinfo/gradsusr
>> >
>> > --
>> > Jennifer Miletta Adams
>> > Center for Ocean-Land-Atmosphere Studies (COLA)
>> > George Mason University
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > gradsusr mailing list
>> > gradsusr at gradsusr.org
>> > http://gradsusr.org/mailman/listinfo/gradsusr
>> >
>> >
>> >
>> > --
>> >
>> > William Rasch
>> > Science and Operations Officer
>> > Weather Forecast Office
>> > Sacramento, CA
>> > _______________________________________________
>> > gradsusr mailing list
>> > gradsusr at gradsusr.org
>> > http://gradsusr.org/mailman/listinfo/gradsusr
>> 
>> --
>> Jennifer Miletta Adams
>> Center for Ocean-Land-Atmosphere Studies (COLA)
>> George Mason University
>> 
>> 
>> 
>> 
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>> 
>> 
>> 
>> -- 
>> 
>> William Rasch
>> Science and Operations Officer
>> Weather Forecast Office
>> Sacramento, CA
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> --
> Jennifer Miletta Adams
> Center for Ocean-Land-Atmosphere Studies (COLA)
> George Mason University
> 
> 
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> 
> 
> -- 
> 
> William Rasch
> Science and Operations Officer
> Weather Forecast Office
> Sacramento, CA
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> 
> 
> -- 
> 
> William Rasch
> Science and Operations Officer
> Weather Forecast Office
> Sacramento, CA
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> 
> 
> -- 
> 
> William Rasch
> Science and Operations Officer
> Weather Forecast Office
> Sacramento, CA
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University






More information about the gradsusr mailing list