pygrib icon indicating copy to clipboard operation
pygrib copied to clipboard

[email protected]

Open ghost opened this issue 7 years ago • 2 comments

I am trying to download a noaa grib2 file in python2.7 on Ubuntu 16.04. I am getting the following error:

Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import pygrib YYYYMMDD=20170710 CC=00 file='http://www.ftp.ncep.noaa.gov/data/nccf/com/etss/prod/etss.${YYYYMMDD}/etss.t${CC}z.stormtide.ala3km.grib2' gr=pygrib.open(file) Traceback (most recent call last): File "", line 1, in File "pygrib.pyx", line 394, in pygrib.open.cinit (pygrib.c:2948) IOError: [Errno could not open %s] http://www.ftp.ncep.noaa.gov/data/nccf/com/etss/prod/etss.${YYYYMMDD}/etss.t${CC}z.stormtide.ala3km.grib2

I get the same error on python3. Can anyone provide some feedback on this error message. I'm a beginner in using pygrib. Thanks

ghost avatar Jul 10 '17 03:07 ghost

Download the file first, then open it in pygrib.

jswhit avatar Jul 10 '17 12:07 jswhit

I downloaded the file; opened it in pygrib and tried some of the examples. Work fine. Thank you. I need to iterate through the file to extract the the surge tide forecast for a specific location (lon, lat). Question: How to a find out the attribute name to use? The GRIB2 - TABLE 4.2-10-3 at http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table4-2-10-3.shtml referenced the entry 250 for the data with an abbreviated name "ETCWL". I tried it with name='ETCWL' in the select method; it did not work. Thanks

ghost avatar Jul 18 '17 23:07 ghost