[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retrieving the grib1 nx and ny



On Thu, 16 Feb 2006, Carl Drews wrote:

> Here is my /d1/grib/afwa/2005-07-14-0900_us057g1010t04q060003000.
>
> You can look at the first three splits.
>
> Carl
>
> Robb Kambic wrote:
>
> >sure, send a sample file. the grib1 decoder can't decode all grib1 type
> >files, ie tiled grib files or thin grids.
> >
> >robb..
> >
> >
> >
> >On Thu, 16 Feb 2006, Carl Drews wrote:
> >
> >
> >
> >>Robb -
> >>
> >>I am examining the grid sizes.  They look okay for Grib2 files, but not
> >>for Grib1.  Here is my calling sequence:
> >>
> >>            // get all the records (without their data)
> >>            Grib1Input input1 = new Grib1Input(_gribRaf);
> >>            input1.scan(false, false);
> >>            records = input1.getRecords();
> >>            _console.display("There are " + records.size() + " records
> >>in the file.",
> >>                    ConsoleDisplay._kVerbose);
> >>
> >>            // get one record
> >>            Grib1Record oneRecord = (Grib1Record)records.get(5);
> >>            Grib1GridDefinitionSection gds = oneRecord.getGDS();
> >>            int nx = gds.getNx();
> >>            int ny = gds.getNy();

Carl,

the package come with a grib dumper, that shows the correct values for Nx
and Ny.   you might want to look at the Grib1Dump.java code.  also, if you
add a "true" to the end, it will show the data values for the first
record, that look correct  for K.

robb...

wcfields.unidata.ucar.edu.rkambic> java -Xmx256m ucar/grib/grib1/Grib1Dump
data/xac true | m
--------------------------------------------------------------------
                        Header : ^C??9??<?-J?l?^@7777
                    Discipline : 0 Meteorological Products
                  GRIB Edition : 1
                   GRIB length : 81094
            Originating Center : 57 Air Force Weather Agency
        Originating Sub-Center : 1 Melbourne
            Product Definition : 0 Forecast/Uninitialized Analysis/Image
Product
            Parameter Category : -1 Meteorological Parameters
                Parameter Name : 11 TMP Temperature
               Parameter Units : K
                Reference Time : 2005-07-14T06:00:00Z
                    Time Units : hour
          Time Range Indicator : product valid at RT + P1
                   Time 1 (P1) : 30
                   Time 2 (P2) : 0
       Generating Process Type : 10
                    Level Type : 107 Sigma level
                 Level Value 1 : 9790
                 Level Value 2 : 0
                    GDS Exists : true
                    BMS Exists : false
         Number of data points : 64800
                     Grid Name : Lambert Conformal
                    Grid Shape : 0 spherical
         Spherical earth radius: 6367.47
                            Nx : 288
                            Ny : 225
                           La1 : 15.268
                           Lo1 : 33.299
  Resolution & Component flags : 136
                           LoV : 50.0
                            Dx : 15000.0
                            Dy : 15000.0
             Projection center : 0
                 Scanning mode : 64
                        Latin1 : 60.0
                        Latin2 : 30.0
                         SpLat : -90.0
                         SpLon : 0.0
data[ 0 ]=309.69998
data[ 1 ]=309.59998
data[ 2 ]=309.5
data[ 3 ]=309.4
data[ 4 ]=309.3
data[ 5 ]=309.19998
data[ 6 ]=309.19998
data[ 7 ]=309.09998
data[ 8 ]=309.09998
data[ 9 ]=309.19998
data[ 10 ]=309.19998
data[ 11 ]=309.19998
data[ 12 ]=309.19998
data[ 13 ]=309.3
data[ 14 ]=309.3
...




> >>
> >>With the debugger I see values of nx = 8193 and ny = -7936.  With
> >>another application I can see values of nx = 288 and ny = 225.  The
> >>latter values multiply to the correct size of  the data block, which is
> >>64,800.
> >>
> >>Do you know what might be wrong here?  I can send the sample grib1 file
> >>if that will help.
> >>
> >>Carl
> >>
> >>
> >>
> >
> >===============================================================================
> >Robb Kambic                             Unidata Program Center
> >Software Engineer III                           Univ. Corp for Atmospheric 
> >Research
> >address@hidden                  WWW: http://www.unidata.ucar.edu/
> >===============================================================================
> >
> >
>
>

===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================