how to read grib variable: U-component_of_wind

90 views
Skip to first unread message

Augustin

unread,
May 6, 2013, 5:24:33 PM5/6/13
to ncto...@googlegroups.com
Hello,

I'm trying to read a GRIB2 file containing the variable name: U-component_of_wind 


u = ds.struct('U-component_of_wind', , [1 1 1 1], [1 1 190 384])

returns:

Invalid field name: 'U-component_of_wind'

which I imagine is due to the minus sign between 'U' and 'component'

any way around this issue?

Thanks,
A.

Rich Signell

unread,
May 6, 2013, 7:59:10 PM5/6/13
to ncto...@googlegroups.com
You could read it like this:

url = 'http://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p5deg/files/GFS_Global_0p5deg_20130506_1200.grib2';
nc = ncgeodataset(url);
var = 'u-component_of_wind_altitude_above_msl';

u=nc{var}(1,1,:,:);
g=nc{var}(1,1,:,:).grid;

pcolorjw(g.lon,g.lat,u);
> --
> You received this message because you are subscribed to the Google Groups
> "nctoolbox" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nctoolbox+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Dr. Richard P. Signell (508) 457-2229
USGS, 384 Woods Hole Rd.
Woods Hole, MA 02543-1598

Augustin Vintzileos

unread,
May 6, 2013, 8:16:16 PM5/6/13
to ncto...@googlegroups.com
Thanks! Greatly appreciated.

A.




--
You received this message because you are subscribed to a topic in the Google Groups "nctoolbox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nctoolbox/4kEgekWG8k8/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to nctoolbox+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages