View source: R/grib_expand_grids.R
grib_expand_grids | R Documentation |
grib_expand_grids
extracts the values from a GRIB message and expands
them into matrix
form.
grib_expand_grids(gribMessage, vector = FALSE)
gribMessage |
|
vector |
optional |
grib_expand_grids
is another convenience function that will format the
values of the GRIB message into a matrix
. In the case of a reduced
grid, an interpolation will be done to expand the values accordingly.
This function is influenced by the reduced to regular C interpolation routine used in the pygrib Python module (see pygrib source).
a matrix
or vector of values from the GRIB message.
grib_latlons
# expand basic values grid to matrix
g <- grib_open(system.file("extdata", "lfpw.grib1", package = "gribr"))
gm <- grib_get_message(g, 1)
gm_ex <- grib_expand_grids(gm)
grib_close(g)
# expand a reduced grid (uses interpolation)
g_red <- grib_open(system.file("extdata", "reduced_latlon_surface.grib1", package = "gribr"))
gm <- grib_get_message(g_red, 1)
gm_red_ex <- grib_expand_grids(gm)
grib_close(g_red)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.