Re: Routines for reading grib2 and BUFR [message #71492 is a reply to message #71486] |
Tue, 22 June 2010 10:51   |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article
<7b5ab75b-f2de-43cc-bf67-de7766d90c15@j8g2000yqd.googlegroups.com>,
Klemens <jokulhlaup@web.de> wrote:
> Hi all,
>
> working with Eumetsat satellite data, I am looking for routines to
> read grib2 and BUFR (Binary Universal Form for the Representation of
> meteorological data) data directly in IDL. I have played around with
> the IDL grib routine, but it does now work properly for grib2 data. I
> know the NCL library, but since I am working in the Windows
> environment, it is not very comfortable. To read BUFR, I have not
> found anything, that seems to be applicable for me. May be there is
> somebody out there who faced the same problems and spent some effort
> to code something in IDL...
>
> Thank for your help in advance !
>
> Cheers,
>
> Klemens
At this time your best bet is probably to use wgrib2
http://www.cpc.noaa.gov/products/wesley/wgrib2/
to convert the files to binary, then read the binary
files using standard IDL I/O.
I have only done this with wgrib, not wgrib2, but it should
be very similar.
I have generally found that compiling wgrib is easy, even for
a non-C programmer like me. Just cc it to make an executable.
The approach that I use is:
1. Use wgrib to generate an inventory of the records in the file.
2. Parse the inventory file to identify records that you want to read
(create a subset of the inventory records). STRSPLIT is your friend.
3. Use wgrib to convert the grib file to a binary file, copying
only the records you selected in step 2.
4. Read the binary file into IDL using unformatted I/O.
All of this can be done within an IDL program (on a unix-based
system, I guess) by using SPAWN to run wgrib.
It is ugly, but it works. Good luck.
Ken
|
|
|