Code Monkey home page Code Monkey logo

grib22json's Introduction

GRIB2 decoder in the browser

This respository contains a decoder of GRIB2 files in javascript. You can try with your own GRIB2 files in https://bluenetcat.github.io/grib22json. The GRIB2 format was created by the World Meteorological Organization (WMO) and it is an accepted standard of the Open Geospatial Consortium (OGC).

Introduction

As far as the author knows, most web applications decode the GRIB2 files in the server and then send them to the client. For example the application from Cameron Beccario (https://earth.nullschool.net/) decodes the GRIB2 to JSON on the server (Java-app) and then formats it in his own propietary binary format to reduce the file size for transmission to the client. You can find the GRIB2json server side code here: https://github.com/cambecc/grib2json.

The advantage of decoding the GRIB2 file in the client is that it reduces the server-client transmission time (GRIB2 compresses data efficiently) and it reduces the complexity of the server (server only needs to download/store the GRIB2 from NOAA and send it to the client). Nevertheless, decoding time in the client might be an issue when GRIB2 files are large.

This decoder is in development and does not support all the features of GRIB2. It supports the decoding of GFS from NOAA, which covers a lot of forecasting variables accross the globe. According to windy.com, the dataset from NOAA is: "Basic free model provided by National Oceanic and Atmospheric Administration (NOAA) with not so good resolution. Compared to other models GFS can fail in mountain areas, and by forecasting clouds and precipitation. Since the model is free, majority of weather applications use GFS."

To download GFS files manually, I use the grib filter interface and the information about the layers. You can access both from https://nomads.ncep.noaa.gov/. A useful tutorial can be found in youtube by David Burch. In the grib filter you have to specify the level and the variable. Because most variables are only at one specific level, sometimes it is difficult to know at what level the variable is. For that, I use the information about the layers. You can infer the level you have to choose from there. For example wind speed is coded as UGRID and VGRID in the grib filter variables and the wind speed is found at the level 10 meters above ground. In the information website, you can find the wind variable name and the level (ugrd10m - 10 m above ground u-component of wind [m/s]).

Development links

I used the GRIB2 information from NOAA (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/) and ECMWF (https://apps.ecmwf.int/codes/grib/format/grib2/). The GRIB2 format was developed by the World Meteorological Organization (WMO), but the links on their website are rather hard to find or lost. The full description of GRIB2 from WMO can be found in this link.

Current status of GRIB2 decoder

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.