nilsmagnus / grib

Golang GRIB2 parser
Other
57 stars 19 forks source link

Corrupt message "runtime error: index out of range" #11

Closed jewome62 closed 5 years ago

jewome62 commented 5 years ago

Hello,

I apologize in advance, I'm falling into the grib files recently, to replace an old Python import which I understand nothing. So I try to understand but I admit that it's a bit complicated ^^

I downloaded a grb file from the NOAA FTP site, but when I try to export to json, I have these following errors.

I am trying to extract meteorological data from grib files for a weather site so I am trying to do a complete redesign.

Thanks for your help

$ go version
go version go1.6.2 linux/amd64
$ grib -export 3 -file pgb174.grb
Input parameters : griblib.Options{Operation:"parse", Discipline:-1, DataExport:true, Category:-1, Filepath:"pgb174.grb", ReduceFilePath:"reduced.grib2", ExportType:3, MaximumNumberOfMessages:2147483647, GeoFilter:griblib.GeoFilter{MinLat:-90000000, MaxLat:90000000, MinLong:0, MaxLong:360000000}, Surface:griblib.Surface{Type:0xff, Scale:0x0, Value:0x0}} 
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x56cea0, 0xc82000e0c0)
        /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/nilsmagnus/grib/griblib.filterValuesFromGeoFilter(0xc82f3d9a00, 0x55d4a80faa2b580, 0x15752a0000000000, 0x35, 0x0, 0x0)
        /home/jewome62/go/src/github.com/nilsmagnus/grib/griblib/filters.go:97 +0x2b7
github.com/nilsmagnus/grib/griblib.Filter(0xc8ccba1000, 0x1a1, 0x200, 0x5a1dc8, 0x5, 0xffffffffffffffff, 0x1, 0xffffffffffffffff, 0x7fff9a5faff8, 0xa, ...)
        /home/jewome62/go/src/github.com/nilsmagnus/grib/griblib/filters.go:41 +0x47d
main.parse(0x7f65fa73d770, 0xc820090078, 0x5a1dc8, 0x5, 0xffffffffffffffff, 0x1, 0xffffffffffffffff, 0x7fff9a5faff8, 0xa, 0x5a8cc0, ...)
        /home/jewome62/go/src/github.com/nilsmagnus/grib/main.go:121 +0x1e4
main.main()
        /home/jewome62/go/src/github.com/nilsmagnus/grib/main.go:72 +0x490
nilsmagnus commented 5 years ago

Hi @jewome62, this is an issue with how missing data in Section7 is read for the datatype Data3. I have not been able to pinpoint what goes wrong here, but it is most likely a bug in data3.go, line 167-216.

Feel free to try to debug it. I wont have time to fix the issue in the near future, but I will have a look at it eventually if noone else does .

jewome62 commented 5 years ago

Hello @nilsmagnus,

Thanks for your answer, I like to contribute for lib i use. But i don't know Go Lang ^-^

So currently i have use wgrib2 from NOAA

landru29 commented 5 years ago

Can you please give us the link to download the grib file?

dev-rice commented 5 years ago

@landru29 I'm getting a similar error using this file:

ftp://ftp.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.2019011118/gfs.t18z.pgrb2.0p25.f000

❯ grib -file gfs.t18z.pgrb2.0p25.f000 -export 3
Input parameters : griblib.Options{Operation:"parse", Discipline:-1, DataExport:true, Category:-1, Filepath:"gfs.t18z.pgrb2.0p25.f000", ReduceFilePath:"reduced.grib2", ExportType:3, MaximumNumberOfMessages:2147483647, GeoFilter:griblib.GeoFilter{MinLat:-90000000, MaxLat:90000000, MinLong:0, MaxLong:360000000}, Surface:griblib.Surface{Type:0xff, Scale:0x0, Value:0x0}}
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Corrupt message "runtime error: index out of range"
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
Using GeoFilter %#V {-90000000 90000000 0 360000000}
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/nilsmagnus/grib/griblib.FilterValuesFromGeoFilter(0xc0b1954d00, 0x55d4a80faa2b580, 0x15752a0000000000, 0x35, 0x0, 0x0)
    /Users/chris/Code/go/src/github.com/nilsmagnus/grib/griblib/filters.go:98 +0x397
github.com/nilsmagnus/grib/griblib.Filter(0xc0e67c6000, 0x162, 0x200, 0x1130525, 0x5, 0xffffffffffffffff, 0x1, 0xffffffffffffffff, 0x7ffeefbff95b, 0x18, ...)
    /Users/chris/Code/go/src/github.com/nilsmagnus/grib/griblib/filters.go:41 +0x2d5
main.parse(0x114f740, 0xc00008a078, 0x1130525, 0x5, 0xffffffffffffffff, 0x1, 0xffffffffffffffff, 0x7ffeefbff95b, 0x18, 0x1131693, ...)
    /Users/chris/Code/go/src/github.com/nilsmagnus/grib/main.go:121 +0xa2
main.main()
    /Users/chris/Code/go/src/github.com/nilsmagnus/grib/main.go:72 +0x2b8
landru29 commented 5 years ago

It appears that the error occurs only when going through this part of code: https://github.com/nilsmagnus/grib/blob/master/griblib/data3.go#L91 template.MissingValue == 1

I made some fixes on my fork => no more "Corrupted message" but no idea about the consistency of data read

Can someone check data extract with my code (branch data3-fix) before I make a pull request ?

https://github.com/landru29/grib/tree/data3-fix

nilsmagnus commented 5 years ago

@donutmonger are you able to confirm the fix that @landru29 made?

landru29 commented 5 years ago

@nilsmagnus , when you will make a version with that fix, can you use semver notation (should be V1.2.1) ? https://golang.github.io/dep/docs/FAQ.html#what-semver-version-should-i-use https://semver.org/

nilsmagnus commented 5 years ago

Done

dev-rice commented 5 years ago

@nilsmagnus @landru29 that fixed it for me, thanks!