GRIB (.grb, .grib)

Background & Context

    • GRIB scientific data file format.
    • Self-describing format for exchanging scientific data.
    • Commonly used in meteorology to store historical and forecast weather data.
    • Represents numerical weather prediction output (NWP).
    • GRIB is an acronym derived from Gridded Binary.
    • Binary file format.
    • Standardized by the World Meteorological Organization's Commission for Basic Systems.

Import & Export

  • Import["file.grb"] imports a GRIB file, returning the names of the datasets stored in the file.
  • Import["file.grb"] returns a list of strings representing the names of all datasets contained in the file.
  • Import["file.grb",elem] imports the specified element from a GRIB file.
  • Import["file.grb",{elem,suba,subb,}] imports a subelement.
  • Import["file.grb",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","GRIB"] or Import["file",{"GRIB",elem,}].
  • See the following reference pages for full general information:
  • Importimport from a file
    CloudImportimport from a cloud object
    ImportStringimport from a string
    ImportByteArrayimport from a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Data representation elements:
  • "Data"all datasets imported as a list of arrays
    "Datasets"names of all datasets
  • Import by default uses the "Datasets" element for the GRIB format.
  • Specifying and selecting datasets:
  • "Datasets",nn^(th) dataset
    "Datasets",datasetnamed dataset
  • Meta-information elements:
  • "Annotations"meta-information for each dataset
    "DataFormat"type used to represent each dataset
    "Dimensions"data dimensions of each dataset
    "Metadata"general meta-information as a list of rules

Examples

Basic Examples  (3)

Get the names of datasets stored in a GRIB file:

Import a dataset:

Render the imported data as an image:

Read meta-information from a GRIB file: