g2gdf.pl part2

Mark Sponsler msponsler at COMCAST.NET
Tue Apr 15 23:40:49 EDT 2008


Hi Arlindo,
OK, let's see if I can answer a few of you queries:

1) The "-verf" option is essential for forecast files so that it uses the
verification rather than initial condition date/time. What kind of errors do
you get? I never used ActiveState perl for this, I'll have to give it a try.

Oh I see.  The documentation (wiki) indicates to use the '-v' option. But in your email you indicate '-verf'.  '-verf' works fine!  That was easy.

D:\Documents and Settings\Storm>g2gdf.pl -v -o c:\grib\hires_input\wc_4m.gdf -I c:\grib\hires_input\wc_4m.inv c:\grib\hires_input\multi_1.wc_4m.t00z.grib2

         g2gdf - control file/inventory for "g2" extension
         Descriptor: c:\grib\hires_input\wc_4m.gdf.gdf
         Inventory: c:\grib\hires_input\wc_4m.gdf.inv
         Data Dir: c:\grib\hires_input\
         Grib files: wc_4m.gdf
Big problem:
  either c:\grib\hires_input\wc_4m.gdf is missing or not a grib file
  or wgrib2 is not on your path or wgrib2 is too old.
cannot create c:\grib\hires_input\wc_4m.gdf.gdf --- is g2ctl.pl on path? at c:\Program Files\PCGrADS19\win32\g2gdf.pl line 52.

D:\Documents and Settings\Storm>g2gdf.pl -verf -o c:\grib\hires_input\wc_4m.gdf -I c:\grib\hires_input\wc_4m.inv c:\grib\hires_input\multi_1.wc_4m.t00z.grib2

         g2gdf - control file/inventory for "g2" extension
         Descriptor: c:\grib\hires_input\wc_4m.gdf
         Inventory: c:\grib\hires_input\wc_4m.inv
         Data Dir: c:\grib\hires_input\
         Grib files: multi_1.wc_4m.t00z.grib2

D:\Documents and Settings\Storm>

2) I don't see the "OPTIONS template" record. Is it there?

Nope - I've attached the resulting gdf file for your review.

I'll go run some tests with the model_25.grib2 now and see what happens.
--
Thanks,
Mark

-------------- Original message --------------
From: Arlindo da Silva <dasilva at ALUM.MIT.EDU>

On Tue, Apr 15, 2008 at 3:02 PM, Mark Sponsler <msponsler at comcast.net> wrote:

Hi Arlindo,
I started trying to process grib2 files after building a gdf and inv file
using g2gdf.pl but encountered some errors.

1) Documentation:  http://opengrads.org/doc/udxt/grib2/grib2.html
In the example section the sample command below indicates it produces a
inv and gdf file.  I found that using the '-v' option does not produce the
expected results, and causes g2gdfl.pl to error out. If the -v option is
removed, all works fine.

'g2gdf.pl -v gfs.t00z.pgrb2bf00' should be 'g2gdf.pl gfs.t00z.pgrb2bf00'





The "-verf" option is essential for forecast files so that it uses the verification rather than initial condition date/time. What kind of errors do you get? I never used ActiveState perl for this, I'll have to give it a try.



2)When running g2gdfl.pl to produce a control file, something interesting
occurs in the control file.  Here's a snippet of the first few lines of
the ctl file:

dset c:\grib\hires_input\multi_1.wc_4m.t12z.grib2___
undef 9.999E+20
title c:\grib\hires_input\multi_1.wc_4m.t12z.grib2
*  produced by g2ctl v0.0.3g
* griddef=1:0:(736 x 526):grid_template=0: lat-lon grid:(736 x 526) units
1e-06 input WE:NS output WE:SN res 48 lat 50.000000 to 15.000000 by
0.066667 lon 195.000000 to 244.000000 by 0.066667 #points=387136

ydef 526 linear 15.000000 0.066667
xdef 736 linear 195.000000 0.066667



I don't see the "OPTIONS template" record. Is it there?


When trying to open that file, an error is received:

P:\>set PATH=c:\Program Files\PCGrADS19\win32;%PATH%

P:\>gradsc -l
Starting X server under /Xming
Starting gradsc under c:\PROGRA~1\PCGRAD~2\win32 ...

Grid Analysis and Display System (GrADS) Version 1.9.0-rc1
Copyright (c) 1988-2007 by Brian Doty and IGES
Center for Ocean-Land-Atmosphere Studies (COLA)
Institute for Global Environment and Society (IGES)
GrADS comes with ABSOLUTELY NO WARRANTY
See file COPYRIGHT for more information

Config: v1.9.0-rc1 32-bit little-endian readline lats athena printim

Issue 'q config' command for more information.

GX Package Initialization: Size = 11 8.5
ga-> g2_open c:/grib/hires_input/wc_4m.gdf
Scanning description file:  c:/grib/hires_input/wc_4m.gdf
Open Error:  Can't open binary data file
 File name = c:\grib\hires_input\multi_1.wc_4m.t12z.grib2___
ga->



If you had a "OPTIONS template record in your gdf you should not get an error. Any attempt to plot anything would return all undefs.


Notice the underscores at the end of the dset name. If I manully delete
those underscores, then try to open the file, all goes well. Can do a 'q
file' with good results.



Strange as it may sound, the undescores are there by design. This file is not supposed to exist.



But the documentation seems to suggest that maybe there should be a binary
file produced??? And if I try and actually display a variable things do
not go well.



No binary file is produced. The gdf is the equivalent of a ctl, while the inv file takes the place of the gribmap index, although it is a text file as well. The only binary file involved is the grib-2 file.


Not sure what to do now.

I've got another way to get to the data, but am just trying to use the new
interface to see how it works.


I suspect the issue may be perl related. All my tests have been with a cygwin built perl. Unfortunately, the shipped g2ctl.exe does not seem to work but on my machine. Could you please:


1) send the output of "g2gdf.pl -verf gfs.t00z.pgrb2bf00", including any file it produces or error messages.


2) I included under test_data/ a test grib-2 file model_25.grib2 along with .gdf/.inv files. Can you open and plot this data? (See my original post).


3) Can you create similar gdf/inv files from the model_25.grib2 file?


  I'll try ActiveState perl on a gfs file and let you know what I find out.


    Arlindo


--
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080416/677bf64d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 1919 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20080416/677bf64d/attachment.obj 


More information about the gradsusr mailing list