GribApiDotNet / GribApi.NET

A powerful .NET library for reading and writing GRIB 1 and 2 files
Apache License 2.0
54 stars 29 forks source link

use a grib2 file wih 80 levels data #96

Closed rong736 closed 6 years ago

rong736 commented 6 years ago

24003.zip

string fileFullName = @"D:\temp\Z_NWGD_C_BABJ_20170623140411_P_RFFC_SNWFD-ER03_201706230800_24003.GRB2"; using (GribFile file = new GribFile(fileFullName)) { Console.WriteLine(file.MessageCount); } output:1 but my grib2 file has 80 levels

tim 20171222165509

tim 20171222165739

jnyrup commented 6 years ago

What version of GribApi.NET are you using? If you're using 0.7.1, please try out GribApi.NET 1.0.0-beta4.

If upgrading doesn't solve your problem, can you provide access to the grib file?

rong736 commented 6 years ago

with 1.0.0-beta4 and net461 please see the attach file

jnyrup commented 6 years ago

Please don't try to send me a 270mb file over email. Can you upload the file somewhere and send me a link or another way provide me access to it? My email is my github username name and then gmail.com.

rong736 commented 6 years ago

@jnyrup 24003.zip uploaded thanks!

jnyrup commented 6 years ago

I tried decoding your file with wgrib2. Apparently it often decodes files when gribapi fails to do so.

wgrib2.exe -V -Sec3 -Sec4 -Sec5 -end 24003.GRB2

1.1:0:vt=2017062311:surface:0-3 hour acc fcst:APCP Total Precipitation [kg/m^2]:
    ndata=1682601:undef=0:mean=0.158671:min=0:max=116.98
    grid_template=0:winds(N/S):
        lat-lon grid:(1401 x 1201) units 1e-06 input WE:SN output WE:SN res 48
        lat 0.000000 to 60.000000 by 0.050000
        lon 70.000000 to 140.000000 by 0.050000 #points=1682601
:Sec3 len=72 src gdef=0 npts=1682601 Grid Def Template=3.0 opt arg=0:
Sec4 len=58 #vert coordinate=0 Product Defn Template=4.8 size=58 free=0:
Sec5 len=21 #defined data points=1682601 Data Repr. Template=5.0

It seems ecCodes parameter database don't know about apcp/"Total Precipitation", but only apcpn/"Total precipitation (nearest grid point)".

rong736 commented 6 years ago

84

default