Skip to content

sdifrance/gogrib2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GRIB2 library for Go programming language (golang)

Parse GRIB2 files using Golang

History

Currently in need of a parser for GRIB Edition 2 (GRIB2) we found the most an up-to-date repo in amsokol/gogrib2. Nevertheless, the last commit date from 2 feb 2018 and we felt the need to maintain it.

amsokol/gogrib2 did a great work in:

  • Porting wgrib2 from C to Go
  • Made wgrib2 thread-safe, by removing a lot of global read/write variables inside code
  • Applied new features and patches from original wgrib2 development stream

How-to

go get -u github.com/sdifrance/gogrib2

It contains only one function that parses GRIB2 file:

func Read(data []byte) ([]GRIB2, error)

where GRIB2 is the structure with parsed data:

// GRIB2 simplified file structure
type GRIB2 struct {
    RefTime     time.Time
    VerfTime    time.Time
    Name        string
    Description string
    Unit        string
    Level       string
    Values      []Value
}

// Value is data item of GRIB2 file
type Value struct {
    Longitude float64
    Latitude  float64
    Value     float32
}

See the following usage examples:

Previous Known Issues

gogrib2 does not support jpeg, png and aec data package formats. The reason is wgrib2 uses external C libraries to parse these formats. If you have an idea how to easy port jpeg, png and aec please let me know.

Contributions are Welcome

The main axis for development will be:

  • Parse GRIB2 files in Go
  • Performance
  • Correctly treat errors
  • Provide good documentation

About

Parses GRIB Edition 2 in Go. Forked from amsokol/go-grib2 (https://github.com/sdifrance/go-grib2)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages