DaniSb170 / nctoolbox

Automatically exported from code.google.com/p/nctoolbox
0 stars 0 forks source link

Issue with reading GRIB2 file... "Missing End of GRIB" #64

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Start MATLAB and run the following code:

fullpath=''http://www.ftp.ncep.noaa.gov/data/nccf/com/gfs/prod/gfs.2015012100/gf
s.t00z.pgrb2.0p25.f096''

title = strcat('GFS_hr',hrstr);
saveit = urlwrite(fullpath,title);
xx = ncdataset(title);  
tempdata = xx.data(xx.variables{40});

2. Error message appears: 

[main] WARN  ucar.nc2.grib.grib2.Grib2RecordScanner  - Missing End of GRIB 
message at pos=1110338 header=  for=GFS_hr096

What is the expected output? What do you see instead?
The expected output is data being loaded in successfully... and instead I get 
the error above in #2. 

What version of the product are you using? On what operating system?
2014b  windows 7

Please provide any additional information below.

Original issue reported on code.google.com by packatta...@hotmail.com on 21 Jan 2015 at 6:07

GoogleCodeExporter commented 8 years ago
Just a couple of Notes:

1. Just a note that the code sample above doesn't run as is. Make sure to 
substitute a dummy string in for the 'title' variable.

2. I've fetched the file using curl. Just a note for that it takes a while as 
the file is 217MB and the FTP connection is a bit slow:

    curl http://www.ftp.ncep.noaa.gov/data/nccf/com/gfs/prod/gfs.2015012100/gfs.t00z.pgrb2.0p25.f096 -o gfs.t00z.pgrb2.0p25.f096

3. The message you're seeing is a WARNING not an ERROR. When you look at the 
data read into 'tempdata' do you notice that anything is wrong with it? 
(missing data, wrong size, etc.)

Original comment by bschlin...@gmail.com on 21 Jan 2015 at 7:08

GoogleCodeExporter commented 8 years ago
OK, I ran a test using nctoolbox's 1.0.x branch and didn't see any warning. I 
suspect that warning may be from an older version of grib.

>> xx = ncdataset('/Users/brian/Downloads/gfs.t00z.pgrb2.0p25.f096')

xx = 

  ncdataset with properties:

     location: '/Users/brian/Downloads/gfs.t00z.pgrb2.0p25.f096'
       netcdf: [1x1 ucar.nc2.dataset.NetcdfDataset]
    variables: {167x1 cell}

>> tempdata = xx.data(xx.variables{40});

As a workaround, I temporarily posted a snapshot of nctoolbox-1.0.x for you at: 
https://drive.google.com/file/d/0B8RHIr7J8XHoTWhxbUEzejVDR0U/view?usp=sharing

Original comment by bschlin...@gmail.com on 21 Jan 2015 at 7:14

GoogleCodeExporter commented 8 years ago
Thanks bschlin... I'm downloading the .zip right now.  Since the file is so 
large... think there is a way to pull the variable I want directly from the 
server instead of downloading all 217MB before doing so? 

Original comment by packatta...@hotmail.com on 21 Jan 2015 at 7:27

GoogleCodeExporter commented 8 years ago
If the grib file was served via OpenDAP or Thredds than yes, you could use the 
opendap url with nctoolbox. Then only the parts of the data you actually 
requested would be fetched across the network. You might want to browse through 
the servers listed at http://nomads.ncdc.noaa.gov/data.php or contact someone 
at who manages the data to find an opendap url for the datasets that you're 
interested in.

Good Luck!

Original comment by bschlin...@gmail.com on 21 Jan 2015 at 7:37

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by bschlin...@gmail.com on 21 Jan 2015 at 7:41