Re: plot GRIB2 data as an image [message #48748] |
Fri, 19 May 2006 08:07  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Kenneth Bowman wrote:
> In article <1148030998.881913.176720@g10g2000cwb.googlegroups.com>,
> "JaneHurley" <jane.hurley@exeter.ox.ac.uk> wrote:
>
>
>> I'm trying to load in some GRIB2 formatted data in the hopes of
>> producing an image of cloud top heights. I've decoded the data into a
>> .c format file, using grib_api-0.7.2 as instructed by the folks at
>> ECMWF, but can't seem to do anything with it! Basically, all I want to
>> do with the data is to take the GRIB2 file that I have, decode it, and
>> then use IDL to plot a global map of the data.
>>
>> Would love some insight! Does anyone have something that will do this
>> or any insight that could help?
>>
>> Thanks in advance!
>> Jane Hurley
>
>
> I use the wgrib utility from the Climate Prediction Center to convert GRIB files
> to plain binary.
>
> http://www.cpc.ncep.noaa.gov/products/wesley/wgrib.html
>
> Then read the binary file into IDL.
>
> wgrib let's you parse the GRIB file and extract only the parts that you need.
> It will also produce a readable inventory of the GRIB file.
There's also a grib2nc converter that produces a netCDF file (that is easily readable in
IDL). I have a generic reader for netCDF files if the OP is interested (examples below)
paulv
One netcdf file:
IDL> result=read_ncdf('amsua_n16.Control7.RadDiag_Stats.nc',d)
% Compiled module: READ_NCDF.
% Compiled module: IS_NCDF.
% Loaded DLM: NCDF.
Number of dimensions : 6
Number of variables : 9
Number of global attributes : 7
ID of unlimited dimension : -1
IDL> help, d, /struct
** Structure <8487e64>, 15 tags, length=120312, data length=120312, refs=1:
NPREDICTORS LONG 5
NCHANNELS LONG 15
NFOVS LONG 30
NTIMES LONG 123
NVARIABLES LONG 8
STRLEN LONG 80
AIRMASSCOEFFICIENTS
FLOAT Array[5, 15, 123]
CHANNEL LONG Array[15]
FOV LONG Array[30]
SCAN_DATA FLOAT Array[8, 15, 30]
SCAN_NSAMPLES LONG Array[15, 30]
DATETIME LONG Array[123]
TIME_DATA FLOAT Array[8, 15, 123]
TIME_NSAMPLES LONG Array[15, 123]
VARIABLENAMES STRING Array[8]
and a different one:
IDL> print, read_ncdf('windsat_coriolis.SpcCoeff.nc',d)
% Compiled module: READ_NCDF.
% Compiled module: IS_NCDF.
% Loaded DLM: NCDF.
Number of dimensions : 2
Number of variables : 18
Number of global attributes : 8
ID of unlimited dimension : -1
1
IDL> help, d, /struct
** Structure <848942c>, 20 tags, length=1680, data length=1680, refs=1:
N_CHANNELS LONG 16
SDSL LONG 20
RELEASE LONG 6
VERSION LONG 2
SENSOR_DESCRIPTOR
STRING Array[16]
SENSOR_TYPE LONG Array[16]
NCEP_SENSOR_ID LONG Array[16]
WMO_SATELLITE_ID
LONG Array[16]
WMO_SENSOR_ID LONG Array[16]
SENSOR_CHANNEL LONG Array[16]
FREQUENCY DOUBLE Array[16]
WAVENUMBER DOUBLE Array[16]
PLANCK_C1 DOUBLE Array[16]
PLANCK_C2 DOUBLE Array[16]
BAND_C1 DOUBLE Array[16]
BAND_C2 DOUBLE Array[16]
POLARIZATION LONG Array[16]
IS_SOLAR_CHANNEL
LONG Array[16]
COSMIC_BACKGROUND_RADIANCE
DOUBLE Array[16]
SOLAR_IRRADIANCE
DOUBLE Array[16]
--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|